# `Obscura.Tiktoken`
[🔗](https://github.com/hfiguera/obscura/blob/v0.2.0/lib/obscura/tiktoken.ex#L1)

Tiktoken-compatible byte-pair encodings used by Obscura.

This module intentionally implements the subset of Python tiktoken that
Obscura needs for privacy-filter tokenization. It does not fetch assets from
the network at runtime.

# `encoding`

```elixir
@type encoding() :: Obscura.Tiktoken.Encoding.t()
```

# `encoding_for_model`

```elixir
@spec encoding_for_model(String.t()) :: {:ok, encoding()} | {:error, term()}
```

# `encoding_name_for_model`

```elixir
@spec encoding_name_for_model(String.t()) :: {:ok, String.t()} | {:error, term()}
```

# `get_encoding`

```elixir
@spec get_encoding(String.t() | atom()) :: {:ok, encoding()} | {:error, term()}
```

Loads a supported encoding from verified local assets.

# `get_encoding!`

```elixir
@spec get_encoding!(String.t() | atom()) :: encoding()
```

# `list_encoding_names`

```elixir
@spec list_encoding_names() :: [String.t()]
```

Lists the supported encoding names.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
