u/EffectivePizza3909

Built a Docker image that emulates Gemini + OpenAI APIs locally with Gemma 3, for testing without API keys

I built Localaik to solve a problem I kept hitting: writing tests for code that calls LLM APIs, but not wanting to burn quota or maintain mocks that drift from real API shapes.

Localaik is a single Docker container that exposes both Gemini (v1beta) and OpenAI (v1) endpoints on port 8090, backed by Gemma 3 (4B or 12B). Point your client at localhost:8090, it speaks the right API, returns real model outputs. No keys, no internet, deterministic outputs for snapshot testing.

Use cases I built it for:

  • CI/CD: tests that call LLM code without paying for tokens or flaking on network
  • Local dev: develop offline, swap to real API at deploy time
  • Air-gapped: works in environments where outbound API calls are blocked

Variants:

  • v0.2.1-gemma3-4b (3GB image)
  • v0.2.1-gemma3-12b (7.3GB image)

GitHub: https://github.com/harshaneel/localaik

Docker: https://hub.docker.com/r/gokhalh/localaik

MIT licensed. Would love feedback on what API surfaces to add next (Anthropic is on my list). Also curious what you'd want for streaming / function calling support.

reddit.com
u/EffectivePizza3909 — 3 days ago