# How to Configure Provider Model Overrides and Pricing in reasonix.toml

> Configure provider model overrides and pricing in reasonix.toml. Learn how to define [[providers]] blocks, use model_overrides for per-model settings, and prices for custom token costs.

- Repository: [YHH/DeepSeek-Reasonix](https://github.com/esengine/DeepSeek-Reasonix)
- Tags: how-to-guide
- Published: 2026-08-05

---

**To configure provider model overrides and pricing in [`reasonix.toml`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/reasonix.toml), define a `[[providers]]` block and use the `model_overrides` map for per-model settings and the `prices` map for custom per-token costs.**

The [`reasonix.toml`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/reasonix.toml) file serves as the central configuration hub for the DeepSeek-Reasonix engine, controlling which AI providers are available and how their models are priced. By configuring provider model overrides and pricing in [`reasonix.toml`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/reasonix.toml), you can fine-tune context windows, enable vision capabilities, and lock in specific rates per million tokens. The configuration system follows a four-level hierarchy where project-level settings take precedence over global defaults but yield to command-line flags.

## Configuration Hierarchy and Precedence

DeepSeek-Reasonix evaluates configuration settings across four distinct levels, with each level overriding the one below it:

1. **Command-line flags** – Highest priority, temporary overrides for single invocations
2. **[`./reasonix.toml`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/./reasonix.toml)** – Project-level configuration in the current working directory  
3. **`<Reasonix-home>/config.toml`** – Global user configuration
4. **Built-in defaults** – Lowest priority, fallback values defined in the source

When you configure provider model overrides and pricing in [`reasonix.toml`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/reasonix.toml) at the project level, those settings persist across sessions while remaining portable via version control.

## Defining Provider Model Overrides

The `model_overrides` key within a `[[providers]]` block allows you to override provider-wide defaults for specific models. According to [`internal/config/config.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/config/config.go) (lines 1376-1380), this field maps model IDs to `ProviderModelOverride` structures.

Common override fields include:

- **`context_window`** – Adjust the maximum token context for models with different limits than the provider default
- **`max_output_tokens`** – Cap the response length for specific models  
- **`reasoning_protocol`** – Select extended reasoning implementations (e.g., `"openai"` or `"none"`)
- **`vision`** – Boolean flag to enable or disable vision capabilities per model

In [`reasonix.example.toml`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/reasonix.example.toml) (line 67), the syntax appears as a TOML inline table:

```toml
model_overrides = { "deepseek-v4-flash" = { context_window = 1000000 } }

```

For mixed-gateway providers where models expose differing capabilities, you can disable reasoning for one model while enabling vision for another:

```toml
[[providers]]
name = "openai-compatible-custom"
kind = "openai"
base_url = "https://api.example.com/v1"
models = ["model-a", "model-b"]

model_overrides = {
  "model-b" = {
    reasoning_protocol = "none",
    vision = true
  }
}

```

## Configuring Custom Pricing

The `prices` map locks in per-model costs, overriding any provider-wide defaults. As implemented in [`internal/config/pricing.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/config/pricing.go) (lines 41-44), the system back-fills built-in defaults only when you omit custom rates.

Each pricing entry supports:

- **`input`** – Cost per 1 million input tokens
- **`output`** – Cost per 1 million output tokens  
- **`cache_hit`** – Cost per 1 million cached tokens
- **`currency`** – Currency symbol or code (e.g., `"¥"`, `"USD"`)

From [`reasonix.example.toml`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/reasonix.example.toml) (lines 71+):

```toml
prices = {
  "deepseek-v4-flash" = { cache_hit = 0.02, input = 1, output = 2, currency = "¥" },
  "deepseek-v4-pro" = { cache_hit = 0.025, input = 3, output = 6, currency = "¥" }
}

```

This configuration ensures that cost-tracking and quota enforcement use your specified rates rather than fluctuating provider defaults.

## Complete Configuration Example

Combine both features in a single provider definition:

```toml
[[providers]]
name = "deepseek"
kind = "openai"
base_url = "https://api.deepseek.com"
models = ["deepseek-v4-flash", "deepseek-v4-pro"]
default = "deepseek-v4-flash"
api_key_env = "DEEPSEEK_API_KEY"
context_window = 1000000

# Override specific model capabilities

model_overrides = {
  "deepseek-v4-flash" = { context_window = 2000000 }
}

# Lock in pricing (per 1M tokens)

prices = {
  "deepseek-v4-flash" = { cache_hit = 0.02, input = 1, output = 2, currency = "¥" },
  "deepseek-v4-pro" = { cache_hit = 0.025, input = 3, output = 6, currency = "¥" }
}

```

The [`internal/config/render.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/config/render.go) file (lines 381-384) handles serializing these maps back to TOML, ensuring that programmatic changes persist correctly to disk.

## Key Implementation Files

Understanding the source structure helps troubleshoot configuration issues:

- **[`reasonix.example.toml`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/reasonix.example.toml)** – Canonical reference showing all supported keys and syntax patterns
- **[`internal/config/config.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/config/config.go)** – Defines the `Config` struct with `ModelOverrides` and `Prices` fields mapped directly to TOML keys  
- **[`internal/config/pricing.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/config/pricing.go)** – Implements pricing validation and default back-fill logic
- **[`internal/config/render.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/config/render.go)** – Serializes configuration changes back to TOML format
- **[`docs/SPEC.md`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/docs/SPEC.md)** (lines 103-107) – Formal specification of the configuration format

## Summary

- **Configuration hierarchy** places [`./reasonix.toml`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/./reasonix.toml) between command-line flags and global settings, making it ideal for project-specific overrides.
- **Model overrides** use the `model_overrides` map to adjust `context_window`, `vision`, `reasoning_protocol`, and other per-model capabilities.
- **Custom pricing** is set via the `prices` map with `input`, `output`, `cache_hit`, and `currency` fields, overriding provider defaults.
- **Source code** in `internal/config/` handles parsing, validation, and persistence of these settings.

## Frequently Asked Questions

### What happens if I specify a model in prices but not in model_overrides?

The model will use the custom pricing rates you defined while inheriting all other settings (context window, vision support, etc.) from the provider-wide defaults. The `prices` and `model_overrides` maps operate independently in [`reasonix.toml`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/reasonix.toml).

### Can I use different currencies for different models within the same provider?

Yes. Each entry in the `prices` map includes its own `currency` field, allowing you to specify `"¥"` for one model and `"USD"` for another. The cost-tracking system records expenses using the currency defined for each specific model.

### How do I temporarily override a setting without modifying reasonix.toml?

Use command-line flags, which take precedence over all configuration file settings. The hierarchy defined in the DeepSeek-Reasonix source code ensures that CLI arguments override [`./reasonix.toml`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/./reasonix.toml), which in turn overrides the global `<Reasonix-home>/config.toml`.

### Where does Reasonix store the built-in default pricing?

Built-in defaults are hardcoded in the source and applied in [`internal/config/pricing.go`](https://github.com/esengine/DeepSeek-Reasonix/blob/main/internal/config/pricing.go) only when you do not supply custom rates in the `prices` map. If you specify any pricing field for a model, the system uses your values exclusively without merging with defaults.