Skip to content

🪙 feat: Add Token Pricing for Devstral, Voxtral, Holo2, and Mistral Medium#13863

Merged
danny-avila merged 1 commit into
danny-avila:devfrom
faktenforum:feat/scaleway-openweight-pricing
Jun 20, 2026
Merged

🪙 feat: Add Token Pricing for Devstral, Voxtral, Holo2, and Mistral Medium#13863
danny-avila merged 1 commit into
danny-avila:devfrom
faktenforum:feat/scaleway-openweight-pricing

Conversation

@JumpLink

Copy link
Copy Markdown
Contributor

Summary

Adds token pricing for four open-weight models that are currently missing from tokenValues in packages/data-schemas/src/methods/tx.ts: Devstral, Voxtral, Holo2, and Mistral Medium.

Because they are absent, getValueKey/getMultiplier fall through to defaultRate (6 = $6 per 1M tokens) for balance checks and transaction accounting whenever these models are used on a custom OpenAI-compatible endpoint. For inexpensive open-weight models this massively over-charges credits. These models are, for example, served on Scaleway's Generative APIs (OpenAI-compatible), where they are an order of magnitude cheaper than the $6 default.

Changes

Added representative USD-per-1M-token rates:

key prompt completion source
devstral 0.4 2.0 Mistral API pricing (Devstral 2)
mistral-medium 1.5 7.5 Mistral API pricing (Mistral Medium 3.5)
voxtral / voxtral-small 0.1 0.4 Mistral API pricing (text)
holo2 0.3 0.7 Scaleway Generative APIs public pricing

Generic keys are used intentionally so versioned ids match via the existing longest-substring lookup in findMatchingPattern, e.g.:

  • devstral-2-123b-instruct-2512devstral
  • mistral-medium-3.5-128bmistral-medium
  • voxtral-small-24b-2507voxtral-small
  • holo2-30b-a3bholo2

None of these keys collide with existing entries.

Notes

  • Sources: Mistral pricing (https://mistral.ai/pricing) for Devstral/Voxtral/Mistral Medium; Scaleway Generative APIs pricing for Holo2 (no first-party hosted price published). Exact figures are best-effort representative rates - happy to adjust to whatever convention you prefer.
  • No behaviour change beyond pricing; purely additive entries in the existing map style.

These open-weight models are not in tokenValues, so they fall back to
defaultRate ($6/1M) for balance/transaction accounting on custom
OpenAI-compatible endpoints (e.g. Scaleway, where they are served).
Add representative per-1M-token USD rates:

- devstral        0.4 / 2.0   (Mistral API pricing)
- mistral-medium  1.5 / 7.5   (Mistral API pricing, Medium 3.5)
- voxtral(-small) 0.1 / 0.4   (Mistral API pricing, text)
- holo2           0.3 / 0.7   (Scaleway Generative APIs public pricing)

Generic keys are used so versioned ids (e.g. devstral-2-123b-instruct-2512,
mistral-medium-3.5-128b, voxtral-small-24b-2507, holo2-30b-a3b) match via the
existing longest-substring lookup.
@danny-avila

Copy link
Copy Markdown
Owner

Thanks @JumpLink, and the diagnosis is correct: absent keys fall through to defaultRate ($6/1M), which over-charges cheap open-weight models.

I will accept the PR but worth flagging before growing the global table even more in the future: this is already doable per-endpoint via tokenConfig, no code change needed. It takes precedence over the built-in map (getMultiplier checks the endpoint config first), and it's scoped to your endpoint, so it reflects the price you actually pay instead of a global guess applied to every provider serving that model:

endpoints:
  custom:
    - name: 'Scaleway'
      apiKey: '${SCALEWAY_API_KEY}'
      baseURL: 'https://api.scaleway.ai/v1'
      models:
        default: ['devstral-2-123b-instruct-2512', 'mistral-medium-3.5-128b', 'voxtral-small-24b-2507', 'holo2-30b-a3b']
        fetch: true
      # USD per 1M tokens; `context` is the model's context window (tokens)
      tokenConfig:
        devstral-2-123b-instruct-2512: { prompt: 0.4, completion: 2.0, context: 256000 }
        mistral-medium-3.5-128b:       { prompt: 1.5, completion: 7.5, context: 128000 }
        voxtral-small-24b-2507:        { prompt: 0.1, completion: 0.4, context: 32000 }
        holo2-30b-a3b:                 { prompt: 0.3, completion: 0.7, context: 32000 }
        # cacheRead / cacheWrite are also supported (optional)

Keys must match the exact model ids your endpoint serves (this path is exact-match, not substring); prompt, completion, and context are required.

That keeps provider-specific rates out of the shared default table, since pricing varies by provider. If you'd still prefer representative defaults baked in for the out-of-box experience, happy to take it. Just note voxtral-small duplicates voxtral (same rate, and voxtral already matches the versioned id), so that line can be dropped.

https://www.librechat.ai/docs/configuration/token_usage

@danny-avila danny-avila changed the title feat: add token pricing for Devstral, Voxtral, Holo2, Mistral Medium 🪙 feat: Add Token Pricing for Devstral, Voxtral, Holo2, and Mistral Medium Jun 20, 2026
@danny-avila
danny-avila merged commit dfc1178 into danny-avila:dev Jun 20, 2026
20 checks passed
@JumpLink
JumpLink deleted the feat/scaleway-openweight-pricing branch June 20, 2026 17:15
JumpLink added a commit to faktenforum/ai-chat-interface that referenced this pull request Jun 20, 2026
Per upstream maintainer feedback on danny-avila/LibreChat#13863: per-endpoint
tokenConfig is the recommended way to price custom endpoints (provider-accurate,
vs a global guess), and its keys are matched EXACTLY against the served model id
(not substring like the built-in tokenValues map).
JumpLink added a commit to faktenforum/LibreChat that referenced this pull request Jun 20, 2026
)

Mirrors our merged upstream contribution (danny-avila#13863, on dev)
so the fork carries it before the next dev->main release. Adds devstral,
mistral-medium, voxtral, holo2 to tokenValues (already-clean form, without the
redundant voxtral-small key removed in danny-avila#13867). Prune when upstream main lands it.
danny-avila pushed a commit that referenced this pull request Jun 20, 2026
`voxtral` already matches the versioned id `voxtral-small-24b-2507` via the
longest-substring lookup, and both keys carry the same rate, so the separate
`voxtral-small` entry is redundant. Follow-up to #13863 per review note.
JumpLink added a commit to faktenforum/ai-chat-interface that referenced this pull request Jun 25, 2026
* feat(librechat): per-user cost control + model refresh

Enable a per-user token balance ($30/user, monthly auto-refill) so spend
can be capped per user. Convention: 1,000,000 token credits = 1 USD.

- prod/dev: balance + transactions enabled; custom endpoints set fetch: true
  (OpenRouter then imports live per-token prices; selector stays curated via
  modelSpecs.addedEndpoints, so no raw model lists are exposed).
- Scaleway has no price feed (its /v1/models returns only id/object/created/
  owned_by), so add an explicit tokenConfig (USD/1M, from Scaleway's EUR
  pricing). It is authoritative for billing and works alongside fetch: true.
- interface.contextCost: show estimated per-message cost.
- Model refresh (verified vs Scaleway pricing + OpenRouter /api/v1/models):
  fix broken slugs (glm/glm-4.7 -> z-ai/glm-4.7; drop mistral-large-2411 which
  404s), correct deepseek-v3.2 context (131072), add gpt-5.5 / grok-4.3 /
  kimi-k2.6, swap gemini-3-flash-preview -> gemini-3.5-flash, replace
  gemma-3-27b -> gemma-4-26b, add qwen3.5-397b / qwen3.6-35b.

Global (org-wide) cost control is handled in a follow-up PR.

* docs(librechat): note tokenConfig is exact-match and recommended

Per upstream maintainer feedback on danny-avila/LibreChat#13863: per-endpoint
tokenConfig is the recommended way to price custom endpoints (provider-accurate,
vs a global guess), and its keys are matched EXACTLY against the served model id
(not substring like the built-in tokenValues map).
fuuuzzy pushed a commit to fuuuzzy/LibreChat that referenced this pull request Jul 7, 2026
…edium (danny-avila#13863)

These open-weight models are not in tokenValues, so they fall back to
defaultRate ($6/1M) for balance/transaction accounting on custom
OpenAI-compatible endpoints (e.g. Scaleway, where they are served).
Add representative per-1M-token USD rates:

- devstral        0.4 / 2.0   (Mistral API pricing)
- mistral-medium  1.5 / 7.5   (Mistral API pricing, Medium 3.5)
- voxtral(-small) 0.1 / 0.4   (Mistral API pricing, text)
- holo2           0.3 / 0.7   (Scaleway Generative APIs public pricing)

Generic keys are used so versioned ids (e.g. devstral-2-123b-instruct-2512,
mistral-medium-3.5-128b, voxtral-small-24b-2507, holo2-30b-a3b) match via the
existing longest-substring lookup.
fuuuzzy pushed a commit to fuuuzzy/LibreChat that referenced this pull request Jul 7, 2026
…13867)

`voxtral` already matches the versioned id `voxtral-small-24b-2507` via the
longest-substring lookup, and both keys carry the same rate, so the separate
`voxtral-small` entry is redundant. Follow-up to danny-avila#13863 per review note.
ThomasVuNguyen pushed a commit to ThomasVuNguyen/LibreChat that referenced this pull request Jul 15, 2026
…edium (danny-avila#13863)

These open-weight models are not in tokenValues, so they fall back to
defaultRate ($6/1M) for balance/transaction accounting on custom
OpenAI-compatible endpoints (e.g. Scaleway, where they are served).
Add representative per-1M-token USD rates:

- devstral        0.4 / 2.0   (Mistral API pricing)
- mistral-medium  1.5 / 7.5   (Mistral API pricing, Medium 3.5)
- voxtral(-small) 0.1 / 0.4   (Mistral API pricing, text)
- holo2           0.3 / 0.7   (Scaleway Generative APIs public pricing)

Generic keys are used so versioned ids (e.g. devstral-2-123b-instruct-2512,
mistral-medium-3.5-128b, voxtral-small-24b-2507, holo2-30b-a3b) match via the
existing longest-substring lookup.
ThomasVuNguyen pushed a commit to ThomasVuNguyen/LibreChat that referenced this pull request Jul 15, 2026
…13867)

`voxtral` already matches the versioned id `voxtral-small-24b-2507` via the
longest-substring lookup, and both keys carry the same rate, so the separate
`voxtral-small` entry is redundant. Follow-up to danny-avila#13863 per review note.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants