Repository navigation
add gemini client - #12
Merged
alexzhang13 merged 4 commits intoJan 5, 2026
Merged
Conversation
Adds support for Google Gemini models as a new backend option.
- Create GeminiClient in rlm/clients/gemini.py using official google-genai SDK
- Add "gemini" to ClientBackend type
- Register GeminiClient in get_client() factory
- Add google-genai>=1.56.0 dependency
- Default model: gemini-2.5-flash
Usage:
```python
rlm = RLM(
backend="gemini",
backend_kwargs={"api_key": "...", "model_name": "gemini-2.5-flash"},
environment="local",
)
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Matches the pattern used in openai.py client. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 12 unit tests with mocked API calls - 3 integration tests (skipped without GEMINI_API_KEY) - Tests cover initialization, usage tracking, message preparation, role mapping 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
Likely won't worry about stream support for now, because it's doing multiple turns anyways. I like this as is. |
Owner
|
Thanks, merged! |
william-c-stanford
referenced
this pull request
in akramlodi/rlm_self_harness
Aug 9, 2026
…e review Loader hardening: non-finite S6 values rejected at the caps gate (#1); rejections keyed by unique directory names (#2); declared-id mismatch caught at the text level before any candidate code runs (#3); gate subprocess launch/decode failures return structured rejections (#11); unhashable surface values rejected instead of raising (#12). Ledger contract: non-finite band bounds render as null and all persisted JSON is strict RFC-8259 (#4); rejection-only rounds persist an auditable ledger with a null baseline (#5). Live smoke round regenerated with the fixed serialization. Claude-Session: https://claude.ai/code/session_01QfVmUyopDjKxK3b4nWxKWM
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.
adds gemini.py in client options following official docs
made claude to write an ephemeral test to benchmark, worked like a charm with gemini-2.5-flash (3.0 models are preview and their gemini api is not the most reliable one)
one decision i wasn't sure about was whether to use openai compatibility or gemini's own recommended implementation. they disencourage openai compatibility and also has a new beta interactions api thing they are bringing. lemme know if you prefer openai compatibility
edit: realised test was missing, it's in place now in tests/clients. bit verbose opus style, can be trimmed
another question: checked this pr about anthropic client stream support. if the direction is using stream rather than create we can change it for gemini client from the start