Skip to content

feat: support custom Gemini-compatible base URL#96

Open
ObesityChow wants to merge 1 commit intoringhyacinth:masterfrom
ObesityChow:feat/custom-gemini-base-url
Open

feat: support custom Gemini-compatible base URL#96
ObesityChow wants to merge 1 commit intoringhyacinth:masterfrom
ObesityChow:feat/custom-gemini-base-url

Conversation

@ObesityChow
Copy link
Copy Markdown

What

Add support for a custom Gemini-compatible base URL.

Why

Right now Star Office UI assumes the default Gemini endpoint.
This makes it possible to use a Gemini-compatible proxy / gateway / custom nano-banana endpoint instead.

Included

  • GEMINI_BASE_URL support in config/env
  • pass-through to the image generation script
  • google-genai client uses custom base_url when set
  • simple UI field in API settings to save/edit the endpoint

Notes

  • default behavior is unchanged if GEMINI_BASE_URL is empty
  • this is for Gemini-compatible endpoints only
  • does not add OpenAI-compatible endpoint support

Allows users to point the image-generation pipeline at any Gemini-compatible
API gateway or proxy (e.g. a self-hosted nano-banana endpoint) via the
GEMINI_BASE_URL environment variable or runtime-config.json field.

Changes:
- backend/store_utils.py: load/persist gemini_base_url from env + JSON
- backend/app.py: pass base_url env var to generation subprocess;
  expose it in GET /config/gemini; accept it in POST /config/gemini
- scripts/gemini_image_generate.py: initialise genai.Client with
  http_options=types.HttpOptions(base_url=…) when GEMINI_BASE_URL is set
- runtime-config.sample.json: add gemini_base_url sample key
- .env.example: add GEMINI_BASE_URL comment entry
- frontend/index.html + electron-standalone.html: add base-URL input
  field in the API settings panel; wire it through save/load paths;
  display current endpoint in status line (CN/EN/JA translations added)
- README.md / README.en.md: document the new env var and config option
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