LLM.Provider.Presets (LLM v0.1.0)

Copy Markdown View Source

Built-in provider presets.

Each preset defines a dialect, base_url, and api_key setting. API keys are read from application config, not environment variables.

Configuration

config :llm, :providers,
  openai: [api_key: "sk-..."],
  anthropic: [api_key: "sk-ant-..."]

Or at runtime:

LLM.Provider.Presets.put_key(:openai, "sk-...")

Summary

Functions

Get a preset provider config by name.

Get an API key, checking process dictionary first, then application config.

List all available preset names.

Store an API key in the process dictionary for runtime use.

Functions

get(name)

Get a preset provider config by name.

get_key(provider_name)

Get an API key, checking process dictionary first, then application config.

list_presets()

List all available preset names.

put_key(provider_name, api_key)

Store an API key in the process dictionary for runtime use.