> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getbifrost.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Datasheet Editor

> Edit model limits, capabilities and base prices from the synced datasheet, or add models it does not list. Your edits survive every datasheet sync.

## Overview

Bifrost keeps a model **datasheet**: context windows, token limits, deprecation flags, capability flags (tool calling, structured output, reasoning, ...) and base prices for every model it knows. The datasheet is synced from a remote source every 24 hours (see [Custom Pricing](https://docs.getbifrost.ai/providers/custom-pricing.md#pricing-data-source) for the URLs and interval).

A sync overwrites every synced value. The **Datasheet Editor** lets you keep your own values anyway:

* **Edit any datasheet value**: context length, max input and output tokens, deprecation, base prices, capability flags and any other model parameter.
* **Add custom models** the datasheet does not list, such as a fine-tuned or self-hosted model, so they are priced and described correctly.
* **Edits survive updates.** Bifrost stores your edits separately and re-applies them after every sync. The synced (upstream) value stays visible next to yours.
* **Drift detection.** When upstream changes a value you edited, the entry is flagged **Upstream changed** and shows the value it had when you saved.

> [!NOTE]
>
> Base prices you set here replace the datasheet price wherever Bifrost prices a request from the catalog. [Pricing overrides](https://docs.getbifrost.ai/providers/custom-pricing.md) still apply on top, so a virtual-key or provider-key override keeps working against your edited base price. A provider that reports its own `usage.cost` above zero is priced from that figure instead, unless `ignore_provider_cost` is enabled on it; see [Providers that report their own cost](https://docs.getbifrost.ai/providers/custom-pricing.md#providers-that-report-their-own-cost).

***

## How edits are applied

Each edit is a **datasheet override** for one `(provider, model, mode)` entry. It holds two [JSON merge patches](https://www.rfc-editor.org/rfc/rfc7386):

| Patch | Applies to | Examples |
| - | - | - |
| `pricing_patch` | The pricing entry | `context_length`, `max_input_tokens`, `max_output_tokens`, `is_deprecated`, `input_cost_per_token`, `output_cost_per_token`, any other cost field |
| `params_patch` | The model-parameters entry | `supports_function_calling`, `supports_response_schema`, `reasoning_effort_levels`, `max_output_tokens`, `supported_endpoints` |

In a patch, a key sets the value, `null` clears it, and an omitted key leaves the value unchanged by that patch. Mode-wide pricing overrides apply before mode-specific overrides. If both set the same field, removing the mode-specific key exposes the mode-wide value. To restore the upstream datasheet value, remove that field from every applicable override; deleting one override leaves any other applicable overrides in effect.

> [!NOTE]
>
> The model-parameters entry has no mode, so a `params_patch` applies to every mode of the model, whichever `mode` the override targets. When several overrides for the same model carry a `params_patch`, they apply in order: the mode-wide override first, then the others by mode.

The datasheet sync keeps writing upstream values to the database untouched; the overrides are merged in memory whenever the datasheet is loaded. Nothing is merged on the request path, so edits add no per-request cost.

> [!TIP]
>
> Set `max_output_tokens` in both patches. The pricing entry and the model-parameters entry each carry one, and providers read the latter when they fill in a default `max_tokens`. The Web UI does this for you.

***

## Editing an entry

> [tab] Web UI
>
> 1. Navigate to **Models → Datasheet Editor** in the sidebar
> 2. Search for the model, or narrow the list by provider. Turn on **Edited only** to see the entries you have changed
> 3. Click the edit icon on the row
> 4. Change any field. Empty fields and **Follow datasheet** choices keep following upstream; the datasheet value is shown under each field
> 5. Click **Save**
>
> To undo a single field in the selected override, clear it (or use the reset icon next to a limit) and save. **Reset to datasheet** deletes the selected override. Other applicable overrides remain in effect; remove their edits too if you want to restore the upstream values.
>
> You can also open the editor from **Model Catalog → Models**: the model sheet links to its datasheet entry.

> [tab] API
>
> Saving through the API requires a configured config store. Without one, the endpoint returns `503`. For a file-only deployment without a config store, use the **config.json** tab instead.
>
> **Save an override** (creates it, or replaces the one saved for the same target):
>
> ```bash theme={null}
> curl -X PUT http://localhost:8080/api/models/datasheet/overrides \
>   -H "Content-Type: application/json" \
>   -d '{
>     "provider": "openai",
>     "model": "gpt-4o",
>     "mode": "chat",
>     "pricing_patch": {
>       "context_length": 64000,
>       "input_cost_per_token": 0.000002
>     },
>     "params_patch": {
>       "supports_response_schema": true
>     }
>   }'
> ```
>
> Saving re-records the upstream baseline, which also clears drift for that entry. A save with no patches removes a non-custom target's override. A custom save (`is_custom: true`) with no patches keeps the entry; if its model and mode are absent from the datasheet, its pricing fields are zero-valued. Use `DELETE /api/models/datasheet/overrides/{id}` to remove a custom entry. Unknown fields in the body are rejected with `400`, so a misspelled patch name never reads as an empty save.
>
> **List entries** with upstream and effective values:
>
> ```bash theme={null}
> curl "http://localhost:8080/api/models/datasheet?query=gpt-4o&overridden_only=true"
> ```
>
> **Read one entry**, including the model-parameters entry before and after your edits:
>
> ```bash theme={null}
> curl "http://localhost:8080/api/models/datasheet/entry?provider=openai&model=gpt-4o&mode=chat"
> ```
>
> **Delete an override**:
>
> ```bash theme={null}
> curl -X DELETE http://localhost:8080/api/models/datasheet/overrides/{id}
> ```

> [tab] config.json
>
> ```json theme={null}
> {
>   "datasheet_overrides": [
>     {
>       "provider": "openai",
>       "model": "gpt-4o",
>       "mode": "chat",
>       "pricing_patch": { "context_length": 64000 },
>       "params_patch": { "supports_response_schema": true }
>     },
>     {
>       "provider": "openai",
>       "model": "gpt-4o-mini",
>       "pricing_patch": { "is_deprecated": true }
>     }
>   ]
> }
> ```
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `provider` | string | Yes | Provider of the entry, e.g. `openai` |
> | `model` | string | Yes | Model name as it appears in the datasheet |
> | `mode` | string | No | Datasheet mode (`chat`, `responses`, `embedding`, ...). Omit to apply `pricing_patch` to every mode of the model. Required when `is_custom` is `true` |
> | `is_custom` | boolean | No | Adds an entry the datasheet does not list |
> | `pricing_patch` | object | No | Merge patch over the pricing entry |
> | `params_patch` | object | No | Merge patch over the model-parameters entry. `provider` cannot be patched |
>
> An entry from `config.json` is written only when it changes, so an edit you make to the same entry in the Web UI stands until the `config.json` entry itself changes. With `"source_of_truth": "config.json"` and a `datasheet_overrides` section present, overrides that are no longer listed in the file are removed at startup. An omitted section leaves stored overrides unchanged, and an explicit `"datasheet_overrides": []` removes all of them.

***

## Adding a custom model

A custom entry describes a model the datasheet does not list. Bifrost prices requests to it from your values and reports its limits and capabilities like any other model. If the datasheet later starts listing the same model, your values still win, and the upstream values show up next to them.

> [tab] Web UI
>
> 1. Navigate to **Models → Datasheet Editor**
> 2. Click **Add custom model**
> 3. Pick the provider, enter the model name and choose the mode
> 4. Fill in the limits, prices and capabilities you need
> 5. Click **Save**

> [tab] API
>
> ```bash theme={null}
> curl -X PUT http://localhost:8080/api/models/datasheet/overrides \
>   -H "Content-Type: application/json" \
>   -d '{
>     "provider": "openai",
>     "model": "ft:gpt-4o-mini:acme:support",
>     "mode": "chat",
>     "is_custom": true,
>     "pricing_patch": {
>       "context_length": 128000,
>       "max_output_tokens": 16384,
>       "input_cost_per_token": 0.0000003,
>       "output_cost_per_token": 0.0000012
>     },
>     "params_patch": {
>       "max_output_tokens": 16384,
>       "supports_function_calling": true
>     }
>   }'
> ```

> [tab] config.json
>
> ```json theme={null}
> {
>   "datasheet_overrides": [
>     {
>       "provider": "openai",
>       "model": "ft:gpt-4o-mini:acme:support",
>       "mode": "chat",
>       "is_custom": true,
>       "pricing_patch": {
>         "input_cost_per_token": 0.0000003,
>         "output_cost_per_token": 0.0000012
>       }
>     }
>   ]
> }
> ```

***

## Upstream drift

With a config store, saving an override records the upstream value of every field it patches. After each sync Bifrost compares those baselines with the current upstream values:

* In the Web UI the entry gets an **Upstream changed** badge, and the field shows the value it had when you saved.
* In the API, `drifted_fields` lists the affected fields as `pricing.<field>` or `params.<field>`.

Drift tracking requires a config store. Overrides loaded from `config.json` without a config store have no recorded baselines, so later upstream changes cannot be reported.

For a pricing override without `mode`, Bifrost records and compares the baseline from only the first mode in sort order. Changes confined to other modes do not trigger a pricing drift indication. Use mode-specific overrides when each mode needs its own pricing drift tracking.

Your value keeps applying either way. Repeat the API save with the same patches to accept the new baseline without changing your override. The Web UI only enables **Save** after a field changes. To switch to the upstream value instead, remove the field from every applicable override and save.

***

## Permissions

With role-based access control (Enterprise), the editor has its own **Datasheet** resource, so a role can browse models without being able to change their limits or prices.

| Action | Permission |
| - | - |
| View the datasheet | `Datasheet:View` |
| Save, reset or delete overrides | `Datasheet:Update` |

By default Admin holds both, and Developer and Viewer can only view. Custom roles get no access until you grant it.

In a cluster, a change made on one node is picked up by the others through the same reload that follows a datasheet sync.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.