LLM Configuration
Configure LLM provider API keys, model selection, Azure OpenAI, and custom endpoints for Reflexio.
Reflexio uses LiteLLM for multi-provider LLM support. You must configure an API key for at least one provider.
Hosted Enterprise
Reflexio Enterprise users can configure LLM provider API keys and model selection through the Settings page in the web portal under Advanced Settings.
Current OpenAI and Anthropic models
Reflexio requires LiteLLM >=1.108.4,<2. The following model IDs are qualified
with deterministic provider-adapter tests for structured extraction and tool
loops (September 30, 2026):
| Provider | Model IDs |
|---|---|
| OpenAI | gpt-6-astra, gpt-6.1-sol, gpt-6-luna |
| Anthropic | claude-fable-5-1, claude-opus-5-5, claude-sonnet-5-5, claude-haiku-4-5-20251001 |
Bare IDs and direct provider prefixes such as openai/gpt-6.1-sol and
anthropic/claude-sonnet-5-5 are supported. Select them through the existing
LLMConfig model overrides; this compatibility update does not change the
provider defaults or any saved organization model selection.
from reflexio.models.config_schema import LLMConfig
config = client.get_config()
if config.llm_config is None:
config.llm_config = LLMConfig()
config.llm_config.generation_model_name = "openai/gpt-6.1-sol"
client.set_config(config)For these GPT-6 and new Claude models, Reflexio omits temperature, top_p,
and top_k rather than forwarding unsupported sampling settings. GPT-6 Luna
retains temperature and top_p when reasoning_effort="none" is explicitly
requested. Existing
Haiku sampling behavior is preserved. LiteLLM routes reasoning OpenAI function
tool requests through the Responses API; Luna with reasoning explicitly disabled
can use Chat Completions. Custom OpenAI-compatible endpoints
keep LiteLLM's existing endpoint routing.
The new Claude models require automatic or disabled tool selection (auto or
none); explicitly forcing a tool produces a clear error. Reflexio preserves
signed thinking blocks and encrypted reasoning items between tool turns,
including when completions run in isolated subprocesses.
Reflexio supplies missing capability metadata for the listed GPT-6 and new Claude IDs when LiteLLM's bundled catalog is older than the model. It preserves existing catalog entries and does not invent prices for missing entries. Tests use local HTTP fixtures and do not establish live account access or provider availability. See the OpenAI model catalog and Claude model catalog for provider availability and migration requirements.
Current MiniMax and GLM models
The following additional direct-provider IDs are qualified with local HTTP fixtures and actual subprocess tool exchanges:
| Provider | Model IDs |
|---|---|
| MiniMax | minimax/MiniMax-M3.1-Flash-Preview |
| Z.ai | zai/glm-5.3, zai/glm-5.3-flash, zai/glm-5.3-flashx |
Z.ai models, including the zai/glm-5.2 default, are supported through these
offline adapter tests but are not live-qualified by Reflexio. Supply your own
ZAI_API_KEY to use them.
Existing MiniMax M3 and GLM 5.2 defaults remain unchanged. These new models
require thinking to stay enabled. MiniMax Preview accepts reasoning effort
low, medium, high, xhigh, or max; GLM 5.3 variants accept low, high,
or max. Reflexio forwards explicitly requested effort through LiteLLM and
rejects disabled thinking or invalid effort before sending a request. MiniMax
Preview also requires reasoning_split=True when that option is supplied.
Sampling settings keep their existing behavior.
Structured extraction uses Reflexio's existing prompt-schema and JSON parsing
strategy for these providers. Tool exchanges preserve reasoning_content
and accompanying assistant text. Missing catalog entries receive capability
metadata without fabricated pricing or a claim of native strict JSON schemas.
Reflexio routes GLM 5.3 and Flash through the coding-plan endpoint by default.
GLM FlashX uses https://api.z.ai/api/paas/v4 because it is not available on
that plan; supply a general API key when selecting FlashX. Explicit per-call
api_base overrides remain available.
MiniMax Preview requires access through M Plan or MiniMax Code. A model being
supported by Reflexio does not grant account access. See the
MiniMax API documentation,
GLM 5.3 guide, and
GLM Flash/FlashX guide.
API Keys
Method 1: Environment Variables (Recommended)
Set provider-specific environment variables in your .env file. LiteLLM picks them up automatically.
# .env — set one or more provider keys
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=...
DEEPSEEK_API_KEY=...OpenAI is a common starting point for text generation. Embeddings default to Reflexio's local model unless you override embedding_model_name.
Method 2: Programmatic Configuration
Set API keys via the Config object. Programmatic keys take precedence over environment variables.
from reflexio.models.config_schema import APIKeyConfig, OpenAIConfig
config = client.get_config()
config.api_key_config = APIKeyConfig(
openai=OpenAIConfig(api_key="sk-your-key-here")
)
client.set_config(config)curl -X GET "${REFLEXIO_URL:-https://www.reflexio.ai}/api/get_config" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY"
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/set_config" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"...": "updated full config object"
}
JSONSupported Providers:
| Provider | Config Class | Environment Variable |
|---|---|---|
| OpenAI | OpenAIConfig | OPENAI_API_KEY |
| Anthropic | AnthropicConfig | ANTHROPIC_API_KEY |
| Google Gemini | GeminiConfig | GEMINI_API_KEY |
| DeepSeek | DeepSeekConfig | DEEPSEEK_API_KEY |
| OpenRouter | OpenRouterConfig | OPENROUTER_API_KEY |
| MiniMax | MiniMaxConfig | MINIMAX_API_KEY |
| DashScope (Qwen) | DashScopeConfig | DASHSCOPE_API_KEY |
| Zhipu AI | ZAIConfig | ZAI_API_KEY |
| Moonshot | MoonshotConfig | MOONSHOT_API_KEY |
| xAI | XAIConfig | XAI_API_KEY |
For Z.ai models such as zai/glm-5.2, Reflexio uses
https://api.z.ai/api/coding/paas/v4 as the built-in API base. Configure only
the ZAI_API_KEY; the coding endpoint is a runtime default, not a setting.
An explicit per-call API base or a configured custom endpoint still takes
precedence.
Custom OpenAI-Compatible Endpoints
Use CustomEndpointConfig for gateway credentials and its base URL. Select the
model with llm_config.generation_model_name. Optional should_run_model_name
and pre_retrieval_model_name choices override that model for their roles;
otherwise those roles inherit it. Gateway credentials take priority over other
providers for text generation; embedding models and credentials stay independent.
A custom gateway keeps a single-model attempt policy rather than using provider
fallback lists. Direct LiteLLMClient users select the model in LiteLLMConfig.model
or a request's model argument.
The retired custom_endpoint.model is rejected by current saves and reads. The
versioned startup upgrade copies its formerly effective model into all three
text-role fields and retains the original settings. Stop incompatible writers
before upgrading; a standalone embedded host must prepare its local config
before serving. Updating an SDK pin alone does not migrate enterprise settings.
from reflexio.models.config_schema import APIKeyConfig, CustomEndpointConfig, LLMConfig
config = client.get_config()
if config.api_key_config is None:
config.api_key_config = APIKeyConfig()
config.api_key_config.custom_endpoint = CustomEndpointConfig(
api_key="your-key",
api_base="http://localhost:8000/v1"
)
if config.llm_config is None:
config.llm_config = LLMConfig()
config.llm_config.generation_model_name = "openai/my-model"
client.set_config(config)curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/set_config" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"...": "updated full config object"
}
JSONAzure OpenAI
Use AzureOpenAIConfig nested inside OpenAIConfig for credentials, endpoint
and API version. Select deployments through each task's model ID, such as
azure/my-deployment; different tasks can select different deployments.
The old deployment_name credential field had no routing effect and is removed
when older configurations are loaded or saved.
from reflexio.models.config_schema import (
APIKeyConfig, OpenAIConfig, AzureOpenAIConfig, LLMConfig
)
config = client.get_config()
if config.api_key_config is None:
config.api_key_config = APIKeyConfig()
azure = AzureOpenAIConfig(
api_key="your-azure-key",
endpoint="https://your-resource.openai.azure.com/",
api_version="2024-02-15-preview"
)
# Select direct Azure routing while retaining other provider credentials.
config.api_key_config.custom_endpoint = None
if config.api_key_config.openai is None:
config.api_key_config.openai = OpenAIConfig(azure_config=azure)
else:
config.api_key_config.openai.azure_config = azure
if config.llm_config is None:
config.llm_config = LLMConfig()
config.llm_config.generation_model_name = "azure/my-deployment"
config.llm_config.should_run_model_name = "azure/my-deployment"
config.llm_config.pre_retrieval_model_name = "azure/my-deployment"
client.set_config(config)curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/set_config" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"...": "updated full config object"
}
JSONModel Selection
Reflexio uses different models for different tasks. Sensible defaults are provided, but you can override them via LLMConfig. Only set fields you want to override — None fields keep the defaults.
| Field | Default | Purpose |
|---|---|---|
should_run_model_name | Auto-detected by provider | Fast check to decide if extraction should run on a given interaction |
generation_model_name | Auto-detected by provider | Profile extraction, playbook generation, and evaluation |
embedding_model_name | OSS: local/minilm-l6-v2; Enterprise: custom | Vector embeddings for semantic search. Enterprise custom uses the operator-configured embedding service without exposing its concrete model. |
pre_retrieval_model_name | Auto-detected by provider | Model for pre-retrieval query reformulation |
Embedding input formatting plus the default retrieval and playbook-clustering thresholds are selected by the exact embedding model:
| Embedding model | Input formatting | Retrieval threshold | Clustering similarity |
|---|---|---|---|
local/minilm-l6-v2 | No prefix | 0.30 | 0.30 |
local/nomic-embed-text-v1.5 | search_document: for stored text; search_query: for queries | 0.70 | 0.85 |
local/nomic-embed-v1.5 (compatibility alias) | search_document: for stored text; search_query: for queries | 0.70 | 0.85 |
Enterprise custom service | Resolved from the service policy | Model-specific | Model-specific |
| Other explicit models | No prefix | 0.45 | 0.30 |
An explicit request threshold always wins, including 0.0. In hybrid search,
the threshold filters only the vector arm; full-text matches remain eligible.
An explicit playbook clustering_similarity also wins. Playbook embeddings use
only their normalized trigger; they do not fall back to playbook content. This
normalization applies when an embedding is computed and does not automatically
backfill existing playbook vectors.
from reflexio.models.config_schema import LLMConfig
config = client.get_config()
if config.llm_config is None:
config.llm_config = LLMConfig()
config.llm_config.generation_model_name = "openai/gpt-4o"
config.llm_config.embedding_model_name = "text-embedding-3-small"
client.set_config(config)curl -X GET "${REFLEXIO_URL:-https://www.reflexio.ai}/api/get_config" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY"
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/set_config" \
-H "User-Agent: my-agent-reflexio" \
-H "Authorization: Bearer $REFLEXIO_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'JSON'
{
"...": "updated full config object"
}
JSONModel names use LiteLLM's "provider/model-name" format (e.g., "openai/gpt-4o", "anthropic/claude-3-5-sonnet", "deepseek/deepseek-chat").
Z.ai models use Reflexio's prompt-backed structured-output path, and
zai/glm-5.2 supports extraction-agent tool loops (adapter-tested, not
live-qualified).
Fallback lists may freely mix providers and structured-output strategies —
Reflexio walks the primary and fallback models itself, one at a time, and
rebuilds the request (structured-output strategy, api_base, per-model
timeout) for each one. That means a primary using native JSON Schema can fall
back to a prompt-backed provider like Z.ai, and vice versa; no transport
compatibility restriction applies to structured-output or text fallback
lists.
Hosted Enterprise
Enterprise settings show Custom by default. Custom uses the local or deployed embedding service; the service's concrete model is intentionally operator-owned and is not shown in organization LLM configuration. After switching between Custom and an explicit cloud model, save the configuration first, then use Regenerate embeddings in Advanced Settings. Regeneration is manually triggered and runs server-side for the selected project using the saved route. Cloud embedding models such as text-embedding-3-small and gemini/gemini-embedding-001 bypass the embedding service when the corresponding provider credentials are configured and the model produces 512-dimensional vectors — regeneration validates the vector width and fails the job if a model returns a different dimension.
For self-hosted deployments, replacing the shared embedding service model affects every project. Use an operator-managed maintenance migration that re-encodes all active resource stores and updates model configuration before resuming traffic; the selected project’s regeneration job does not perform that deployment-wide conversion.
Changing embedding models puts new query vectors and existing stored vectors in different vector spaces until regeneration finishes, so semantic search quality may be temporarily degraded during the job.
The input-formatting policy is also part of the embedding space. If an existing non-Nomic database was populated by a Reflexio version that added Nomic-style prefixes to every model, rebuild the local SQLite database or run enterprise embedding regeneration after upgrading.