Attribute model spend to each Tapas user in llm-serving-pack metering

Aperta
#90 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, kubernetes

Direzione di ricerca

Read the Tapas model endpoint that enforces dailyTokensPerUser and the agent token broker, then check nebari-dev/llm-serving-pack#313 for the trusted service identity format. Trace how the Keycloak sub reaches the upstream model call and how OpenMeter and the usage console identify users. Done means each call is attributed to the calling user's sub; the issue does not name a test or specific file.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

On an internal demo cluster, Tapas's coding agents reach their model through llm-serving-pack's external endpoint with a single API key in ai.apiKeySecret. llm-serving-pack meters usage in OpenMeter and prices it in dollars, but it attributes every request to the key's creator, so all agent spend lands on one person instead of the user whose agent made the call.

Tapas already knows the user on every call through its model endpoint (it enforces dailyTokensPerUser there), so it is the component that can pass that identity on.

What we need

  • Tapas sends the end user's identity with each upstream model call, in whatever form llm-serving-pack accepts for a trusted service (nebari-dev/llm-serving-pack#313).
  • Or, if we go the token route, Tapas calls the internal endpoint with a token exchanged for the user (the agent token broker may already have most of this).
  • Either way, the user identifier must match what OpenMeter and the usage console use (the Keycloak sub).
Lingua principale
Go
Stelle
5
Fork
0
Merge medio
21h 13m
PR unite (30g)
53

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nebari-dev/tapas

Tutte le issue di nebari-dev/tapas

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.