Skip to content

Comments

feat: update Gemini model support with latest Google models#134

Merged
jamiepine merged 8 commits intospacedriveapp:mainfrom
adryserage:feat/update-gemini-models
Feb 22, 2026
Merged

feat: update Gemini model support with latest Google models#134
jamiepine merged 8 commits intospacedriveapp:mainfrom
adryserage:feat/update-gemini-models

Conversation

@adryserage
Copy link
Contributor

Summary

  • Upgrade Gemini routing defaults: gemini-2.5-pro for channel/branch (quality tasks), gemini-2.5-flash for worker/compactor/cortex (speed tasks)
  • Add fallback chain: gemini-2.5-progemini-2.5-flashgemini-2.5-flash-lite
  • Add native Gemini API voice transcription model paths alongside existing OpenRouter paths

Details

Google has released several new Gemini models. This PR brings Spacebot's Gemini integration up to date:

Routing (src/llm/routing.rs)

Previously, the Gemini provider used gemini-2.5-flash for all process types with no fallbacks. Now follows the same pattern as other providers (OpenAI, Mistral, etc.) with proper tiering:

Process Type Before After
Channel/Branch gemini-2.5-flash gemini-2.5-pro
Worker/Compactor/Cortex gemini-2.5-flash gemini-2.5-flash
Fallbacks None pro → flash → flash-lite

Voice Transcription (src/api/models.rs)

Added native Gemini API model paths for voice transcription. Previously only OpenRouter paths were listed:

gemini/gemini-2.0-flash
gemini/gemini-2.5-flash
gemini/gemini-2.5-flash-lite
gemini/gemini-2.5-pro
gemini/gemini-3-flash-preview
gemini/gemini-3-pro-preview
gemini/gemini-3.1-pro-preview

Model Catalog

The models.dev catalog integration already handles automatic discovery of new Gemini models via the "gemini" | "google""gemini" provider mapping, so no changes needed there.

Test plan

  • Verify Gemini routing resolves correctly for each process type
  • Test fallback chain triggers on rate limit (429)
  • Verify native Gemini voice transcription models appear in /api/models?capability=voice_transcription
  • Confirm model catalog still loads Gemini models from models.dev

Closes #133

- Upgrade routing defaults: use gemini-2.5-pro for channel/branch
  (quality tasks) and gemini-2.5-flash for worker/compactor/cortex
  (speed tasks)
- Add fallback chain: gemini-2.5-pro → gemini-2.5-flash → gemini-2.5-flash-lite
- Add native Gemini API voice transcription models alongside
  existing OpenRouter paths

Closes spacedriveapp#133
- browser.rs: replace `url::Url` with `reqwest::Url` since the `url`
  crate is not a direct dependency (reqwest re-exports it)
- server.rs: use `State<Arc<ApiState>>` extractor for the auth
  middleware, required by axum 0.8's `from_fn_with_state`
…MODEL env vars

Add environment variable support for custom Anthropic API endpoints
and authentication tokens, enabling use with API proxies (LiteLLM,
Azure AI Gateway, corporate proxies).

New environment variables:
- ANTHROPIC_BASE_URL: override the Anthropic API endpoint
- ANTHROPIC_AUTH_TOKEN: alternative to ANTHROPIC_API_KEY for proxy auth
- SPACEBOT_MODEL: override all process types with a single model

Also fixes a bug where build_anthropic_request() hardcoded the API URL
instead of using the provider's configured base_url, making custom
base URLs via TOML config ineffective.

Closes spacedriveapp#132
adryserage and others added 5 commits February 22, 2026 04:28
The VOLUME keyword is banned on Railway deployments. The /data
directory is still configured via SPACEBOT_DIR env var — volumes
should be mounted via the hosting platform's configuration instead.
Railway requires --mount=type=cache,id=<cache-id> format.
Railway requires cache mount IDs prefixed with a hardcoded service UUID
(--mount=type=cache,id=s/<service-id>-<path>), which is incompatible
with a generic open-source Dockerfile. Remove all cache mounts since
they are a build-speed optimization, not a correctness requirement.
@jamiepine jamiepine merged commit 16d4fa7 into spacedriveapp:main Feb 22, 2026
0 of 3 checks passed
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.

feat: update Gemini model support with latest Google models

2 participants