What is inside
26 packages, 434 source files, 157,679 lines of Go under 3,015 race-enabled tests. This page is the source tree, not a feature list.
- 26
- Go packages
- 3,015
- tests, race-enabled
- 3
- direct dependencies
The path a request takes
Nothing in this sequence leaves your machine except the last step, and that step goes straight to the provider you connected.
- 01Your clientClaude Code, Codex, an SDK or curl, pointed at localhost with the internal key.
- 02Auth and muxThe internal key is checked. The management API is refused unless the caller is on loopback.
- 03DispatchThe model string resolves to a provider and a connection.
- 04TranslateThe request is converted into the provider’s native dialect, streams included.
- 05The providerSent with your credential for that provider, and with nothing else attached.
How it is tested
Breadth without tests is a list. The answer to "why only five providers" is what those five get that three hundred could not:
3,015 test functions, race detector on
Across 305 test files — table-driven, standard library only, run with -race so the concurrency paths are exercised rather than assumed.
The translator is pinned to golden fixtures
138 recorded cases in 13 files, generated from a reference implementation with the clock and randomness pinned — so a translation that drifts by one byte fails the suite, not a user.
Token refresh is single-flight
Ten concurrent requests against an expired token produce one refresh, not ten. The lock is per connection and is under test.
The database cannot deadlock itself
SQLite is deliberately held to a single writer, which converts a class of flaky "database is locked" failures into a design that cannot produce them.
Packages
Each description is the package’s own doc comment. A few have none and are described from the repository’s current-state map instead; those are marked.
- auth6 filesfrom the repo mapPKCE OAuth flows with a loopback callback server, and lazy token refresh.
- clitools17 filesToggles AI CLIs between their default provider connection and routing through ShareQuota. The cardinal rule: never destroy user configuration — back up before the first write, restore the exact original values on disable.
- config10 filesError classification, cooldown and backoff constants, and runtime knobs.
- connlock1 filesHolds the one mutex per connection that every token refresh in the process must take. There were three, and they did not know about each other — so a background sweep and a live request could refresh the same connection at the same moment, and a provider that rotates the refresh token on use would deactivate a credential that was good a second earlier.
- cost2 filesThe one place a request’s token buckets turn into dollars: the shared arithmetic and the shared provider-token-key mapping.
- dashauth8 filesThe dashboard authentication model — session, password, login limiter, OIDC.
- engine214 filesSelection, combos and fallback. Keeps a conversation on the account that already served it.
- httpapi68 filesShared plumbing for the HTTP route packages: the dependency bag handed to every route registration, the admin guard middleware, and the JSON helpers.
- httpwire3 filesHeader hygiene and body framing — what a relay needs on the wire between a client and an upstream provider.
- identity2 filesDerives the stable machine identifier and the machine-bound API-key format.
- mask4 filesRedacts credential material so it can appear in the dashboard, in logs and in error strings without leaking the secret it describes.
- mitm9 filesLocal HTTPS-interception plumbing for routing an IDE’s built-in AI features through ShareQuota instead of the vendor’s own backend.
- netaddr1 filesDerives the client address of an inbound HTTP request.
- oauth8 filesThe full-breadth OAuth subsystem: PKCE, provider helpers, the provider registry and the loopback callback servers.
- providers2 filesfrom the repo mapThe provider registry the running server reads — exactly five entries.
- proxy6 filesfrom the repo mapCore dispatch: resolve a model to a provider, translate, and copy the SSE stream back in the dialect the caller used.
- registry6 filesThe data-driven model registry. Provider definitions are not hand-written; they are dumped from source and embedded as JSON.
- server5 filesfrom the repo mapThe mux, the management handlers, and the two middlewares: proxy auth on the request path, loopback-only on the management API.
- sidecar4 filesSupervises the helper processes the binary can launch.
- sigcompat5 filesValidates and normalises model-issued reasoning-continuity signatures so a conversation can be replayed across providers without the upstream rejecting its own history.
- store20 filesfrom the repo mapSQLite: schema, connections, keys, settings, and the CLI config backups.
- translator8 filesfrom the repo mapAnthropic ↔ OpenAI ↔ Gemini, for requests, responses and SSE streams alike.
- tunnel4 filesPublishes the local server through a Cloudflare quick tunnel or a Tailscale Funnel, and supervises the child binaries that do it.
- updater2 filesSelf-update: checking a release manifest for a newer build, and replacing the running binary with a verified download.
- webui1 filesfrom the repo mapServes the dashboard bundle embedded in the binary, with an SPA fallback.
- winapi13 filesWindows-first helpers, with the same surface backed by native files and syscalls elsewhere so the build stays green on Linux and macOS.