Repository navigation
feat: add MiniMax Flash and M3 pricing fallbacks - #81
Open
octo-patch wants to merge 2 commits into
Open
octo-patch wants to merge 2 commits into
octo-patch wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason: Add MiniMax-M3.1-Flash and MiniMax-M3 custom pricing fallbacks for accurate usage costs.
The pricing helper now covers MiniMax-M3.1-Flash at the documented direct rates ($0.15 input, $0.60 output, $0.015 cache-read per million tokens) and MiniMax-M3 at the documented standard baseline ($0.30/$1.20/$0.06). It preserves existing saved/custom model behavior, free-model handling, provider-aware SDK lookup, and legacy pricing entries. The M3 long-context threshold is retained as a documented limitation because the published value does not define its exact integer expansion.
The pricing logic is isolated in
lib/pricing.jsso the SDK boundary can be tested offline with a mocked@pydantic/genai-pricesmodule. This repository owns usage-cost calculation; model catalogs/defaults and MiniMax HTTP transport remain delegated to Hermes Agent.Checks:
npm test(16 passing unit tests)npm run buildnode --check server.jsnode --check lib/pricing.jsnode --check test/pricing.test.jsgit diff --check