🪙 feat: Add Token Pricing for Devstral, Voxtral, Holo2, and Mistral Medium#13863
Conversation
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.
|
Thanks @JumpLink, and the diagnosis is correct: absent keys fall through to 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 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); 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 |
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).
) 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.
`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.
* 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).
…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.
…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.
…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.
…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.
Summary
Adds token pricing for four open-weight models that are currently missing from
tokenValuesinpackages/data-schemas/src/methods/tx.ts: Devstral, Voxtral, Holo2, and Mistral Medium.Because they are absent,
getValueKey/getMultiplierfall through todefaultRate(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:
devstralmistral-mediumvoxtral/voxtral-smallholo2Generic keys are used intentionally so versioned ids match via the existing longest-substring lookup in
findMatchingPattern, e.g.:devstral-2-123b-instruct-2512→devstralmistral-medium-3.5-128b→mistral-mediumvoxtral-small-24b-2507→voxtral-smallholo2-30b-a3b→holo2None of these keys collide with existing entries.
Notes