cai/examples/model_providers
PR Bot a2c1fd60aa feat: add MiniMax as first-class LLM provider
Add MiniMaxProvider with built-in support for MiniMax's OpenAI-compatible
API (MiniMax-M2.7, MiniMax-M2.5, MiniMax-M2.5-highspeed models).

Changes:
- Add MiniMaxProvider class implementing ModelProvider interface
- Add MiniMax model routing in OpenAIChatCompletionsModel for litellm
- Export MiniMaxProvider from agents __init__.py
- Add provider documentation (docs/providers/minimax.md)
- Add usage example (examples/model_providers/minimax_example.py)
- Add MiniMax to README provider list
- Add 18 unit tests and 3 integration tests
2026-03-20 19:32:23 +08:00
..
README.md Re-structure under sdk/agents, get CLI mockup 2025-03-27 14:31:38 +01:00
custom_example_agent.py Update custom models to use tools 2025-03-13 13:10:26 -04:00
custom_example_global.py Update custom models to use tools 2025-03-13 13:10:26 -04:00
custom_example_provider.py Update custom models to use tools 2025-03-13 13:10:26 -04:00
litellm.py Re-structure under sdk/agents, get CLI mockup 2025-03-27 14:31:38 +01:00
litellm_config.yaml Re-structure under sdk/agents, get CLI mockup 2025-03-27 14:31:38 +01:00
minimax_example.py feat: add MiniMax as first-class LLM provider 2026-03-20 19:32:23 +08:00

README.md

Custom LLM providers

The examples in this directory demonstrate how you might use a non-OpenAI LLM provider. To run them, first set a base URL, API key and model.

export EXAMPLE_BASE_URL="..."
export EXAMPLE_API_KEY="..."
export EXAMPLE_MODEL_NAME"..."

Then run the examples, e.g.:

python examples/model_providers/custom_example_provider.py

Loops within themselves,
Function calls its own being,
Depth without ending.

LiteLLM Proxy Server integration

LiteLLM integration helps out switch between models easily and rapidly. This is easy to integrate via AsyncOpenAI:

# launch server proxy with your configuration
litellm --config examples/model_providers/litellm_config.yaml

# then use the proxy via the SDK
python3 examples/model_providers/litellm.py

Testing the proxy server

Testing some basic models against proxy to verify it's operational:

# qwen2.5:14b
curl -s http://localhost:4000/v1/chat/completions -H "Content-Type: application/json" -d '{"model": "qwen2.5:14b", "messages": [{"role": "user", "content": "Say hi"}], "max_tokens": 10}' | jq

# claude-3-7
curl -s http://localhost:4000/v1/chat/completions -H "Content-Type: application/json" -d '{"model": "claude-3-7", "messages": [{"role": "user", "content": "Say hi"}], "max_tokens": 10}' | jq

# gpt-4o
curl -s http://localhost:4000/v1/chat/completions -H "Content-Type: application/json" -d '{"model": "gpt-4o", "messages": [{"role": "user", "content": "Say hi"}], "max_tokens": 10}' | jq

When using virtual keys:

curl -s http://localhost:4000/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer REDACTED_EXAMPLE_KEY" -d '{"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "Say hi"}], "max_tokens": 10}' | jq