dspy.LM on the native lm15 engine. You configure one shared model in [llm], and it serves every role. Any DSPy model route works, such as openai/gpt-4o-mini or anthropic/claude-sonnet-4-5.
Prerequisites
- A model route your provider supports.
- A credential for that provider:
FLEET_LLM_API_KEY, or the provider’s own environment variable, such asOPENAI_API_KEY.
Model roles
A role table without its own
model inherits the shared [llm] connection: the same model, endpoint, and key.
Set the shared model
Set the model and an optional key in.env:
.env
FLEET_LLM_API_KEY, DSPy’s native provider authentication reads the provider’s credentials from the process environment, such as OPENAI_API_KEY. Fleet doesn’t export arbitrary .env variables to the process, so export provider variables in your shell.
Set FLEET_LLM_BASE_URL, or api_base in [llm], to use an OpenAI-compatible endpoint. The URL must use HTTPS, or HTTP on a loopback host such as localhost. It can’t contain credentials, a query string, or a fragment.
Example configuration
config/fleet.toml.example ships these model settings. Copy it to config/fleet.toml to customize them.
config/fleet.toml
model commented out. Without a shared model, Root and Sub default to openai/system.ai.deepseek-v4-1-flash-1017, and Reflection and Judge use openai/gpt-4o-mini. Set model in [llm] or FLEET_LLM_MODEL to use one model for every role.
Databricks Unity Gateway
To call models through Databricks Unity Gateway, prefix each service name withopenai/ and set the endpoint and credential explicitly. DATABRICKS_HOST doesn’t set the inference endpoint.
config/fleet.toml
openai/ model’s endpoint path is exactly /ai-gateway/mlflow/v1, Fleet sends the output limit as max_tokens, because Unity Gateway rejects OpenAI’s max_completion_tokens. Other OpenAI-compatible endpoints keep DSPy’s standard OpenAI behavior.
A role with its own model doesn’t inherit the shared connection. Set api_base and api_key_env in that role table too.
Use a different model for one role
Setmodel in a role table to give that role its own connection. A role with its own model uses the provider’s native authentication. Set api_base or api_key_env in the same table to use a specific endpoint or key.
config/fleet.toml
api_key_env names an environment variable that holds the key. Fleet reads it from the process environment, then from .env, when it loads settings. Restart Fleet after you change a referenced credential.
Settings
Set these keys in[llm] to apply them to every role. Set them in a role table to override the shared value for that role.
The Root cap of
max_tokens = 16384 bounds runaway reasoning on the RLM route. When a capped reply is missing its output fields, DSPy’s native JSON recovery retries once, and the retry counts toward the Turn budget.
Role generation settings also have environment variables named FLEET_<ROLE>_<KEY>, for example FLEET_ROOT_MAX_TOKENS, FLEET_ROOT_ADAPTER, FLEET_SUB_MODEL_TYPE, or FLEET_SUB_RESPONSE_FORMAT. See the configuration reference.
Model type
model_type picks the provider API DSPy calls for a role. chat uses Chat Completions, and responses uses the Responses API. With the default auto, Fleet leaves the choice to DSPy, with one exception. When an openai/ model has an api_base whose host isn’t api.openai.com, Fleet uses chat, because most OpenAI-compatible gateways only serve Chat Completions. Set model_type = "responses" in that table to call the Responses API on such an endpoint.
config/fleet.toml
FLEET_LLM_MODEL_TYPE and FLEET_<ROLE>_MODEL_TYPE.
Switch models for one Session
You can change the Root or Sub model of a running Session without restarting. Run/model root <provider/model> or /model sub <provider/model> in the terminal, or call PUT /sessions/{session_id}/model. Fleet rebuilds the Session engine and persists the selection for that Session. The role keeps its configured endpoint and key.
GET /models?role=root and /models root list models only when that role has an explicit OpenAI-compatible api_base. Fleet reads the endpoint’s /models list. Otherwise the list is empty, and you enter the route manually. See the HTTP API reference.
TypeSafe decisions
SetFLEET_TYPESAFE_API_KEY to route Turns, select Skills, and answer jev_decide_batched calls with the TypeSafe Jev model in [decision]. Without the key, the Sub model makes these decisions. See the configuration reference.