Resolves the provider and per-call options for an ExAthena request.
Resolution order (per key):
opts[:key]— per-call override always wins.Application.get_env(:ex_athena, provider)[:key]— provider-specific config.Application.get_env(:ex_athena, :key)— top-level library config.- Provider default (if the provider declares one).
Matches the stripity_stripe / ex_aws pattern: per-call overrides win,
application config is the default, no global mutable state.
Known providers
| Atom | Module |
|---|---|
:ollama | ExAthena.Providers.Ollama |
:openai_compatible | ExAthena.Providers.OpenAICompatible |
:openai | ExAthena.Providers.OpenAICompatible |
:llamacpp | ExAthena.Providers.OpenAICompatible |
:claude | ExAthena.Providers.Claude |
:mock | ExAthena.Providers.Mock |
You may also pass any module that implements ExAthena.Provider directly.
Summary
Functions
Look up a single configuration value for provider_module with the tiered
resolution order. opts wins, then provider-specific config, then top-level
config, then the supplied default.
Pop :provider from opts and return {provider_module, remaining_opts}.
Resolve a provider atom (or module) to its implementing module.
Build the keyword list passed to a provider's query/2 / stream/3 callback.
Translate an ExAthena provider atom into the req_llm provider tag used in
"tag:model-id" specs. Returns nil when the atom doesn't map to req_llm
(e.g. :mock, or a user-supplied module).
Functions
Look up a single configuration value for provider_module with the tiered
resolution order. opts wins, then provider-specific config, then top-level
config, then the supplied default.
The provider atom is derived from the module name: Providers.Ollama → :ollama.
Pop :provider from opts and return {provider_module, remaining_opts}.
Raises ArgumentError if no provider is set in opts or in application env.
Resolve a provider atom (or module) to its implementing module.
Build the keyword list passed to a provider's query/2 / stream/3 callback.
Flattens per-call overrides + application env for this provider into one
keyword list. Providers use Keyword.get/3 on the result.
Translate an ExAthena provider atom into the req_llm provider tag used in
"tag:model-id" specs. Returns nil when the atom doesn't map to req_llm
(e.g. :mock, or a user-supplied module).