Skip to content

Providers

Cristiano Carvalho edited this page Sep 5, 2026 · 10 revisions

Aludel supports cloud and local providers through a shared configuration model, while preserving provider-specific behavior in config. Each provider is a different reagent: same apparatus, different temperament.

Comparison

Provider Deployment API Key Example demo model
OpenAI Cloud Required gpt-4o
Anthropic Cloud Required claude-sonnet-4-5-20250929
Google Gemini Cloud Required gemini-2.5-flash
Ollama Local Not required llama3.2
xAI Cloud Required grok-4-0709
Groq Cloud Required llama-3.3-70b-versatile
OpenRouter Cloud Required anthropic/claude-sonnet-4

Configuration Shape

All providers follow the same top-level shape, which keeps the outer vessel familiar even when the contents change:

{
  "provider": "openai | anthropic | google | ollama | xai | groq | openrouter",
  "model": "provider-specific-model",
  "config": {},
  "pricing": null
}

Provider Examples

OpenAI

Requires the OPENAI_API_KEY environment variable.

{
  "provider": "openai",
  "model": "gpt-4o",
  "config": {
    "temperature": 0.7,
    "max_tokens": 1000
  }
}

Common models: gpt-4o, gpt-4o-mini, gpt-3.5-turbo, o1, o1-mini

Anthropic

Requires the ANTHROPIC_API_KEY environment variable.

{
  "provider": "anthropic",
  "model": "claude-sonnet-4-5-20250929",
  "config": {
    "temperature": 0.7,
    "max_tokens": 1000
  }
}

Common models in the seeded setup include claude-sonnet-4-5-20250929 and claude-haiku-4-5-20251001.

Google Gemini

Requires the GOOGLE_API_KEY environment variable.

{
  "provider": "google",
  "model": "gemini-2.5-flash",
  "config": {
    "temperature": 0.7,
    "max_tokens": 1024
  }
}

Common models in the seeded setup include gemini-2.5-flash and gemini-2.5-pro.

Ollama

No API key is required. Ollama runs locally and is well suited to private experiments and fast iteration.

ollama pull llama3.1:8b
{
  "provider": "ollama",
  "model": "llama3.1:8b",
  "config": {
    "temperature": 0.8,
    "num_ctx": 4096
  }
}

xAI

Requires XAI_API_KEY.

{
  "provider": "xai",
  "model": "grok-4-0709",
  "config": {"temperature": 0.7}
}

Groq

Requires GROQ_API_KEY.

{
  "provider": "groq",
  "model": "llama-3.3-70b-versatile",
  "config": {"temperature": 0.7}
}

OpenRouter

Requires OPENROUTER_API_KEY. Model IDs retain the upstream provider prefix.

{
  "provider": "openrouter",
  "model": "anthropic/claude-sonnet-4",
  "config": {"temperature": 0.7}
}

Common Parameters

Parameter Providers Default Description
temperature All OpenAI/Google/xAI/Groq/OpenRouter: 0.7; Anthropic: 0.5; Ollama: 0.8 Sampling temperature passed to ReqLLM
max_tokens Hosted providers OpenAI: 1000; Anthropic/Google/xAI/Groq/OpenRouter: 1024 Maximum requested output length

Provider configuration is stored as JSON. The included adapters currently read the keys above; other keys are retained but are not forwarded automatically.

API Keys

Keys are read from the environment at runtime and are never valid provider configuration:

export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...
export GOOGLE_API_KEY=...
export XAI_API_KEY=...
export GROQ_API_KEY=...
export OPENROUTER_API_KEY=...

Keys are supplied through runtime configuration and are not stored in provider rows.

Dashboard example

In Providers, put only generation settings in Configuration (JSON):

{
  "temperature": 0.7,
  "max_tokens": 1000
}

Credential-shaped keys are rejected recursively, including keys nested inside maps or lists. Configure the matching environment variable before starting the host application or standalone server instead.

Mix and embedded application example

config :aludel, :llm,
  openai_api_key: System.get_env("OPENAI_API_KEY"),
  anthropic_api_key: System.get_env("ANTHROPIC_API_KEY"),
  google_api_key: System.get_env("GOOGLE_API_KEY"),
  xai_api_key: System.get_env("XAI_API_KEY"),
  groq_api_key: System.get_env("GROQ_API_KEY"),
  openrouter_api_key: System.get_env("OPENROUTER_API_KEY")

Provider rows can still store ordinary model options such as temperature, max_tokens, top_p, and provider-specific non-secret settings.

Upgrade note

The credential-storage hardening migration removes credential-shaped keys from existing provider configuration while preserving safe nested settings. Rotate any credential that was previously entered in provider JSON because older database backups or logs may still contain a copy.

Model Discovery

Provider forms read LLMDB and show only chat or text-generation models. Active models are the default list; deprecated models remain available for existing configurations. Choose Custom model when a compatible model ID is not yet in the catalog.

Cost Tracking

Cost is estimated automatically from token counts and provider pricing data. By default, Aludel resolves built-in per-model rates from LLMDB, and a provider row can optionally override those rates with custom input and output pricing values.

Ollama models resolve to free by default.

API Reference

create_provider(attrs)
update_provider(provider, attrs)
delete_provider(provider)
get_provider!(id)
list_providers()
fetch_models(provider_type)
fetch_model_groups(provider_type)
default_pricing(provider, model)

See Documents and Storage for provider document handling and Runs and Execution for native and callback dispatch.

Clone this wiki locally