Skip to content

fix(models): validate MiniMax models against static catalog#12829

Closed
Tranquil-Flow wants to merge 1 commit into
NousResearch:mainfrom
Tranquil-Flow:fix/minimax-model-validation
Closed

fix(models): validate MiniMax models against static catalog#12829
Tranquil-Flow wants to merge 1 commit into
NousResearch:mainfrom
Tranquil-Flow:fix/minimax-model-validation

Conversation

@Tranquil-Flow

Copy link
Copy Markdown
Contributor

What changed

Added a catalog-based validation path for MiniMax models in _resolve_model_selection(), mirroring the existing openai-codex pattern. MiniMax does not expose a /models API endpoint, so the previous code would fall through to a generic "Could not reach API" rejection even for valid model names.

Before: Any MiniMax model would be rejected with "Could not reach API" because the API probe to /v1/models always fails for MiniMax.

After: MiniMax models are validated against a static catalog (case-insensitive matching), with:

  • Exact match detection for known models
  • Auto-correct for close matches (edit distance via difflib.get_close_matches)
  • Suggestion display for near-matches
  • Graceful acceptance with warning for unrecognized models (since the catalog may be incomplete)

Note: Unlike openai-codex which rejects unknown models (accepted: False), MiniMax accepts unknown models with a warning (accepted: True) because the catalog may not cover all available models and the user's model may still work server-side.

How to test

  1. Configure MiniMax as a provider with a valid API key
  2. Set model to MiniMax-M2.7 — should be accepted without warning
  3. Set model to minimax-m2.7 — should be accepted (case-insensitive)
  4. Set model to MiniMax-Text-01 — should auto-correct with suggestion
  5. Set model to MiniMax-Unknown — should be accepted with warning
  6. Run the test suite:
    pytest tests/test_minimax_model_validation.py -v

Platforms tested

  • Linux (Docker container, Python 3.11)

Closes #12611
Closes #12460
Closes #12399
Closes #12547

@teknium1

Copy link
Copy Markdown
Contributor

Merged via #12842 — your commit was cherry-picked onto current main with your authorship preserved (commit 35e7bf6). Thanks for the clean implementation + tests! Closes #12611, #12460, #12399, #12547.

@teknium1 teknium1 closed this Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants