Provider configuration
LLM and embedding calls route through ProviderConfig on each agent. The runtime reads API keys from environment variables named in api_key_env, never from workflow JSON or browser bundles. Provider failures map to typed errors and trace events shared across SDK and server.
Agent field reference: Defining agents. Install and env setup: Install and build.
ProviderConfig shape
| Field | Role |
|---|---|
provider_id | Backend selector (see table below) |
model | Provider-specific model id |
api_key_env | Name of env var holding the secret |
params | Optional provider-specific generation params |
Supported chat providers
| provider_id | Env variable | Notes |
|---|---|---|
openai | OPENAI_API_KEY | Chat and embeddings |
anthropic | ANTHROPIC_API_KEY | Claude models |
gemini | GEMINI_API_KEY | Google models |
stub | (none) | Tests only; deterministic responses |
OpenAI example
Anthropic example
Stub (local and CI)
First workflow in five minutes uses stub implicitly when no provider is configured.
Embedding provider strings
Vector memory uses a separate embedding string on memory_config.embedding, not ProviderConfig:
Production also requires:
ARCFLOW_QDRANT_URLARCFLOW_EMBEDDING_PROVIDER(non-stub in prod)OPENAI_API_KEY(when embedding string uses OpenAI)
See Vector RAG pipeline.
Trace events
| Event | When |
|---|---|
ProviderRequestSent | Outbound LLM request (metadata only) |
ProviderResponseReceived | Success with token counts and latency |
ProviderRateLimited | 429 or provider rate signal |
ProviderError | Terminal provider failure |
Example:
Error mapping
| ErrorCode | HTTP (server) | Typical cause |
|---|---|---|
ProviderError | 502 | API error, invalid model |
RateLimited | 429 | Provider or site rate limit |
EmbeddingError | 502 | Embedding call failed |
RerankError | 502 | Cohere rerank failed |
See Error codes for the full list.
Server deployment
Set keys in the server environment or secrets manager, not in Postgres:
Docker Compose: docker/docker-compose.server.yml documents the expected service env block.
Security rules
- No API keys in workflow JSON, registry payloads, or static JS bundles
- Relay and static SDK never see LLM keys; server holds them
- Logs and traces are metadata-only trace only (Trace data policy)
Python and TypeScript shorthand
Python SDK often accepts provider="openai/gpt-4o-mini" with separate api_key_env.
TypeScript:
Related pages
- Tool execution loop
- Hybrid retrieval and reranking (Cohere rerank)
- Retry and backoff (ProviderRateLimited)
- Python quickstart