LLM drivers
About 6273 wordsAbout 21 min
Spora’s LLM layer is built around LLMDriverConfigInterface. Drivers are resolved per-request by DriverFactory, which delegates tier resolution to LLMConfigPreferences::getEffectiveConfigForAgent(). Effective config is the LLMDriverConfiguration that tier resolution selects — the agent’s own llm_driver_config_id FK if set, otherwise the principal’s preferred config, otherwise the principal’s own default row, otherwise the global default. The first two tiers are skipped when the configuration is not the principal’s to use: a private configuration belongs to the principal that pays for it, so a reference that outlived its authorisation falls through to the next tier.
LLMDriverConfigInterface
File: app/Drivers/LLMDriverConfigInterface.php
Every driver must implement (all methods are static):
getName(): string— snake_case identifier, e.g.openai_compatiblegetDisplayName(): string— human-readable, e.g.OpenAI CompatiblegetDefaultTools(): array— default tool list for this driver
The settings schema is not a method on the interface. It is discovered at runtime by LLMConfigSchemaInspector::buildSchemaFromClass() (app/Services/LLMConfigSchemaInspector.php:55-70) by collecting the driver class’s #[ToolSetting(key: ..., type: ...)] PHP attributes through ToolSettingSchema::collect(). Driver classes therefore declare their UI fields as attributes — no hardcoded field lists.
Driver classes are listed in the PHP-DI container under the 'llm_driver_classes' array key, which is a static list of OpenAICompatibleDriver, AnthropicCompatibleDriver and OpenAIResponsesDriver (app/Core/ContainerDefinitions.php). There is no extension hook on this key: the plugin/App drivers() hook was removed in 1.0, and PluginLoader has no driver-collection method. The 'llm_driver_classes_merged' alias is kept alongside it for back-compatibility, but it is now identical to the static list (app/Core/ContainerDefinitions.php), and LLMConfigService is handed the merged entry via constructor injection. spora-core/tests/Unit/Core/ContainerDefinitionsTest.php pins this: the merged view equals the core list, with no plugin or App contributions. To add a driver, add the class to the llm_driver_classes list in app/Core/ContainerDefinitions.php and point an llm_driver_configurations.driver_class row at it.
LLMDriverConfiguration (Model)
File: app/Models/LLMDriverConfiguration.phpTable: llm_driver_configurations
| Column | Type | Description |
|---|---|---|
id | bigInt | Primary key |
principal_id | bigInt FK (nullable) | Owning principal. NULL marks the global config — LLMDriverConfiguration::validateGlobalXor enforces the XOR. |
name | varchar(100) | User’s friendly name: “Production GPT-4” |
driver_class | varchar(200) | FQCN implementing LLMDriverConfigInterface |
settings | text (JSON) | Driver-specific settings. Password fields are per-field encrypted (see below). |
context_window | unsignedInt (nullable) | Total context window for the model (input + output) |
max_tokens_output | unsignedInt (nullable) | Max output tokens (output buffer) |
is_default | boolean | Default flag. On a global row it names the installation’s default; on a principal-owned row it names that principal’s default. The write paths keep one default per scope — setting a new one clears the others in its scope. |
is_global | boolean | Admin-shared config visible to all users |
created_at / updated_at | timestamp |
Ownership is principal-scoped, not user-scoped: migration 0067_introduce_principals_and_groups replaced user_id with a nullable principal_id FK to principals.id, and left it nullable on this table alone so the global config row can keep principal_id = NULL. A group principal can own its own configs. See Schema for the full principals picture.
Password-typed settings (per the #[ToolSetting] schema) are encrypted at rest using SecurityManager (app/Core/SecurityManager.php) — only type: 'password' fields are encrypted; the rest of the settings JSON is stored as plain text. The UI always receives masked values (***) for password fields, applied by LLMConfigService::maskForApi().
Effort levels
Every provider that has a reasoning control names it differently, exposes a different subset of levels, and rejects the control outright on models that do not support it. Spora therefore has its own vocabulary, and each driver maps it onto its provider’s wire shape.
The level set is a property of the configuration, not of the driver class. An operator names the levels their endpoint accepts and the operator’s list wins outright over whatever the model would take on its own. Reasoning effort is the deep dive; this section is the driver’s own surface.
The canonical scale
Spora\Drivers\EffortLevel is a backed enum of seven levels, ascending:
| Level | Value |
|---|---|
None | none |
Minimal | minimal |
Low | low |
Medium | medium |
High | high |
XHigh | xhigh |
Max | max |
The enum is the default vocabulary and the label map, not a constraint. A configuration may offer a name the enum does not carry — Groq’s default, for one — and EffortLevel::labelFor() answers with the name itself for anything it does not carry, so an operator’s own name reads as itself. The canonical seven are what the two OpenAI drivers offer when nothing else is configured.
A driver declares the levels it can express in Spora\Drivers\EffortAwareDriverInterface:
interface EffortAwareDriverInterface
{
public function effortLevels(): array;
}The key is the level name, the value is what goes on the wire. For every driver today the two are the same string; the indirection is the seam for a provider that renames a level.
LLMDriverInterface does not carry the method — it is a published contract, and adding to it breaks every implementor.
The level set
AbstractCompatibleDriver owns the public effortLevels(), and the precedence it applies is the driver’s own surface:
public function effortLevels(): array
{
if ($this->supportsEffort === false) {
return [];
}
if ($this->configuredEffortLevels !== []) {
return $this->levelMap($this->configuredEffortLevels);
}
return $this->defaultEffortLevels();
}The answer is a map of name to wire value, not a list of names: the key is the name the operator writes, the value is what the provider is sent. A name with no separate spelling maps to itself, so levelMap() turns ['low', 'high'] into ['low' => 'low', 'high' => 'high']. Both sides of that map are read: the keys are the levels a picker offers, and the values are what the driver puts in the request body.
The operator’s list wins outright. A configuration that names its levels offers exactly those, whatever the model would take on its own. The operator knows what their endpoint accepts, and a proxy in front of an Anthropic-compatible API may well accept a vocabulary no model id could imply.
An empty list means the driver’s own set applies — the levels the driver derives on its own, which for the Anthropic driver are the ones the model takes and for the two OpenAI drivers the whole canonical scale. That is what every configuration did before the setting existed, so those rows keep working untouched. The per-model set lives in each driver’s defaultEffortLevels(), which the three concrete drivers override:
| Driver | defaultEffortLevels() |
|---|---|
AnthropicCompatibleDriver | ModelFamily::claudeEffortLevels($this->model) — the levels that model takes |
OpenAICompatibleDriver | the whole canonical scale |
OpenAIResponsesDriver | the whole canonical scale |
The Anthropic driver asks the model: Anthropic publishes which models take output_config.effort and which of the five levels each of them takes, and the driver reads the model id — see Which levels a Claude model takes. A level that model does not take is refused at the API boundary, before the provider sees it. The two OpenAI drivers do not narrow: they declare the whole canonical scale, whatever the model takes, so a level the model rejects is sent and comes back as the provider’s own 400, naming the offending value. A declared level is not an accepted one.
A model id the driver cannot identify keeps the driver’s own set. On the Anthropic driver that is the full five levels — a deliberate rule, because narrowing an unidentifiable model to no levels would strip the effort picker from every existing Anthropic-compatible proxy until each operator configured a list by hand.
The settings
Three settings decide what a configuration offers and what it defaults to. The drivers each declare effort_levels and supports_effort; effort was already there.
| Setting | Type | What it decides |
|---|---|---|
effort_levels | textarea | the level set — comma-separated, empty means the driver’s own set |
supports_effort | toggle | whether the endpoint has an effort parameter at all |
effort | text | the configuration’s default — empty means the model default |
effort was a select with a static option map and is free text now. A level the configuration does not offer is refused when the configuration is saved, with a message naming the levels it does offer.
supports_effort is the mirror of the supports_image_input toggle on the same drivers. Off, the endpoint has no reasoning-effort parameter at all: the driver offers no levels, the agent gets no picker, and any effort sent is refused. Nothing goes on the wire either — not even the none escape hatch below, because a parameter the endpoint does not accept is refused by the provider. The toggle is tri-state on the wire and boolean in effect — a configuration saved before the setting existed never stored the key, and that row keeps working, because only an explicit false disables the capability.
A level name is at most 16 characters, and a configuration offers at most 32 of them. The bounds are a security and a storage decision: the name travels into a third-party request body and into a string(16) column. See Reasoning effort.
The wire shapes
| Driver | Parameter | Shape |
|---|---|---|
openai_compatible | reasoning_effort | flat, top level |
anthropic_compatible | output_config.effort | a top-level output_config object |
openai_responses | reasoning.effort | a nested reasoning object |
max_tokens and the flat reasoning_effort are absent from the Responses schema and are never sent there; max_output_tokens is Responses-only.
The Responses row is the request-level shape. On a model that supports configuration_update — GPT-6 and later — the driver sends no request-level reasoning at all and carries the level on an input item instead; see Changing the effort mid-conversation.
The default and the per-message override
effort is a driver setting, and it is free text — see The settings. Its default is the empty string, which means the model’s own default: no level is resolved, and the driver sends no effort parameter at all. The OpenAI-compatible driver is the exception — on a GPT-5.4-or-later model that uses tools it sends reasoning_effort: "none" itself. See Tools and effort on Chat Completions.
A level the driver does not declare is refused at the API boundary. EffortService::assertLevel() answers 422 EFFORT_LEVEL_UNSUPPORTED — the request never reaches the provider, and the task row never carries a level the driver cannot send.
A level that reaches the driver unchecked is dropped, not sent. The HTTP boundary is what checks a level against the driver’s set. A plugin that calls TaskServiceInterface::startTask() passes the effort as a plain string, and a level that is not in the driver’s set is dropped on the way out: AbstractCompatibleDriver::resolveEffort() looks the level up and sends no effort parameter at all when it is not there. The task still runs — at the model’s own default, or at none where the driver asks for a level of its own, which the OpenAI-compatible driver does on a GPT-5.4-or-later model that uses tools. The two OpenAI drivers declare every canonical level by default, so there is nothing for them to drop: the level goes out and the model takes it or refuses it.
The configuration’s default is checked when the configuration is saved. A level the configuration does not offer is refused at that point, with a message naming the levels it does offer — so a saved default is always in the level set. Narrowing the list under a saved default is refused too, rather than silently dropping the default: the operator fixes both in the same submission.
A level the model rejects is still the provider’s error. The level set says what the endpoint takes; it does not say the model accepts it. On the two OpenAI drivers the set is the whole canonical scale, so a saved default can be a level the model refuses — the request then fails at the provider. On the Anthropic driver the set is the model’s own levels, so that cannot happen there.
One driver asks for a level anyway. On a GPT-5.4-or-later reasoning model the OpenAI-compatible driver sends reasoning_effort: "none" when the agent uses tools and no level resolves, because silence is not a working configuration on the models that default to medium. The escape hatch is not subject to the operator’s level list — it is what the API requires, not a depth the operator chose, so a configuration that names low, medium, high without none still gets none on a model that needs it. It is, however, subject to the capability: a configuration that turned supports_effort off sends nothing at all, because the endpoint has no effort parameter to fill. See Tools and effort on Chat Completions.
A request may carry its own effort, and the resolution order is:
request effort (authoritative when the key is present)
→ the agent's default_effort
→ the config default (the `effort` setting on the LLM config)
→ no level asked for (the model's own default)The three request values mean three different things:
| Request body | Meaning |
|---|---|
| key absent | fall back to the agent’s default, then the config’s |
effort: "" | explicitly the model’s own default — no level asked for |
effort: "high" | that level |
A link of the chain is only used when the level set contains it, so an agent default left behind by a configuration change falls back to the configuration’s default rather than to a level the endpoint would refuse.
The resolved value lands on the task row: NULL means no level was resolved — the model’s own default — and the database never stores an empty string.
The driver never reads the settings blob for effort. The resolution happens outside the driver (LlmConfigResolver → TickPhaseRunner → LLMRequest::$effort), and the driver only emits what it is handed. LLMRequest::$effort carries the level name; the driver maps it.
The chat overrides the default per message, and learns the vocabulary from GET /api/v1/agents/{id}/effort — see the REST API reference and Reasoning effort.
OpenAICompatibleDriver
File: app/Drivers/OpenAICompatibleDriver.phpDriver name: openai_compatible
- Calls
POST {base_url}/chat/completionsusing the standard OpenAI chat completions format. base_urldefaults tohttps://api.openai.com/v1; can be overridden for Ollama, Groq, LM Studio, Azure, etc.- Reads settings from
LLMDriverConfiguration.settings(decrypted per-field viaLLMConfigService::decodeSettings()). - Dispatches on
finish_reason: tool_calls; otherwise returns the text content. - Sends the effort level as a flat
reasoning_effort— see Effort levels.
Settings schema (#[ToolSetting] attributes on app/Drivers/OpenAICompatibleDriver.php): api_key (password), base_url (text), model (text), temperature (text), effort (text), effort_levels (textarea), supports_effort (toggle), timeout (text), plus the inherited supports_image_input (toggle) that AbstractCompatibleDriver declares. context_window and max_tokens_output are not settings-schema fields — they are columns on the llm_driver_configurations row.
Reasoning models
A model id is an OpenAI reasoning model when it matches
^gpt-[56](\.\d+)?(-|$) gpt-5, gpt-5.1, gpt-6, gpt-6.1, …
^o[134](-|$) o1, o1-mini, o3, o3-mini, o4-miniand does not contain -chat- (gpt-5-chat-latest and friends are ChatGPT Instant models, not reasoning models) and is not gpt-oss. A provider/ prefix is stripped first, so OpenRouter’s openai/gpt-5.5 is classified the same way.
On a reasoning model the driver sends max_completion_tokens instead of max_tokens, omits temperature, and uses role: "developer" instead of role: "system". max_tokens is rejected by every current reasoning model, and temperature is rejected with any effort other than none.
Tools and effort on Chat Completions
On GPT-5.4 and later, Chat Completions does not support tool calling with reasoning_effort values other than none. The API’s documented default for the parameter is medium, and from GPT-5.5 on that is the model’s own default too — so a request that sends tools and no effort value sits at medium, where tool calling is a 400. (GPT-5.4 and GPT-5.2 default to none.) Silence is not a configuration to rely on, so the driver sends reasoning_effort: "none" explicitly whenever the agent uses tools and no level resolves.
| Tools present | Level resolved | Sent |
|---|---|---|
| yes | no | reasoning_effort: "none" |
| yes | yes | the resolved level — none is accepted; the levels the model rejects are a 400 |
| no | no | nothing |
| no | yes | the resolved level |
An explicit level is never silently overridden. If the operator chose one, Spora sends it and the provider’s own error names the fix — OpenAI’s message says to use /v1/responses or to set reasoning_effort to none. For an agent with no tools enabled the level works normally.
An explicit none is not a 400. On the models that take tools over Chat Completions, none is the one level they accept, and Spora sends it unchanged. The 400 belongs to the explicit levels the model rejects — on those models, every level above none. The models that reject none itself are the other half of the GPT-6 generation; see The two GPT-6 families.
To reason and call tools on a current OpenAI model, use the OpenAIResponsesDriver.
The two GPT-6 families
“GPT-5.4 and later” is one rule for the driver, but the GPT-6 generation splits in two — and the advice differs.
| Family | Tools on Chat Completions | none |
|---|---|---|
| GPT-5.4, GPT-5.5, GPT-5.6, GPT-6 Sol, GPT-6 Luna | accepted at none only | accepted — the driver sends it, the agent runs |
| GPT-6.1 Terra | not supported at all | accepted, but it cannot call tools either |
| GPT-6 Astra, GPT-6.1 Sol | not supported at all | rejected — a 400 |
OpenAI’s own documentation draws the line: “GPT-6 Astra, GPT-6.1 Sol, and GPT-6.1 Terra support Chat Completions, but tool calling requires Responses. GPT-6 Sol and GPT-6 Luna support function calling in Chat Completions only with reasoning_effort: "none".”
On GPT-6 Astra, GPT-6.1 Sol and GPT-6.1 Terra the Responses driver is the only way to run an agent. Chat Completions cannot call tools on those models at all, whatever the effort, and the none escape hatch does not rescue them: none is a 400 on GPT-6 Astra, and GPT-6.1 Sol rejects none and minimal as well. The driver sends none across the whole GPT-5.4+ range, so on those three the request fails at the provider instead of running the agent. That holds even when the operator does not want the model to reason — the choice there is the endpoint, not the level.
On GPT-6 Sol and GPT-6 Luna the none workaround works exactly as it does on GPT-5.4. The agent runs, the model does not reason, and the Responses driver is the way to have both.
AnthropicCompatibleDriver
File: app/Drivers/AnthropicCompatibleDriver.phpDriver name: anthropic_compatible
- Calls
POST {base_url}/v1/messagesusing Anthropic’smessagesAPI. Defaultbase_urlishttps://api.anthropic.com(the driver appends/v1/messages). - Uses Anthropic’s request format:
systemprompt is a top-level field;toolsarray uses the Anthropic schema (not OpenAI schema). - Dispatches on
stop_reason: tool_use; otherwise returns text content blocks. - Sends
anthropic-version: 2026-10-21header andx-api-keyfor auth. - Sends the effort level as
output_config: {effort: "<level>"}— see Effort levels.
Settings schema (#[ToolSetting] attributes on app/Drivers/AnthropicCompatibleDriver.php): api_key (password), base_url (text), model (text), enable_prompt_caching (toggle), effort (text), effort_levels (textarea), supports_effort (toggle), timeout (text), plus the inherited supports_image_input (toggle) that AbstractCompatibleDriver declares. As with the OpenAI driver, context_window and max_tokens_output are table columns rather than settings-schema fields.
Which levels a Claude model takes
Anthropic publishes which models take output_config.effort and which of the five levels each of them takes, and the two are not the same list. The driver reads the model id and answers with that model’s own set (ModelFamily::claudeEffortLevels()):
| Model id | Levels it takes |
|---|---|
| Claude 4.7 and later (4.8, the 5.x generation) | low, medium, high, xhigh, max |
| Claude Opus 4.6, Claude Sonnet 4.6 | low, medium, high, max — no xhigh |
| Claude Opus 4.5 | low, medium, high — no max, no xhigh |
| Claude Sonnet 4.5, Claude Haiku 4.5, every 3.x model | none — the model has no effort at all |
A claude- id with no version at all | all five — the driver’s fallback, not the model’s answer |
An id that is not a claude- id at all | all five — the driver’s fallback, not the model’s answer |
A model that takes no level declares none, and the agent gets no picker: GET /api/v1/agents/{id}/effort answers supported: false with an empty levels array, and a request that names a level is refused with 422 EFFORT_LEVEL_UNSUPPORTED.
The last two rows are the rule’s way of not knowing, not a statement about the model. The driver cannot identify the model, so it does not narrow its level set: a claude- id that carries no version names the current generation on Anthropic’s own API, but a compatible endpoint can use a versionless name such as claude-legacy for a model that takes some of the levels or none of them. An id that is not a claude- id at all belongs to an Anthropic-compatible endpoint with its own model names — Kimi and the like. The driver does not model another provider’s model zoo, and the operator who pointed the agent at that endpoint is the only one who knows what it takes, so the provider has the last word there: a level the model rejects comes back as the provider’s own error, not as a silent fall back to the model’s default.
An operator who knows better says so. The effort_levels setting replaces the fallback with the endpoint’s real vocabulary, and it replaces it outright — see The level set.
What the 2026-10-21 API version changed
temperature is no longer sent, and the setting is gone. That API version removed the sampling parameters: a request that sends any of them answers 400 on every model.
The cost, precisely: Claude 4.7 and later are unaffected — those models only accept the default, so Spora’s 0.7 was never in effect. On Sonnet 4.6 and earlier the sample moves from 0.7 to the API default of 1.0, so the output becomes slightly more varied. For an agent loop that is neutral-to-positive — less repetitive output from step to step — and the models concerned are a generation behind. effort is the replacement control: Anthropic’s own guidance is that effort shapes the whole response, tool calls included.
thinking_budget is gone, and effort replaces it. The two are the same knob in two generations of the API, and their coverage barely overlaps: budget_tokens is a hard 400 on Claude 4.7 and later, and the models that still take it — Opus 4.5, Sonnet 4.5, Haiku 4.5, and (deprecated) Opus 4.6 and Sonnet 4.6 — are covered by effort except Sonnet 4.5 and Haiku 4.5, which have no effort at all.
Opus 4.5, Sonnet 4.5 and Haiku 4.5 lose manual extended thinking entirely: on them Spora sends no thinking field at all. Sonnet 4.5 and Haiku 4.5 have no effort to fall back on. Opus 4.5 has effort, but adaptive thinking arrived with the 4.6 generation and is a 400 below it — so there is no thinking mode left to turn on there either, and effort shapes the response without a thinking block to show.
A stored thinking_budget is pruned the next time that configuration is saved — LLMConfigPersistence::encodeSettings() drops the keys that are not in the driver’s schema — so no data migration is needed.
The thinking field
| Model family | Effort configured | thinking field |
|---|---|---|
| 4.6 and later | yes | {"type": "adaptive", "display": "summarized"} |
| 4.6 and later | no | omitted |
| 4.5 and earlier | any | omitted |
Effort turns on adaptive thinking wherever adaptive thinking exists; below 4.6 there is no thinking mode, so effort shapes the response only. Claude 3.x has no thinking mode at all.
display: "summarized" is sent only with type: "adaptive", because that is where the default flipped to "omitted" — without it the model would return an empty reasoning block and the chat would show no reasoning at all. Neither thinking: {"type": "disabled"} nor thinking: {"type": "enabled", "budget_tokens": N} is ever sent.
OpenAIResponsesDriver
File: app/Drivers/Responses/OpenAIResponsesDriver.phpDriver name: openai_responsesDisplay name: OpenAI Responses
- Calls
POST {base_url}/responses— OpenAI’s Responses API, not Chat Completions. - The system prompt is the top-level
instructionsfield, not asystemmessage. - The conversation is a list of
inputitems: messages, function calls, function-call outputs. - Tool definitions are flat —
{"type": "function", "name": …}— not nested under afunctionobject. - The token cap is
max_output_tokens;max_tokensis not in the schema and is never sent. - The effort level travels nested:
reasoning: {"effort": "<level>"}.
Settings schema (#[ToolSetting] attributes on app/Drivers/Responses/OpenAIResponsesDriver.php): api_key (password), base_url (text), model (text), effort (text), effort_levels (textarea), supports_effort (toggle), store (toggle), timeout (text), plus the inherited supports_image_input (toggle) that AbstractCompatibleDriver declares.
It is priced like the Chat Completions driver. getProviderName() returns openai_compatible — the tag the Chat Completions driver already uses, not a new one — so the price rows an operator already has for a model keep matching when an agent is pointed at this driver. A model with no price row is unpriced: the call is metered as free. The protocol identifier is the separate openai_responses; the usage panel reads openai, which is the tag both OpenAI protocols report.
Plugin tool names are sanitised for this driver: a plugin tool’s name carries a colon, which the API’s function-name grammar forbids, so every character outside [A-Za-z0-9_-] is replaced with a hyphen and the name the model echoes is mapped back — the tool still resolves. The name is built the same way for every driver, so no other driver is affected.
store
The store setting — labelled Store responses — is a toggle, and it is off by default. It decides whether the provider keeps the response as a retrievable conversation object on its own servers: the Responses API stores one for at least 30 days unless it is told not to, so Spora sends store: false until an operator asks otherwise. A self-hosted platform has no business keeping its operators’ conversations on somebody else’s servers.
store: false is not a promise that the provider retains nothing. It means the response is not stored as a retrievable conversation object. Prompts and responses still go into OpenAI’s abuse-monitoring logs, which are retained for up to 30 days by default — unless a longer retention is required by law, or is reasonably necessary to protect OpenAI’s services or a third party from harm. Excluding customer content from those logs needs an approved Zero Data Retention or Modified Abuse Monitoring control — granted by OpenAI per organisation or project, subject to prior approval and to the limitations of each — see OpenAI’s data controls. An operator whose conversations carry data they cannot hand to a third party has to arrange that with OpenAI; the toggle does not do it.
The control belongs to the project, not to the organisation. OpenAI grants Zero Data Retention per organisation or project, and what decides a request is the setting on the project the API key belongs to: a project can inherit the organisation’s setting, can pick Zero Data Retention or Modified Abuse Monitoring itself, or can select None and switch the controls off for that project even though the organisation is enrolled. Some endpoints and capabilities are not eligible for Zero Data Retention at all and may still keep application state even when it is enabled — the Assistants, Threads, Conversations, Files, Batches, Evals and fine-tuning endpoints among them; Spora’s two, /v1/responses and /v1/chat/completions, are eligible. “The organisation is enrolled” is not the guarantee an operator needs; the project’s setting is.
The control has documented exceptions. Image and file inputs are scanned for CSAM content on submission, and an image the classifier flags is retained for manual review — even with Zero Data Retention, Modified Abuse Monitoring or Private Retention with Private Safety Processing enabled. OpenAI also reserves the right to retain content for a specific customer, notified in writing: in encrypted abuse-monitoring logs under Private Retention with Private Safety Processing, and for human review under Safety Retention. The endpoint table and the rest of the exceptions are in OpenAI’s data controls.
The toggle does not decide who replays the reasoning. Spora always replays the encrypted reasoning itself: the reasoning item carries an encrypted_content blob — the opaque blob the provider decrypts to restore the chain of thought — and Spora sends that blob whenever it has one, whatever the toggle says, because the blob resolves the item on the provider’s side whether or not the provider stored it.
What the toggle decides is the fallback, for the one case the blob does not cover — a reasoning item that arrives without encrypted content. With it off, Spora drops that item from the replay rather than sending an id the provider kept nothing for; with it on, the item goes out by its id alone, which only the provider can resolve if it kept the item.
The id-only replay is the API’s documented shape, and it is the fallback: it is reached only when the response carried no
encrypted_contentto replay. No live call has exercised it.
Zero Data Retention turns store: true into store: false. Where the control applies — on the project the API key belongs to — the provider treats store: true as store: false on /v1/responses and /v1/chat/completions, so the reasoning item comes back with its encrypted blob rather than as a reference the provider could resolve. Spora sends that blob either way — the toggle never decided that — so the replay resolves. What the toggle decides there is the fallback, and under Zero Data Retention the fallback the provider could serve is the one the toggle takes away. Leave Store responses off when Zero Data Retention applies to the project your key belongs to: with it on, a reasoning item that arrives without encrypted content goes out by its id alone, and there is nothing for the provider to resolve that id against.
Changing the effort mid-conversation
The chat can change the effort between messages, and the Responses API has a way of doing that which does not cost the prompt cache:
{ "type": "configuration_update", "reasoning": { "effort": "high" } }It is an input item, not a request-level parameter, so it changes the effort for the responses that follow it without rewriting the request body — and the cached prompt prefix survives. On a model that supports it the request-level reasoning is not sent at all: the override rides on the item, as the last input item, so it applies to the response generated after it.
GPT-6 and later support it. On an earlier model the same change is a request-level reasoning.effort, which is a prefix edit — it invalidates the prompt cache. An operator on a pre-GPT-6 model should know that moving the level mid-chat costs the cache.
The reasoning item
A reasoning item is opaque and must be replayed in position. OpenAI’s own reference is explicit: when function calling with a reasoning model on the Responses API, pass the reasoning items returned with the function calls back along with the tool outputs — that is what keeps the reasoning continuous across the call.
Reasoning is scoped to the model family, so switching families silently drops it.
What the chat shows is a summary, not the chain of thought. The API returns a summary of the model’s reasoning, and that summary is what the driver stores as the block’s text. The chat renders it in the same bubble Anthropic’s thinking block uses — one bubble, whatever the provider — and a turn that came back with no summary shows no reasoning at all.
When to choose it
Choose the Responses driver when you want an OpenAI reasoning model to think and call tools in the same turn. Over Chat Completions the two are mutually exclusive on GPT-5.4 and later: the model accepts tools only at none, so the agent runs but the model does not reason. On GPT-6 Astra, GPT-6.1 Sol and GPT-6.1 Terra it is more than mutual exclusion — Chat Completions cannot call tools on those models at all, so the Responses driver is the only option there, even for an operator who does not want the model to reason. The Responses API is the only OpenAI endpoint where a reasoning model can do both — the same combination Anthropic gives through adaptive thinking.
Keep the Chat Completions driver for everything else. vLLM, Ollama, LM Studio, Groq, Mistral and DeepSeek implement /v1/chat/completions, and their /v1/responses implementations differ per provider — some ignore unsupported parameters, some reject store: true, some have no statefulness at all.
DriverFactory
File: app/Drivers/DriverFactory.php
- Calls
LLMConfigPreferences::getEffectiveConfigForAgent($agent), which performs four-tier resolution: agent-specific (agent.llm_driver_config_id) → principal preferred (principal_preferences.preferred_llm_config_id) → principal default (principal_id= the agent’s principal,is_default = true) → global default (is_global = true AND is_default = true). Seeapp/Services/LLMConfigPreferences.php:108-125. The third tier is the row the group page’s “Set as Default” writes; the global row keeps the fourth tier because a global row carriesprincipal_id = nulland therefore cannot match the third. Preference writes are principal-scoped:setPrincipalPreferredConfig()only accepts a global config or one owned by that same principal, and an agent resolves tier 2 throughagent.principal_id(app/Services/LLMConfigPreferences.php:110and:228-255). - Instantiates the
driver_classcolumn’s FQCN with the decrypted settings plus an HTTP client, logger, and timeout.timeoutis read from the per-config setting when present, otherwise it falls back to the container-widellm_timeout(app/Drivers/DriverFactory.php). - The build is split in two.
makeDriverFromSettings(string $driverClass, array $settings)takes the plaintext settings a save request carries;makeDriverFromConfig(LLMDriverConfiguration $config)decrypts the stored blob and delegates to it. The save path needs the first one because the row it is validating has not been written yet. - The two effort inputs ride in the common constructor arguments as
effortLevels(alist<string>) andsupportsEffort(?bool).supports_effortis decoded the waysupports_image_inputis: the frontend round-trips booleans as the strings"true"/"false", and a missing key decodes tonull, which means enabled. AnthropicCompatibleDriveris constructed with anAnthropicDriverOptionsvalue object carryingsupports_image_inputandenable_prompt_cachingrather than loose scalars. A driver that needs more than the abstract driver’s nine constructor arguments implementsSpora\Drivers\DriverOptionsAwareInterfaceand is built from the decoded settings itself —AnthropicCompatibleDriverandOpenAIResponsesDriverdo. The factory asks the capability rather than comparing class names.- If no config resolves, it throws
LlmConfigurationMissingException(app/Drivers/DriverFactory.php). There is no silent fallback driver: the previous empty-keyOpenAICompatibleDriverpunted the request toapi.openai.comand surfaced as an upstream 401, hiding the operator-visible “no LLM configured” error.ErrorClassifierturns the exception into aNO_LLM_CONFIGURATIONmessage on the task row. - The factory does not merge plugin drivers — there is no such hook. Adding a driver means adding the class to the
llm_driver_classeslist inapp/Core/ContainerDefinitions.phpand referencing it fromllm_driver_configurations.driver_class.
The save path builds a driver rather than asking a static. The validator has to agree exactly with the runtime on which levels a configuration offers — including for an out-of-tree driver — and a static method beside the instance method would be two lists that have to stay in step. The cost is one DriverFactory dependency in the validator and one HttpClient::create() per save, which opens no connection.
The cascade is served over HTTP as well. GET /api/v1/llm-configs/effective?agent_id=N resolves it server-side and names the tier that won: agent, group_preference or user_preference, group_default or user_default, global_default, or none. A client that re-implements the tiers gets a group-owned agent wrong — the tiers belong to the principal that owns the agent, not to the caller. See REST API reference → The effective LLM configuration.
Dependencies
symfony/http-client ^8.0— HTTP transport for all driver requests (composer.json:21).
Tests
tests/Unit/Drivers/LLMDriverConfigInterfaceTest.php— Interface contract for built-in driverstests/Unit/Drivers/LLMConfigServiceTest.php— Encryption, getDrivers, schema reflectiontests/Unit/Drivers/LLMConfigServicePreferenceTest.php— Principal-preferred config resolution (exercisesLLMConfigPreferencesandPrincipalPreference)tests/Unit/Drivers/DriverFactoryTest.phptests/Unit/Drivers/OpenAICompatibleDriverTest.phptests/Unit/Drivers/AnthropicCompatibleDriverTest.phptests/Unit/Drivers/LLMProviderExceptionTest.phptests/Unit/Drivers/EffortLevelTest.php— the canonical scale and its ordertests/Unit/Drivers/AnthropicEffortLevelsTest.php— the levels each Claude model takes, and what the driver sends for themtests/Unit/Drivers/ModelFamilyTest.php— the model-name parse, pinned against every current model idtests/Unit/Services/LlmConfigSchemaValidatorSelectTest.php— aselectsetting accepts only the values its option list namestests/Unit/Drivers/ResponsesRequestBuilderTest.php— the Responses wire shape, including the reasoning replaytests/Unit/Drivers/ResponsesResponseParserTest.phptests/Unit/Drivers/ResponsesUsageTest.phptests/Feature/Drivers/ResponsesConfigurationUpdateTest.php— the effort carried on aconfiguration_updateitemtests/Feature/Drivers/ResponsesDriverSettingsPropagationTest.php— the settings blob reaching the wire, including thestoreflagtests/Feature/Drivers/ResponsesReasoningReplayTest.php— a reasoning item surviving the round trip throughtask_historytests/Feature/Drivers/ResponsesToolNameTest.php— the plugin tool names the Responses grammar acceptstests/Unit/Http/TaskEffortRequestValidatorTest.php— the three states theeffortfield hastests/Unit/Agents/TaskEffortTickTest.php— the effort the tick sendstests/Feature/Services/EffortServiceTest.php— what the agent’s driver can expresstests/Feature/Http/AgentEffortEndpointTest.php—GET /api/v1/agents/{id}/efforttests/Feature/Http/TaskEffortTest.php— the effort on a task bodytests/Feature/AgentApi/AgentApiEffortTest.php— the effort on the per-agent chat bodytests/Feature/Database/AddEffortToTasksMigrationTest.php— thetasks.effortcolumn
Both driver test suites use Symfony\Component\HttpClient\MockHttpClient and cover: tool call parsing, text response parsing, error handling, and rate-limit exception propagation.
The wire contract has its own suite — tests/Unit/Drivers/WireContractTest.php — with one row per driver and per mode: it pins the exact set of top-level keys the request body carries — no more, no fewer. A JSON-Schema check would not catch the mistakes that matter here, because the providers’ request schemas do not forbid extra properties; the key-set assertion does, and it fails on a missing field as well as an extra one.