Skip to main content

Provider registry reference

Talon’s LLM router uses a provider registry: each provider implements the same interface, registers itself at startup, and is selected by the router using policy (tier, cost, and EU data sovereignty). This page describes the registry, the Provider interface, compliance metadata, and the talon provider CLI.


Provider interface

All providers implement internal/llm/provider.go:

MethodPurpose
Name() stringCanonical provider ID (e.g. openai, anthropic).
Metadata() ProviderMetadataStatic compliance and identity (jurisdiction, EU regions, wizard hint).
Generate(ctx, req) (*Response, error)Send a completion request; return content and token counts.
Stream(ctx, req, ch) errorStream completion; return ErrNotImplemented if not supported.
EstimateCost(model, in, out) float64Cost in EUR for the given model and token counts.
ValidateConfig() errorValidate config at startup (no network).
HealthCheck(ctx) errorOptional liveness check.
WithHTTPClient(*http.Client) ProviderReturn a copy with the given client (for tests).

The router and CLI never depend on concrete provider types; they use this interface only.


Compliance metadata

ProviderMetadata is used for:

  • EU routing — OPA routing.rego allows or denies a provider by jurisdiction and region (see EU data sovereignty).
  • Evidence — Traces and evidence can record provider jurisdiction and region.
  • Init wizard — In a terminal, talon init runs an interactive wizard that uses ListForWizard() to show providers with WizardHint (display name, suffix, order, region options). Use talon init --list-providers to print the same list and exit.
FieldTypeMeaning
IDstringSame as Name().
DisplayNamestringHuman-readable name.
JurisdictionstringEU, US, CN, CA, or LOCAL.
DPAAvailableboolData Processing Agreement available.
EURegions[]stringEU region IDs (e.g. westeurope).
GDPRCompliantboolSelf-declared / verified.
AIActScopestringin_scope, third_country, or exempt.
DataRetentionstringShort summary.
PricingAvailableboolTrue when the pricing table has at least one model for this provider (set dynamically in Metadata()).
WizardWizardHintSuffix, order, hidden, region list.

EU data sovereignty

When talon.config.yaml has an llm.routing.data_sovereignty_mode set to eu_strict, eu_preferred, or global, the router evaluates each candidate provider with the OPA policy in internal/policy/rego/routing.rego. Evidence records the selected provider and rejected candidates with reasons. See Configuration reference for the llm block.


Registered providers (built-in)

IDJurisdictionEU regionsNotes
openaiUSOpenAI API; custom base URL supported.
anthropicUSAnthropic Messages API.
azure-openaiEUwesteurope, swedencentral, francecentral, uksouthAzure OpenAI.
bedrockUSeu-central-1, eu-west-1, eu-west-3AWS Bedrock.
mistralEUMistral AI.
ollamaLOCALLocal models.
vertexUSeurope-west1, europe-west4, europe-west9Google Vertex AI.
qwenCNAlibaba Cloud Qwen.
cohereCACohere.
generic-openaiUSUser-declared jurisdiction; any OpenAI-compatible API.

To add a provider, use the contributor guide.


Cost estimation

Talon estimates per-request LLM costs using a static pricing table at pricing/models.yaml. This file ships with current prices for all bundled providers and is operator-editable without recompilation. The path is configurable via llm.pricing_file in talon.config.yaml (default: pricing/models.yaml).

Cost estimates appear in the evidence trail (pre_request_estimate and post_request_cost on the routing decision) and as OTel span attributes (talon.cost.estimated_usd, talon.cost.pricing_known, etc.). They are not used for routing decisions in this version.

To update pricing, edit pricing/models.yaml and restart Talon. Hot-reload is not currently supported.

For providers with models: {} (ollama, generic-openai), operators can add custom model pricing as needed. Run talon init (wizard or talon init --scaffold) to generate a project that includes pricing/models.yaml and llm.pricing_file in the config.


talon provider CLI

CommandPurpose
talon provider listTable of all registered providers with ID, jurisdiction, GDPR, EU regions, DPA.
talon provider info <type>Detailed compliance info for one provider (includes pricing status: available models or not configured).
talon provider allowedList providers and whether they are allowed under the current data_sovereignty_mode (from config).

Example:

talon provider list
talon provider info openai
talon provider allowed

Makefile targets

TargetUsagePurpose
make provider-listBuild and run talon provider list.
make provider-new NAME=<name>e.g. NAME=groqCopy _scaffold to internal/llm/providers/<name>.
make test-provider PROVIDER=<name>e.g. PROVIDER=openaiRun tests for one provider.
make test-provider-complianceRun metadata completeness checks for all providers.
make opa-testRun OPA policy tests (e.g. routing.rego).