Model Configuration#
Configure which LLM models your agents use.
Overview#
Pantheon provides a unified LLM interface with native SDK adapters, giving access to many LLM providers through a consistent API.
Key features:
Smart Model Selection: Use quality tags (
high,normal,low) instead of hardcoding model namesAutomatic Provider Detection: Pantheon detects available providers from your API keys
Capability Filtering: Select models by capabilities (
vision,reasoning,tools, etc.)Fallback Chains: Automatic failover to backup models
Smart Model Selection#
Instead of hardcoding specific model names, you can use Pantheon’s intelligent tag-based selection.
Automatic Provider Detection#
Pantheon automatically detects available providers from environment variables:
# Set any of these - Pantheon will use the first available
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export GEMINI_API_KEY="..."
Provider priority (configurable in settings.json):
OpenAI
Anthropic
Gemini
Z.ai (Zhipu)
DeepSeek
Supported Providers#
Pantheon supports many LLM providers. Here are the most common ones:
Major Cloud Providers#
Provider |
Prefix |
Example Models |
|---|---|---|
OpenAI |
|
|
Anthropic |
|
|
Google AI |
|
|
Azure OpenAI |
|
Your deployed model names |
AWS Bedrock |
|
|
Google Vertex AI |
|
|
Specialized AI Platforms#
Provider |
Prefix |
Example Models |
|---|---|---|
Mistral AI |
|
|
Cohere |
|
|
Groq |
|
|
Together AI |
|
|
Fireworks AI |
|
|
DeepSeek |
|
|
Perplexity |
|
|
OpenRouter |
|
Access to 100+ models via single API |
Local & Open Source#
Provider |
Prefix |
Example Models |
|---|---|---|
Ollama |
|
|
vLLM |
|
Any HuggingFace model |
LM Studio |
|
Local models |
HuggingFace |
|
|
Chinese Providers#
Provider |
Prefix |
Example Models |
|---|---|---|
Z.ai (Zhipu) |
|
|
Qwen (Alibaba) |
|
|
Baidu ERNIE |
|
|
Kimi (Moonshot) |
(none) |
|
Note
Kimi Coding: Use model name kimi-for-coding with LLM_API_BASE=https://api.kimi.com/coding/v1
and your Kimi API key as LLM_API_KEY. See Kimi Code Docs for details.
Note
For additional providers, see the Pantheon documentation or configure custom endpoints.
Model Format#
You can specify models in two ways:
1. Strict Model Name (provider/model-name):
openai/gpt-5.4
anthropic/claude-opus-4-5-20251101
gemini/gemini-3-pro-preview
deepseek/deepseek-chat
2. Tags (quality and/or capability):
high
normal
low
high,vision
normal,reasoning
low,tools
For OpenAI models, the prefix is optional:
# These are equivalent
agent = Agent(model="gpt-4o")
agent = Agent(model="openai/gpt-4o")
Configuration#
Settings File#
Configure model defaults in .pantheon/settings.json:
{
"models": {
"provider_priority": ["openai", "anthropic", "gemini", "deepseek"],
"provider_models": {
"openai": {
"high": ["openai/gpt-5.4-pro", "openai/gpt-5.4", "openai/gpt-5.2"],
"normal": ["openai/gpt-5.4", "openai/gpt-5.2", "openai/gpt-4o"],
"low": ["openai/gpt-5-mini", "openai/gpt-4o-mini"]
},
"anthropic": {
"high": ["anthropic/claude-opus-4-5-20251101"],
"normal": ["anthropic/claude-sonnet-4-5-20250929"],
"low": ["anthropic/claude-haiku-4-5-20251001"]
}
}
}
}
Provider Priority#
Control which provider is used when multiple API keys are available:
{
"models": {
"provider_priority": ["anthropic", "openai", "gemini"]
}
}
Model in Templates#
In agent templates (.pantheon/agents/*.md):
---
name: Smart Agent
model: high,vision
---
You are a helpful assistant with vision capabilities.
In team templates:
---
name: Research Team
model: normal
agents:
- name: researcher
model: high
instructions: Research complex topics.
- name: writer
model: low
instructions: Write summaries.
---
Python API#
from pantheon.agent import Agent
# Using tags (recommended)
agent = Agent(model="normal")
agent = Agent(model="high,vision")
# Using strict model name
agent = Agent(model="anthropic/claude-opus-4-5-20251101")
# Using fallback chain
agent = Agent(model=["openai/gpt-5.4", "openai/gpt-5.2", "openai/gpt-4o"])
API Keys#
Set API keys via environment variables (recommended):
# Major providers
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export GEMINI_API_KEY="..."
export GOOGLE_API_KEY="..." # Alternative for Gemini
# Other providers
export MISTRAL_API_KEY="..."
export COHERE_API_KEY="..."
export GROQ_API_KEY="..."
export DEEPSEEK_API_KEY="..."
export TOGETHER_API_KEY="..."
export FIREWORKS_API_KEY="..."
export OPENROUTER_API_KEY="..."
# Chinese providers
export ZAI_API_KEY="..."
export QWEN_API_KEY="..."
Or in .pantheon/settings.json (not recommended for security):
{
"api_keys": {
"OPENAI_API_KEY": "sk-..."
}
}
Custom API Endpoint (Third-party Proxy)#
To route all LLM calls through a third-party proxy or custom OpenAI-compatible endpoint,
set the universal LLM_API_BASE and LLM_API_KEY:
export LLM_API_BASE="https://your-proxy.com/v1"
export LLM_API_KEY="your-proxy-key"
Or add to your .env / ~/.pantheon/.env file:
LLM_API_BASE=https://your-proxy.com/v1
LLM_API_KEY=your-proxy-key
Interactive setup:
# Launch the setup wizard
pantheon setup
# Select option [0] Custom API Endpoint
# Or use /keys in the REPL
/keys 0 https://your-proxy.com/v1 your-proxy-key
Priority rules:
Base URL:
OPENAI_API_BASE(provider-specific) >LLM_API_BASE(universal)API Key (unified proxy mode): When
LLM_API_BASEis set,LLM_API_KEYtakes priority over provider-specific keys (e.g.OPENAI_API_KEY). This ensures all requests to the proxy use the correct credentials.API Key (normal mode): When no
LLM_API_BASEis set, provider-specific keys (e.g.OPENAI_API_KEY) take priority overLLM_API_KEY.
Azure OpenAI#
Configure Azure endpoints:
export AZURE_API_KEY="..."
export AZURE_API_BASE="https://your-resource.openai.azure.com"
export AZURE_API_VERSION="2024-02-01"
Use with:
agent = Agent(model="azure/your-deployment-name")
Local Models (Ollama)#
Install Ollama
Pull a model:
ollama pull llama3Use in Pantheon:
agent = Agent(model="ollama/llama3")
Model Parameters#
Set model parameters per-agent:
agent = Agent(
model="high",
model_params={
"temperature": 0.7,
"max_tokens": 4000,
"top_p": 0.9
}
)
In templates:
---
name: Creative Writer
model: high
temperature: 0.9
max_tokens: 4000
---
Temperature Guidelines#
0.0-0.3: Deterministic, factual (code, analysis)
0.4-0.7: Balanced (general tasks)
0.8-1.0: Creative (writing, brainstorming)
Troubleshooting#
“No provider available”
# Check if API keys are set
echo $OPENAI_API_KEY
echo $ANTHROPIC_API_KEY
# Set one
export OPENAI_API_KEY="sk-..."
“Model not found”
Check model name spelling
Verify the model exists for that provider
Check provider prefix is correct
“Rate limit exceeded”
Use quality tags - Pantheon will fallback automatically
Configure fallback models in settings.json
Add delays between requests
Checking Available Models
from pantheon.utils.model_selector import get_model_selector
selector = get_model_selector()
info = selector.list_available_models()
print("Available providers:", info["available_providers"])
print("Current provider:", info["current_provider"])
print("Models:", info["models_by_provider"])