Skip to content

Conversation

@ainergiz
Copy link
Contributor

@ainergiz ainergiz commented Jan 5, 2026

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

ainergiz and others added 4 commits January 5, 2026 04:43
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>
@alexzhang13
Copy link
Owner

another question: checked this #6 about anthropic client stream support. if the direction is using stream rather than create we can change it for gemini client from the start

Likely won't worry about stream support for now, because it's doing multiple turns anyways. I like this as is.

@alexzhang13 alexzhang13 merged commit 231779e into alexzhang13:main Jan 5, 2026
3 checks passed
@alexzhang13
Copy link
Owner

Thanks, merged!

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.

2 participants