Fosowl/agenticSeek · error · Exception

Google Gemini is not available for local use. Change config.

Error message

Google Gemini is not available for local use. Change config.ini

What it means

google_fn() refuses to call the Google Gemini API when the provider was configured with a local/self-hosted server (is_local=True). Google's Gemini API is a hosted-only service, so the library deliberately blocks the call because a local server cannot serve the Gemini OpenAI-compatible endpoint. The message tells the user to fix config.ini.

Source

Thrown at sources/llm_provider.py:289

                messages=messages,
                system=system_message
            )
            if response is None:
                raise Exception("Anthropic response is empty.")
            thought = response.content[0].text
            if verbose:
                print(thought)
            return thought
        except Exception as e:
            raise Exception(f"Anthropic API error: {str(e)}") from e

    def google_fn(self, history, verbose=False):
        """
        Use google gemini to generate text.
        """
        base_url = self.server_ip
        if self.is_local:
            raise Exception("Google Gemini is not available for local use. Change config.ini")

        client = OpenAI(api_key=self.api_key, base_url="https://generativelanguage.googleapis.com/v1beta/openai/")
        try:
            response = client.chat.completions.create(
                model=self.model,
                messages=history,
            )
            if response is None:
                raise Exception("Google response is empty.")
            thought = response.choices[0].message.content
            if verbose:
                print(thought)
            return thought
        except Exception as e:
            raise Exception(f"GOOGLE API error: {str(e)}") from e

    def together_fn(self, history, verbose=False):
        """

View on GitHub (pinned to ae57a23577)

Solutions

  1. Edit config.ini to use the hosted Google provider: remove the local server_ip (e.g. localhost/127.0.0.1) from the google section so is_local is False
  2. Set a valid Google API key (self.api_key) in the google provider section
  3. Switch the provider/model in config.ini to a locally-hosted one (e.g. ollama) if you intended to run locally

Example fix

// before (config.ini)
[google]
server_ip = http://localhost:11434
// after
[google]
api_key = YOUR_GOOGLE_API_KEY
Defensive patterns

Strategy: validation

Validate before calling

if provider == "google" and is_local:
    raise RuntimeError("Google Gemini requires the hosted API; remove server_ip/local settings from config.ini")

Try / catch

try:
    thought = provider.google_fn(history)
except Exception as e:
    logger.error("Gemini unavailable locally: %s", e)
    thought = fallback_provider_fn(history)

Prevention

When it happens

Trigger: Calling google_fn() (directly or via a dispatch by model/provider name) while self.is_local is True — i.e. config.ini specified a local server_ip/local provider for the Google provider.

Common situations: User set the wrong provider section in config.ini (local LLM server like Ollama but provider google), copied a local config from another project, or is_local detection picked up server_ip=localhost/127.0.0.1 for the google entry.

Related errors


AI-assisted analysis of Fosowl/agenticSeek@ae57a23577 (2026-08-30). Data as JSON: /api/errors/b1ff0211f34e94c1. Report an issue: GitHub.