Models & Providers
Where vendor credentials live, how a saved model becomes a live client, and why the same parameters behave differently on each vendor.
Overview
Read this first — the split between the two records is the thing everything else follows from.
Every model call in Derbee Studio resolves through two records. A Provider holds the vendor connection: the credential, the base URL, and whether it is reachable. A Model holds one specific configuration of one model at that vendor: which model name, what sampling parameters, what capabilities it has, and what it costs.
Keeping them apart is what makes a key rotation a one-record edit rather than a sweep across every model you have registered. It is also what lets the same vendor account back a cheap model for classification and an expensive one for final answers, with no duplicated credentials between them.
Nothing else in the platform talks to a vendor directly. Agents, teams, workflow steps, the classifier, guardrail checks and embedding jobs all name a model id and let the resolution layer turn it into a working client — which is why swapping a model is a configuration change and never a code change.
Two records, one client
Configuration is stored in two places and merged at call time.
Resolution precedence
A model can carry its own credential, but a linked provider overrides it.
Modules
Providers
A Provider is one vendor connection. It is the only place a credential is stored, and the only record that knows where a self-hosted endpoint lives.
Testing takes one of two paths depending on the connection method.
Hosted vendors are verified by calling the vendor's own model-catalogue endpoint with the supplied credential. Each vendor in the catalogue declares its URL and how authentication is carried — a bearer header, a custom header, or a URL template — plus any extra headers the vendor requires, such as an API version. A real catalogue response is proof the key works; anything else is normalised into a specific error with a code and status rather than a raw exception.
Self-hosted endpoints are probed instead. Three candidate paths are tried in order — the Ollama tag listing, the OpenAI-compatible model listing used by tools such as LM Studio and LocalAI, and finally the bare root URL — each with a five-second timeout. The first one that responds successfully proves the server is reachable; if none do, the error names the URL that was tried.
Discovering what a provider offersBeyond testing, a provider's live model list can be fetched using its stored credential, returning each model's name, type and — where the vendor publishes them — its token limits and parameter ranges. That is how the model form can offer real choices instead of a free-text field.
Models
A Model record is one usable configuration. The same vendor model can be registered several times with different parameters, different pricing, or scoped to a different environment — production, development or staging — and each is independently selectable.
Model familiesThe modelType field decides what a model is for and which of its fields mean anything. Two families matter most: generate for chat and reasoning, and embeddings for vectors.
Parameters & Vendor Mapping
You configure one set of parameters. What actually reaches the vendor differs, because the vendors themselves differ — and the mapping layer handles that rather than leaving you to discover it through failed calls.
Unset means unset. A parameter left null is not sent at all, so the vendor applies its own default. Only explicitly configured values are forwarded, which is why a fresh model behaves exactly like the vendor's own defaults until you change something.
The vendor-specific rulesThere is an optional platform-wide ceiling on output tokens, applied identically to every vendor. It defaults to zero, meaning no code-level cap — the model governs its own limit and whatever it returns is passed through verbatim.
Truncation is detected rather than guessed. Each vendor signals it differently — OpenAI and Ollama report a length stop, Anthropic reports hitting max tokens, Gemini reports its own equivalent — and all of them are normalised to a single truncated flag on the response. Every response also carries the finish reason, the ceiling that was actually requested, and the provider and model it came from, so a truncated answer is diagnosable from the trace instead of appearing as a mysteriously short reply.
Pricing & Cost
Rates live on the model record, expressed per one million tokens in USD. Three figures are held: input price, output price, and a separate rate for cached tokens.
Token usage is tracked per phase, not just as a single total — classification, generation, safety checks, routing and embeddings are counted separately. Each phase is then priced individually, so the summary shows not only what a run cost but where the money went.
A pricing-configured flag travels with the summary. That distinguishes a genuine zero from a model that simply has no rates entered — without it, an unpriced model would look free rather than unmeasured. A model counts as priced when any one of its three rates is non-zero.
Bulk rate updates- Gated behind its own pricing permission
- Capped at 500 rows per request
- Only the four pricing fields are touched
- Matched by model name, case-insensitively
- Optional title narrows ambiguous matches
- Every matching record is updated, not just the first
- Rows with nothing to change are reported as skipped
System Defaults & Governance
Some parts of the platform need a model without anyone choosing one — the classifier, template matching, semantic search and every embedding job. That is what SYSTEM_DEFAULT is for, and it is enforced rather than merely conventional.
How Models Resolve — Flow Examples
Four diagrams: resolution, vendor mapping, cost, and the rules that protect defaults.
Example 1 — From a model id to a live client Resolution
What happens between an agent naming a model and a vendor call going out. The linked-provider branch is where credentials are decided.
Example 2 — What each vendor actually receives Mapping
The same configured parameters, four different outcomes. Filled rows are forwarded; greyed rows are not sent at all.
Example 3 — How a run's cost is built Cost
Each phase is priced separately, then frozen alongside the token counts so later rate edits cannot rewrite it.
Example 4 — The rules that protect defaults Governance
What the platform enforces when a model is promoted, and the one edit it refuses outright.
Reference Tables
Vendor parameter support, the model record, and how cost is stored.
Parameter support by vendor
| Parameter | Gemini | Anthropic | OpenAI | Ollama |
|---|---|---|---|---|
| temperature | Yes | Not sent | Yes | Yes |
| topP | Dropped if temperature set | Not sent | Dropped if temperature set | Yes |
| topK | Yes | Not sent | — | Yes |
| outputTokens | max output tokens | max tokens | max tokens | prediction count |
| baseUrl | — | — | — | Required, normalised |
Model record
| Field | Purpose |
|---|---|
| Identity | |
| title | Human-facing name shown in pickers |
| modelName | Vendor identifier, sent verbatim |
| modelType | Family — generate or embeddings; a legacy generation value is rewritten |
| provider | Vendor type: gemini, ollama, anthropic or openai |
| providerId | Link to a provider record; when set, its credentials win |
| environment | production, development or staging |
| Behaviour | |
| temperature | Sampling randomness; null means the vendor default |
| topP topK | Sampling limits, where the vendor supports them |
| inputTokens | Recorded context ceiling |
| outputTokens | Output ceiling requested from the vendor |
| dimension | Embedding width; null means the provider's native size |
| webSearch | Whether vendor web search is available |
| imageAnalysis | Vision support — the sole source of truth at runtime |
| Commercial & governance | |
| inputPricePerMillion | Input rate per 1M tokens |
| outputPricePerMillion | Output rate per 1M tokens |
| cachedTokensPrice | Rate for cached tokens |
| currency | Defaults to USD |
| type | SYSTEM_DEFAULT or WORKFLOW_SELECTABLE |
| isActive | Soft-delete flag |
| sharedWithUsers sharedWithRoles | Access grants |
Cost summary
| Field | Meaning |
|---|---|
| total | Run cost, computed at run time and frozen |
| currency | From the model record; USD for now |
| pricingConfigured | False when the model had no rates — distinguishes unmeasured from free |
| breakdown | Per-phase cost: classifier, generation, safety, routing, embeddings |