feat(provider): add Rapid-MLX as named provider#24325
feat(provider): add Rapid-MLX as named provider#24325raullenchai wants to merge 1 commit intoBerriAI:mainfrom
Conversation
Adds Rapid-MLX (https://github.com/raullenchai/Rapid-MLX) as a named provider via the JSON provider registry. Rapid-MLX is an OpenAI-compatible inference server optimized for Apple Silicon (MLX), offering 2-4x faster inference than Ollama with full tool calling and prompt caching. Changes: - providers.json: add rapid_mlx entry - types/utils.py: add RAPID_MLX to LlmProviders enum - provider_endpoints_support.json: add rapid_mlx provider docs - docs: add provider documentation page - sidebars.js: add rapid_mlx to docs navigation - tests: add unit tests for provider routing
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Raullen seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Greptile SummaryThis PR adds Rapid-MLX as a named OpenAI-compatible provider via the JSON provider registry, following the same pattern as other local inference providers (e.g., Key changes:
Issues found:
Confidence Score: 2/5
|
| Filename | Overview |
|---|---|
| litellm/llms/openai_like/providers.json | Adds rapid_mlx provider entry; missing the required api_base_env field, causing RAPID_MLX_API_BASE env var overrides to be silently ignored. |
| provider_endpoints_support.json | Adds rapid_mlx endpoint capabilities; incorrectly marks a2a and interactions as true without evidence of actual support in Rapid-MLX. |
| litellm/types/utils.py | Adds RAPID_MLX = "rapid_mlx" to the LlmProviders enum — straightforward and correct. |
| tests/test_litellm/llms/rapid_mlx/test_rapid_mlx_completion.py | Unit tests mock openai_chat_completions.completion (no real network calls — compliant with repo rules); however, test_rapid_mlx_custom_api_base will fail at runtime because the missing api_base_env in providers.json prevents env-var resolution. |
| docs/my-website/docs/providers/rapid_mlx.md | Provider documentation page — well-structured, documents env vars, usage examples, and supported models. No issues. |
| docs/my-website/sidebars.js | Adds providers/rapid_mlx to the sidebar in alphabetical order — correct placement between ragflow and recraft. |
| tests/test_litellm/llms/rapid_mlx/init.py | Empty __init__.py to mark the test directory as a Python package — no issues. |
Sequence Diagram
sequenceDiagram
participant U as User
participant LC as litellm.completion
participant JL as json_loader
participant DC as dynamic_config
participant OAI as openai_chat_completions
U->>LC: completion(model="rapid_mlx/default")
LC->>JL: load providers.json rapid_mlx entry
JL-->>DC: SimpleProviderConfig(base_url, api_key_env, api_base_env=None)
LC->>DC: _get_openai_compatible_provider_info
Note over DC: api_base_env is None so env var override is skipped
Note over DC: Falls back to hardcoded localhost default URL
DC-->>LC: resolved_base and resolved_key
LC->>OAI: completion with resolved api_base and api_key
OAI-->>U: Response
Last reviewed commit: "feat(provider): add ..."
| "rapid_mlx": { | ||
| "base_url": "http://localhost:8000/v1", | ||
| "api_key_env": "RAPID_MLX_API_KEY", | ||
| "default_api_key": "not-needed" | ||
| } |
There was a problem hiding this comment.
Missing
api_base_env — RAPID_MLX_API_BASE env var will never be read
The rapid_mlx entry is missing the "api_base_env" field. Without it, provider.api_base_env is None in dynamic_config.py, so the following branch is never reached:
# dynamic_config.py L68-69
if not resolved_base and provider.api_base_env:
resolved_base = get_secret_str(provider.api_base_env)This means the RAPID_MLX_API_BASE environment variable documented in the docs and verified by test_rapid_mlx_custom_api_base will be silently ignored — the provider always falls through to the hardcoded "http://localhost:8000/v1" default. Compare with the publicai entry directly above this block, which includes "api_base_env": "PUBLICAI_API_BASE".
| "rapid_mlx": { | |
| "base_url": "http://localhost:8000/v1", | |
| "api_key_env": "RAPID_MLX_API_KEY", | |
| "default_api_key": "not-needed" | |
| } | |
| "rapid_mlx": { | |
| "base_url": "http://localhost:8000/v1", | |
| "api_key_env": "RAPID_MLX_API_KEY", | |
| "api_base_env": "RAPID_MLX_API_BASE", | |
| "default_api_key": "not-needed" | |
| } |
| "rerank": false, | ||
| "a2a": true, | ||
| "interactions": true | ||
| } |
There was a problem hiding this comment.
Unsupported
a2a and interactions capabilities enabled
"a2a": true and "interactions": true are set for rapid_mlx, but neither the Rapid-MLX documentation, the PR description, nor the rapid_mlx.md provider page mentions support for the A2A (Agent-to-Agent) protocol or the Interactions endpoint.
Contrast with the immediately preceding charity_engine entry (lines 2557–2571), which is also an OpenAI-compatible provider and omits both fields entirely. Unless Rapid-MLX explicitly implements these protocols, advertising them here will route requests to a server that doesn't support them, leading to runtime errors for users who rely on them.
These fields should be removed (or set to false) until A2A/Interactions support is confirmed and documented:
| "rerank": false, | |
| "a2a": true, | |
| "interactions": true | |
| } | |
| "batches": false, | |
| "rerank": false |
Summary
Adds Rapid-MLX as a named provider via the JSON provider registry.
Rapid-MLX is an OpenAI-compatible inference server optimized for Apple Silicon (MLX), offering 2-4x faster inference than Ollama with full tool calling, reasoning separation, and prompt caching.
Changes
litellm/llms/openai_like/providers.json— addrapid_mlxentry withbase_url,api_key_env, anddefault_api_keylitellm/types/utils.py— addRAPID_MLX = "rapid_mlx"toLlmProvidersenumprovider_endpoints_support.json— addrapid_mlxprovider with supported endpointsdocs/my-website/docs/providers/rapid_mlx.md— provider documentation page (install, SDK usage, proxy config, env vars)docs/my-website/sidebars.js— addrapid_mlxto provider docs navigationtests/test_litellm/llms/rapid_mlx/test_rapid_mlx_completion.py— unit tests for provider routing, custom API base, and custom API keyUsage
Test plan
rapid_mlx/prefix -> correct api_base and api_key)RAPID_MLX_API_BASEenv var overrideRAPID_MLX_API_KEYenv var override