Local control plane for zhou-ee/lite_api_server.
This app runs on your local machine. It is not required for serving API traffic. After configuration is pushed to the server, you can close this UI and lite_api_server will continue routing requests and writing logs.
This repository is the on-demand Control Plane. It should manage configuration, imports, diagnostics, logs and route previews while the server remains the always-on Data Plane.
Implemented local-control capabilities:
- Vite + React local dashboard
- refined compact dashboard styling
- gateway health check
- today request/token/cost stats
- provider/model aggregate stats
- config diagnostics panel
- provider editor and healthcheck action
- provider-level model pricing override UI
- provider schema support for Google account token metadata
- standalone Google account helper module for server authorization endpoints
- alias editor
- route editor
- route preview panel
- route strategy display in recent request logs
- full config JSON import/export editor
- ccswitch/general JSON importer
- Claude Code-like JSON importer
- Codex-like JSON importer
- OpenCode-like JSON importer
- Gemini CLI-like JSON importer
- import preview before saving
- automatic route creation from imported provider models
- recent request logs
Local UI
↓ Admin API
lite_api_server
↓ provider routing
OpenAI-compatible upstream providers / Gemini providers
The UI is a control plane only. It does not store request logs itself.
The local app has been compared against the planned reference set:
- CC Switch: client config import/switching patterns
- Claude Code Router: coding-agent route preview and gateway UX
- Antigravity Manager: desktop-style React UI and account-management UX
- LiteLLM: gateway dashboard and spend visibility
- New API / One API: provider management, logs and usage views
See docs/CONTROL_PLANE_AUDIT.md for the detailed local-side audit and remaining gaps.
cp .env.example .env.local
npm install
npm run devConfigure the server URL and management token in .env.local using the keys from .env.example.
The server currently exposes neutral Google account routes:
GET /admin/google/start
POST /admin/google/exchange
GET /google/callback
The frontend has schema support and a helper module for those endpoints. A full ProviderEditor button/panel component was attempted but blocked by connector safety checks. Add this UI locally or in very small isolated commits.
Intended UI flow:
- Pick provider kind
gemini. - Click a Google account link button.
- Open the returned authorization URL.
- Either complete callback or paste the returned authorization code manually.
- Refresh the dashboard and confirm the generated provider appears.
- Start
lite_api_serverfirst. - Start this UI with
npm run dev. - Confirm Gateway Status loads.
- Check Config Diagnostics and fix errors.
- Check Provider Stats and Model Stats.
- Use Provider Editor -> Check on at least one provider.
- Use Route Editor to choose a strategy:
priority_fallbackweightedround_robinweighted_randomlowest_latencycheapest
- Use Route Preview to confirm expected provider order.
- Import a sample JSON config and review the import preview before saving.
- Send a request through the server and confirm Recent Requests updates.
- Confirm Recent Requests displays route strategy.
- Close this UI, send another request, reopen the UI and confirm logs are still present.
- For Google account flow, verify the server env values are set and test the helper endpoints manually until the ProviderEditor UI is completed.
See also:
docs/SMOKE_TEST.mddocs/ROUTING_UI.mddocs/IMPORTERS.mddocs/REFERENCE_MAP.mddocs/CONTROL_PLANE_AUDIT.md
Importers normalize common client-style JSON into the server config. When an imported provider declares models, the UI now creates route entries automatically:
- missing model route -> create
priority_fallbackroute - existing model route -> append provider when missing
The import panel shows a preview before saving:
- provider IDs
- aliases
- model route plan
- parser notes
Before considering a UI change usable:
npm install
npm run buildManual checks:
- diagnostics panel loads
- provider editor can save a provider
- alias editor can save an alias
- route editor can save all supported strategies
- route preview updates after route changes
- import preview appears before saving
- full config JSON editor can round-trip current config
- provider-level pricing fields survive save/reload
- recent request logs show route strategy
- Browser-only Vite cannot safely read/write arbitrary local tool config files.
- Exact file-path import/export for Claude Code, Codex, OpenCode and Gemini CLI needs a desktop shell.
- Tauri initialization was attempted through the connector, but connector safety checks blocked the manifest/package changes. Retry locally or as smaller isolated commits.
- Route preview is local and approximate for
round_robinandweighted_random; the server is the source of truth for actual request ordering. - Google account helper exists, but the polished ProviderEditor button/panel UI still needs to be added locally or through smaller commits.
- Diagnostics still need severity grouping and a request detail drawer.
- Run
npm install && npm run buildand fix TypeScript/build errors. - Add ProviderEditor Google account status block.
- Add Google account link button in a separate small commit.
- Add manual authorization-code exchange UI in a separate small commit.
- Add request detail drawer for logs.
- Add grouped diagnostics by severity/component.
- Initialize Tauri locally and add safe config backup/read/write commands.