Skip to content

Gemini provider initialization fails due to provider name mismatch (geminiai vs google) #271

@TheBluCoder

Description

@TheBluCoder

Description

When running genlayer init and selecting Gemini as the LLM provider, the initialization fails with the following error:

Error: Requested providers '{'geminiai'}' do not match any stored providers. 
Please review your stored providers.

This prevents users from using Gemini as their LLM provider in GenLayer.

Root Cause

Provider name mismatch between CLI and backend:

  • CLI sends: geminiai
  • Database expects: google

The backend's llm_provider table (populated by database migrations) uses provider = 'google' for Gemini, but the CLI is configured to send geminiai.

Steps to Reproduce

  1. Install and set up genlayer-cli:

    npm install -g genlayer
  2. Run initialization:

    genlayer init --numValidators 3
  3. When prompted "Select which LLM providers do you want to use:", choose Gemini

  4. Enter a valid Gemini API key

  5. Error occurs during validator initialization:

    Initializing validators...
    Error:
    Error: Requested providers '{'geminiai'}' do not match any stored providers.
    

Expected Behavior

  • CLI should successfully create validators with Gemini provider
  • Gemini should work as an LLM provider option

Actual Behavior

  • Initialization fails immediately after provider selection
  • Error message indicates provider name mismatch

Environment

  • CLI Version: genlayer@0.32.8
  • Localnet Version: v0.65.0
  • Docker Images:
    • yeagerai/simulator-jsonrpc:v0.65.0
    • yeagerai/database-migration:v0.65.0
  • OS: Linux (Ubuntu 22.04)

Evidence

Database Query

-- From running postgres container
psql -U postgres -d genlayer_state -c "SELECT provider, model FROM llm_provider;"

 id | provider  |               model               
----+-----------+-----------------------------------
  1 | heuristai | mistralai/mixtral-8x22b-instruct
  2 | heuristai | meta-llama/llama-3.3-70b-instruct
  3 | anthropic | claude-3-7-sonnet-20250219
  4 | openai    | gpt-4o
  5 | google    | gemini-2.0-flash-lite-001         <-- Backend uses "google"

The backend database clearly uses google as the provider name for Gemini.

CLI Behavior

When selecting "Gemini" from the CLI prompt, it appears to send geminiai to the backend RPC endpoint (sim_createRandomValidators), which then fails validation against the database.

Proposed Solution

Update the CLI's provider name mapping from geminiai to google to match the backend's expected value.

Expected change location: Likely in src/commands/init.ts or similar provider configuration file.

// BEFORE
'Gemini': 'geminiai'

// AFTER
'Gemini': 'google'

Impact

  • Severity: High
  • Affected users: Anyone trying to use Gemini as their LLM provider
  • Workaround: None (must use OpenAI, Heurist, or other supported providers)

Related Components

  • genlayer-cli - Frontend (where the fix is needed)
  • genlayer-studio - Backend (already correctly configured with google)
  • Docker containers: simulator-jsonrpc, database-migration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions