Skip to content

feat(gemini): Phase 6 - list models + remote discovery#1688

Merged
bug-ops merged 1 commit intomainfrom
gemini-list-models
Mar 13, 2026
Merged

feat(gemini): Phase 6 - list models + remote discovery#1688
bug-ops merged 1 commit intomainfrom
gemini-list-models

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 13, 2026

Closes #1598. Part of #1592.

Summary

  • Implement GET /v1beta/models endpoint in GeminiProvider::list_models_remote()
  • Filter to generative models only (exclude embedding-only models)
  • Map API response to RemoteModelInfo with context window and display name populated
  • Wire AnyProvider::Gemini arm in any.rs to delegate to list_models_remote()
  • Update CHANGELOG.md [Unreleased] section

Implementation Details

  • API key sent via x-goog-api-key header (not query param — avoids log exposure)
  • models/ prefix stripped from model IDs (e.g. models/gemini-2.0-flashgemini-2.0-flash)
  • context_window from inputTokenLimit, display_name from displayName, created_at: None
  • Results saved to ModelCache::for_slug("gemini")

Test Plan

  • 13 unit tests: happy path, generative-only filter, empty list, HTTP 500, HTTP 401, serde edge cases (missing models field, unknown fields, missing inputTokenLimit)
  • cargo +nightly fmt --check passes
  • cargo clippy --workspace --features full -- -D warnings passes
  • cargo nextest run --workspace --features full --lib --bins: 5288 passed

@github-actions github-actions bot added documentation Improvements or additions to documentation llm zeph-llm crate (Ollama, Claude) rust Rust code changes enhancement New feature or request labels Mar 13, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 13, 2026 20:51
@github-actions github-actions bot added the size/L Large PR (201-500 lines) label Mar 13, 2026
Add remote model discovery for the Gemini provider (issue #1598).

- Add GeminiModelList/GeminiModelEntry serde structs with camelCase mapping
- Implement list_models_remote() using x-goog-api-key header (not query param)
- Filter to generative models only (supportedGenerationMethods contains generateContent)
- Strip models/ prefix from name field to produce clean model IDs
- Populate context_window from inputTokenLimit, display_name from displayName
- Save results to ModelCache::for_slug("gemini")
- Wire AnyProvider::Gemini arm in any.rs to delegate to list_models_remote()
- Add 13 unit tests covering happy path, filtering, error responses, serde edge cases
@bug-ops bug-ops force-pushed the gemini-list-models branch from c91c407 to 44f79c6 Compare March 13, 2026 20:54
@bug-ops bug-ops linked an issue Mar 13, 2026 that may be closed by this pull request
6 tasks
@bug-ops bug-ops merged commit d3b4e2e into main Mar 13, 2026
15 checks passed
@bug-ops bug-ops deleted the gemini-list-models branch March 13, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request llm zeph-llm crate (Ollama, Claude) rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(gemini): Phase 6 -- list models + remote discovery feat(gemini): add Google Gemini provider

1 participant