Skip to content

feat: add MiniMax provider support for training data generation#17

Open
octo-patch wants to merge 1 commit into
HarryR:mainfrom
octo-patch:feature/add-minimax-provider
Open

feat: add MiniMax provider support for training data generation#17
octo-patch wants to merge 1 commit into
HarryR:mainfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Add MiniMax as a third LLM backend option for generating training data in gendata.py, alongside Ollama and Claude API.

Changes

  • New --minimax flag for gendata.py to use MiniMax API (OpenAI-compatible endpoint)
  • Supported models: MiniMax-M2.7 (default) and MiniMax-M2.7-highspeed
  • No new dependencies — uses urllib.request (same pattern as Ollama integration)
  • Chain-of-thought handling — strips <think> tags from MiniMax responses
  • Temperature clamping — enforces MiniMax's valid range (0.0, 1.0]
  • Environment variables: MINIMAX_API_KEY (required), MINIMAX_BASE_URL (optional)
  • Unit tests: 20 tests including real API integration test
  • Documentation: Updated README.md and examples/guess/README.md

Usage

# Set API key
export MINIMAX_API_KEY="your-key"

# Generate training data with MiniMax
./gendata.py --topic elephant --minimax -n 500 > training.txt

# Use highspeed model
./gendata.py --topic elephant --minimax --model MiniMax-M2.7-highspeed -n 500

API Reference

Test Plan

  • All 20 unit tests pass (provider config, URL construction, auth headers, temperature clamping, think-tag stripping, error handling)
  • Integration test passes with real MiniMax API
  • End-to-end CLI test generates valid training data (--minimax flag)
  • Existing Ollama and Claude backends remain unaffected
  • python3 -c "import ast; ast.parse(open('examples/guess/gendata.py').read())" passes

- Add MiniMax API as a third LLM backend option in gendata.py (alongside Ollama and Claude)
- Support MiniMax-M2.7 and MiniMax-M2.7-highspeed models via OpenAI-compatible API
- Handle chain-of-thought response parsing (strip <think> tags)
- Enforce temperature constraints (0.0, 1.0] per MiniMax API requirements
- Add MINIMAX_API_KEY and MINIMAX_BASE_URL environment variable support
- Add comprehensive unit tests (20 tests) with real API integration test
- Update README and examples/guess/README.md documentation
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.

1 participant