{"id":51061159,"url":"https://github.com/saturncloud/phoebe","last_synced_at":"2026-06-23T02:01:54.599Z","repository":{"id":362571220,"uuid":"1259769773","full_name":"saturncloud/phoebe","owner":"saturncloud","description":"An obervability / billing layer for LLMs","archived":false,"fork":false,"pushed_at":"2026-06-15T14:18:51.000Z","size":525,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-15T15:25:08.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saturncloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-04T20:56:25.000Z","updated_at":"2026-06-15T13:48:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/saturncloud/phoebe","commit_stats":null,"previous_names":["saturncloud/phoebe"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/saturncloud/phoebe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saturncloud%2Fphoebe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saturncloud%2Fphoebe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saturncloud%2Fphoebe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saturncloud%2Fphoebe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saturncloud","download_url":"https://codeload.github.com/saturncloud/phoebe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saturncloud%2Fphoebe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34672250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-23T02:01:53.550Z","updated_at":"2026-06-23T02:01:54.586Z","avatar_url":"https://github.com/saturncloud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phoebe\n\nPhoebe is the **token-metering interceptor** for Saturn Cloud's token factory.\nIt is a thin, tenant-aware reverse proxy that sits behind Traefik and in front\nof the (optional) inference router / vLLM engine:\n\n```\nTraefik → atlas-auth (ForwardAuth) → Phoebe → [vLLM prod router | llm-d] → vLLM / SGLang / TensorRT-LLM\n```\n\nPhoebe is the always-present capture point for **token metering and billing**.\nIt does **not** authenticate or authorize — that happens at the edge — it\ntrusts the identity headers atlas-auth injects.\n\n## What it does\n\n- **Identity (read, don't re-auth).** Reads the trusted `X-Saturn-User-Id`,\n  `X-Saturn-Group-Id`, `X-Saturn-Resource-Id`, `X-Saturn-Resource-Type`\n  headers. See `internal/identity`.\n- **Per-model dispatch.** Resolves the target model from `X-Saturn-Resource-Id`\n  to an upstream URL, with no redeploy needed for new models and a clean\n  404/410 for torn-down ones. See `internal/registry`.\n- **Token metering capture.** Captures token counts from the engine's own\n  `usage` block (the authority — never re-tokenizes), forces\n  `stream_options.include_usage=true`, and emits one immutable, idempotent\n  metering event per request keyed by `request_id`. See `internal/metering`.\n- **Streaming correctness.** Forward-then-inspect SSE: streams each chunk to\n  the client immediately, captures the trailing usage chunk, handles client\n  aborts. See `internal/proxy`.\n\nIt is **topology-independent**: it behaves identically whether the upstream is\nan engine directly (Shape A) or a router (Shape B), and acts as the stable\ncontract that makes everything below it swappable.\n\n## What it deliberately does NOT do\n\n- Authentication / authorization (edge, via atlas-auth).\n- Cache-aware routing across replicas (the inference router's job).\n- Format translation (the engines already serve OpenAI shapes).\n\n## Layout\n\n```\ncmd/interceptor/    main entrypoint\ninternal/config/    YAML settings (defaults → unmarshal → parse)\ninternal/identity/  trusted X-Saturn-* header extraction\ninternal/logging/   leveled logger\ninternal/metering/  billing event schema + Emitter contract\ninternal/proxy/     the reverse-proxy core (streaming tee, dispatch)\ninternal/registry/  model → upstream resolution\nconfig/             example settings\n```\n\n## Local dev\n\n```sh\nmake test    # go test ./...\nmake vet     # go vet ./...\nmake run     # build + run against config/settings.example.yaml\nmake build   # build to bin/phoebe\n```\n\n## Status\n\nWalking skeleton: identity → registry → upstream dispatch and the server\nlifecycle are wired and tested. The SSE forward-then-inspect tee, the\n`include_usage` forcing, client-abort handling, and the durable metering\nemitter (Kafka / Redis Streams) are stubbed with `TODO(milestone-...)` markers\nin `internal/proxy` and `internal/metering`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaturncloud%2Fphoebe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaturncloud%2Fphoebe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaturncloud%2Fphoebe/lists"}