Tinkex.Tokenizer.HTTPClient (Tinkex v0.4.0)

Copy Markdown View Source

HTTP client adapter for HuggingFace downloads used by tokenizers.

The upstream Tokenizers.HTTPClient relies on CAStore.file_path/0, which points at a priv/ file that is not available inside an escript archive.

This adapter uses OTP-provided CA certs (:public_key.cacerts_get/0) so the ./tinkex CLI can download tokenizers at runtime.

Summary

Functions

request(opts)

@spec request(keyword()) ::
  {:ok,
   %{status: pos_integer(), headers: [{String.t(), String.t()}], body: binary()}}
  | {:error, term()}