Repository navigation
feat: add GMI Cloud provider support - #1179
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughAdds GMI as a supported provider, configures its optional-dependency targets, implements its OpenAI-compatible provider and token conversion, and adds model fixtures plus unit tests covering configuration, capabilities, factory wiring, metadata, and parameter handling. ChangesGMI provider support
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/unit/providers/test_gmi_provider.py`:
- Around line 34-39: Wrap the CompletionParams instantiation in
test_gmi_remaps_max_tokens_back_to_max_tokens across multiple lines so each line
stays within the 120-character limit, matching the formatting of the neighboring
test while preserving all arguments and behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 32eef75b-73fe-4f8f-830c-4139cf2bb496
📒 Files selected for processing (6)
pyproject.tomlsrc/any_llm/constants.pysrc/any_llm/providers/gmi/__init__.pysrc/any_llm/providers/gmi/gmi.pytests/conftest.pytests/unit/providers/test_gmi_provider.py
Codecov Report❌ Patch coverage is
... and 38 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…ormat Address review nits on the GMI provider PR: move the GMI enum member after GITHUB to keep LLMProvider alphabetical, correct the test model id from GLM-5.2-FP8 to the documented GLM-5-FP8, and apply ruff format to the provider test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
njbrake
left a comment
There was a problem hiding this comment.
Note: this review was drafted by Claude via back-and-forth with @njbrake. The reasoning and decisions are his; the prose is Claude's.
Thanks for this. I verified GMI independently: it is a real NVIDIA Cloud Partner, and the api.gmi-serving.com/v1 base plus Bearer auth match their published LLM API docs. The provider mirrors our deepseek/github OpenAI-compatible pattern correctly, including the max_completion_tokens to max_tokens remap, and the unit tests plus mypy are clean.
I rebased onto main to clear the conflict and folded in three small review nits: ordered the GMI enum member after GITHUB to keep LLMProvider alphabetical, corrected the test model id to the documented zai-org/GLM-5-FP8, and applied ruff format to the provider test. CI is green.
GMI is intentionally not wired into the CI integration suite (no key configured), so it skips there; that behavior is expected.
## Description <!-- What does this PR do? --> Enable GMI Cloud Responses API capability through the inherited OpenAI-compatible implementation. Cover the capability in provider flags and metadata tests. I tested with GPT-5.5 and GPT-5.6 series models from GMI Cloud, and they only worked perfectly when using the response API, which may be due to a limitation of OpenAI. Other models worked fine using the normal chat completion interface. related mozilla-ai#1179 ## PR Type <!-- Delete the types that don't apply --> - 🆕 New Feature ## Relevant issues <!-- e.g. "Fixes mozilla-ai#123" --> ## Checklist <!-- If this checklist is deleted from the PR submission it will be immediately closed --> - [x] I understand the code I am submitting. - [x] I have added unit tests that prove my fix/feature works - [x] I have run this code locally and verified it fixes the issue. - [x] New and existing tests pass locally - [x] Documentation was updated where necessary - [x] I have read and followed the [contribution guidelines](https://github.com/mozilla-ai/any-llm/blob/main/CONTRIBUTING.md) - [ ] **AI Usage:** - [ ] No AI was used. - [x] AI was used for drafting/refactoring. - [ ] This is fully AI-generated. ## AI Usage Information <!-- We welcome the use of AI to aid in contribution! Optional: We're interested in hearing about your setup. What LLM are you using (e.g. Opus 4.5, GPT-5, Minimax), and which tooling (Claude Code, VsCode, OpenCode, etc) --> - AI Model used: GPT-5.6-Sol - AI Developer Tool used: Amp - Any other info you'd like to share: When answering questions by the reviewer, please respond yourself, do not copy/paste the reviewer comments into an AI system and paste back its answer. We want to discuss with you, not your AI :) - [ ] I am an AI Agent filling out this form (check box if true) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enabled response-style outputs for the GMI provider. - Provider metadata now correctly indicates support for responses. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
Description
Added support for GMI Cloud as a new model provider.
Reference docs:
PR Type
Relevant issues
N/A
What changed
src/any_llm/providers/gmi/gmi.pyadds an OpenAI-compatible GMI Cloud provider and remapsmax_completion_tokensback tomax_tokenssrc/any_llm/providers/gmi/__init__.pyexports the providersrc/any_llm/constants.pyregistersgmiinLLMProviderpyproject.tomladds thegmioptional dependency entry and includes it in theallextratests/unit/providers/test_gmi_provider.pyadds unit coverage for provider construction, metadata, and token param conversiontests/conftest.pyadds GMI model mappings for the shared provider test matrixTesting
Checklist
AI Usage Information
list_modelsplus a single completion).When answering questions by the reviewer, please respond yourself, do not copy/paste the reviewer comments into an AI system and paste back its answer. We want to discuss with you, not your AI :)
Summary by CodeRabbit
gmiis recognised as a supported provider value.