feat: add MiniMax as first-class LLM provider (OpenAI-compat, M2.7, 204K context)#18
Open
octo-patch wants to merge 1 commit into
Open
feat: add MiniMax as first-class LLM provider (OpenAI-compat, M2.7, 204K context)#18octo-patch wants to merge 1 commit into
octo-patch wants to merge 1 commit into
Conversation
Auto-detects MiniMax when MINIMAX_API_KEY is set (or LLM_PROVIDER=minimax), routing all audit LLM calls to api.minimax.io/v1 transparently. Includes temperature clamping helper for MiniMax's (0.0, 1.0] constraint, MiniMax model presets in env.example and README, and 27 unit + integration tests. Supported models (204K context): MiniMax-M2.7, MiniMax-M2.7-highspeed, MiniMax-M2.5, MiniMax-M2.5-highspeed.
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.
Summary
Finite Monkey Engine is an AI-driven smart-contract audit platform. All LLM calls currently flow through
src/openai_api/openai.pyusingOPENAI_API_BASE/OPENAI_API_KEYenvironment variables, which makes it straightforward to plug in any OpenAI-compatible provider.This PR adds first-class MiniMax support by introducing automatic provider detection and a temperature-clamping helper, so users can switch to MiniMax's high-context-window models without changing any other code.
Changes
src/openai_api/openai.py_init_llm_config()auto-detects MiniMax;_clamp_temperature()enforces (0.01, 1.0]env.exampleMINIMAX_API_KEY/LLM_PROVIDERsection with model presetsREADME.mdtests/test_minimax_provider.pytests/integration/test_minimax_integration.pyHow it works
Auto-detection (zero config change for existing users):
_init_llm_config()runs at module import time and writesOPENAI_API_BASE=api.minimax.io+OPENAI_API_KEY=<minimax_key>into the process environment. Every existing helper (ask_openai_common,detect_vulnerabilities, etc.) then routes to MiniMax automatically — no other code changes needed.Supported MiniMax models (all with 204 K context):
MiniMax-M2.7MiniMax-M2.7-highspeedMiniMax-M2.5MiniMax-M2.5-highspeedTemperature safety:
_clamp_temperature()enforces MiniMax's(0.0, 1.0]constraint (nudging 0 → 0.01) and is harmless for any other provider.Testing
All 27 tests pass.