Skip to content

Add Gemini AI provider#16

Open
alon710 wants to merge 4 commits into
Shaya16:mainfrom
alon710:alon710/add-gemini-provider
Open

Add Gemini AI provider#16
alon710 wants to merge 4 commits into
Shaya16:mainfrom
alon710:alon710/add-gemini-provider

Conversation

@alon710

@alon710 alon710 commented May 27, 2026

Copy link
Copy Markdown

Summary

  • add Gemini as a selectable AI provider in setup and Settings
  • persist encrypted Gemini API keys plus a selectable stable Gemini model
  • route Gemini categorization through the saved model and add Gemini-specific network errors
  • update README provider docs with Gemini and stable model options

Stable Gemini models

Based on the Gemini API models docs: https://ai.google.dev/gemini-api/docs/models

Included stable text models:

  • gemini-3.5-flash
  • gemini-3.1-flash-lite
  • gemini-2.5-flash
  • gemini-2.5-flash-lite
  • gemini-2.5-pro

Validation

  • npx tsc --noEmit
  • npm run lint -- src/components/settings/ai-section.tsx src/components/setup/ai-step.tsx src/components/setup/complete-step.tsx src/app/api/setup/ai/route.ts src/lib/api.ts src/lib/types.ts src/server/ai/factory.ts src/server/ai/providers/gemini.ts src/server/db/queries/settings.ts src/server/sync/orchestrator.ts
  • npm run build
  • npm run service:reload
  • browser checked http://spent.localhost:41234/settings/ai Gemini model dropdown alignment

alon710 and others added 4 commits May 27, 2026 13:53
Adds Google Gemini alongside Claude and Ollama for transaction
categorization. Uses @google/genai with gemini-2.5-flash and stores
the API key encrypted under provider-specific setting keys so it can
coexist with a Claude key. Wires the new option through the setup
wizard, settings page, factory, and i18n.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- always require a key on save and drop the leave-blank-to-keep-stored UX,
  removing the hasStoredKey helper, hasClaudeApiKey/hasGeminiApiKey flags,
  and the i18n hint pair this required
- extract shared parseCategorizationResponse used by ClaudeProvider and
  GeminiProvider
- merge ClaudeConfig and GeminiConfig in the setup wizard into a single
  ApiKeyConfig with a children slot for provider-specific extras
- dispatch friendlyAIError on the provider argument instead of cascading
  regex matches over raw error text
- drop redundant Gemini model whitelist checks in the factory and settings
  writer

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant