Factory and discovery for OpenAI-compatible endpoints (e.g. NVIDIA, Together, vLLM, LM Studio).
Unlike cloud provider modules, this queries the running server at call time because the available models depend on the specific endpoint.
Examples
iex> Planck.AI.Models.CustomOpenAI.model("meta/llama-3.1-8b-instruct",
...> identifier: "nvidia",
...> base_url: "https://integrate.api.nvidia.com/v1",
...> context_window: 128_000
...> )
%Planck.AI.Model{provider: :custom_openai, identifier: "nvidia", ...}
Summary
Functions
Discovers models from an OpenAI-compatible /models endpoint.
Builds a Planck.AI.Model for a custom OpenAI-compatible endpoint.
Functions
@spec all(keyword()) :: [Planck.AI.Model.t()]
Discovers models from an OpenAI-compatible /models endpoint.
Options
:base_url— base URL of the server (required).:api_key— bearer token sent asAuthorization: Bearer <key>.:identifier— name used to identify this endpoint (e.g."nvidia"). Stored on each returned model.:context_window— default context window for discovered models. Defaults to4_096.:max_tokens— default max tokens. Defaults to2_048.
@spec model( String.t(), keyword() ) :: Planck.AI.Model.t()
Builds a Planck.AI.Model for a custom OpenAI-compatible endpoint.
Options
:identifier— name used to identify this endpoint (e.g."nvidia").:base_url— base URL of the server.:api_key— bearer token for authentication.:name— display name. Defaults toid.:context_window— context window size. Defaults to4_096.:max_tokens— max tokens to generate. Defaults to2_048.:supports_thinking— whether the model supports thinking blocks. Defaults tofalse.:input_types— list of supported input modalities. Defaults to[:text].:default_opts— inference parameters applied on every call. Defaults to[].