# Google Gemini

This document explains how to configure Google Gemini as the LLM provider for yCrash AI chat.

Note

After you create ycbuddy-config.json, place it in the upload directory and restart yCrash as described in the Introduction.

Gemini is the recommended walkthrough for most teams.


# Step 1: Get Your Gemini API Key

Think of an API key as a password that lets yCrash talk to Google's AI on your behalf. You create it once in Google's portal and paste it into your yCrash configuration file.

# Open Google AI Studio

  1. In a web browser, go to Google AI Studio (opens new window)
  2. Sign in with your Google account (work or personal, depending on your organization's policy)

Tip for IT / procurement teams:

Some organizations require a Google Cloud project with billing enabled instead of AI Studio. If your security team blocks AI Studio, ask them to provision a Gemini API key from Google Cloud Console under APIs & Services -> Credentials. The key format and usage in yCrash are the same.

# Create an API key

  1. In AI Studio, open Get API key (or API Keys in the left navigation)
  2. Click Create API key
  3. If prompted, select or create a Google Cloud project - this is a container Google uses for billing and access control
  4. Copy the key when it is displayed

The key typically:

  • Starts with AIza
  • Is a long string of letters, numbers, and symbols
  • Is shown only once - store it somewhere secure (password manager, secrets vault) before closing the dialog

# Enable billing (if required)

Google may require billing to be enabled on the project for production API usage. Free tiers and trial credits vary by Google's current policy - check AI Studio or Cloud Console for your account's limits.

# Treat the key like a password

Do Don't
Store the key in a secrets manager or restricted server directory Email or chat the key in plain text
Restrict file permissions on ycbuddy-config.json (e.g. readable only by the yCrash service account) Commit the key to Git or share it in tickets
Rotate the key if it is ever exposed Reuse the same key across unrelated environments without tracking

# Step 2: Add the Gemini Settings

Paste the following JSON into ycbuddy-config.json and replace your-gemini-api-key with the key you copied from Google:

{
  "llmProvider": "gemini",
  "llmApiKey": "your-gemini-api-key",
  "llmModelName": "gemini-2.5-flash",
  "llmEmbeddingModelName": "gemini-embedding-001"
}
1
2
3
4
5
6

# What each field means (in plain language)

Field What it is What to put
llmProvider Which AI company yCrash should call "gemini" for Google Gemini
llmApiKey Your secret key from Google The key from Step 1 (starts with AIza...)
llmModelName The "brain" that writes chat answers "gemini-2.5-flash" (recommended). This is the model that generates RCA explanations and answers follow-up questions.
llmEmbeddingModelName A helper model for finding relevant context "gemini-embedding-001". You rarely change this. It powers semantic search over yCrash guides and conversation context - not the visible chat text itself.

Note:

If any required field is missing or empty, yCrash disables AI and logs a configuration error at startup.

You can omit llmApiKey and set LLM_API_KEY on the yCrash process instead. All other fields are still required in the JSON file.


# Supported Gemini Chat Models

yCrash recognizes these Gemini model IDs (use the exact string in llmModelName):

Model ID Best for
gemini-2.5-flash Recommended - fast, capable, good default for production RCA chat
gemini-2.0-flash Fallback default in software if no model is specified
gemini-1.5-flash Older flash model; still supported
gemini-1.5-pro Higher capability, slower; use when analysis depth matters more than speed

If you specify an unknown model name, yCrash still runs but applies conservative token limits.


# Step 3: Place the File and Restart

Place ycbuddy-config.json in the yCrash upload directory and restart the server. See the Introduction for file location, restart, and verification steps.

# What success looks like in logs

Look for messages similar to:

  • Found ycbuddy-config.json in uploadDir - /path/to/uploads/ycbuddy-config.json
  • YCBuddy configuration loaded successfully.
  • Streaming Gemini Client initialized successfully
  • Gemini embedding service initialized successfully with model: gemini-embedding-001
  • yCrash Buddy guide loading process started successfully

# Optional Gemini Tuning

Most teams do not need these. Add them to ycbuddy-config.json only when directed by support or performance tuning.

{
  "llmProvider": "gemini",
  "llmApiKey": "your-gemini-api-key",
  "llmModelName": "gemini-2.5-flash",
  "llmEmbeddingModelName": "gemini-embedding-001",
  "geminiMinimizeThinking": true
}
1
2
3
4
5
6
7
Field Default Purpose
geminiMinimizeThinking true For Gemini 2.5 models, reduces internal "thinking" time so the first visible tokens arrive faster in chat

# Troubleshooting

Symptom Likely cause
Log: Unsupported LLM provider Typo in llmProvider (must be exactly gemini)
Chat opens but returns auth / 403 errors Invalid, expired, or revoked API key; or billing not enabled in Google
Log: Gemini client not initialized Empty or malformed API key

Also confirm:

  • llmProvider is "gemini" (lowercase)
  • API key is complete, not expired, and has Gemini API access in Google
  • Google Cloud project has billing enabled if Google requires it
  • Outbound HTTPS from the yCrash server to Google is allowed (generativelanguage.googleapis.com)

For shared file-placement and restart checks, see the Introduction troubleshooting checklist.