Price a request from plain values instead of the plugin request context
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Read core/cost/settle/settle.go and core/cost/settle/avoided.go, then inspect core/plugins/inferenceparser/cost.go for the current callers. Add table tests for plain Input pricing, LiteLLM cost headers, and Comparable discount and margin checks. Done means Settle and Comparable accept plain values, their context forms wrap them, and existing cost tests pass unchanged.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Part of #1437 (assessment: laptop data plane on Praxis) · prep work, useful to Cortex on its own
Status: there is no shipped Cortex–Praxis integration today (the paused
cmd/cortex-praxisconverter is not one), and the interim path is not decided (LLM traffic to praxis-ai as an inference server, or all traffic through Praxis via #1491). Nothing here depends on that choice: each item is useful to Cortex now, and would make a possible move to Praxis easier whichever path is taken.
Problem
Pricing a request needs the whole plugin request context.
settle.Settle(pctx, rates)readspctx.Host,pctx.Extensions.Inferenceandpctx.ResponseHeaders(LiteLLM cost headers, andContent-TypeviaIsEventStream);pctx.Pathonly in log lines.Avoidedreadspctx.Extensions.Custom(tool-prune's record), the request body andBodyMutated().Publishwrites the result back intopctxunder two keys;Storekeeps it in pipeline state, which litellm-budget-track reads withLoadand rewrites withAmend.
Eight exported functions take *pipeline.Context: Settle, Avoided, IsEventStream, Comparable, Store, Load, Publish, Amend.
Settle is called only from inside the inference-parser plugin (cost.go:72-112), which also calls Store, Avoided and IsEventStream; litellm-budget-track calls Comparable, Load and Amend. So pricing can run only inside Cortex's Go pipeline: not from a recorded event, not in a test without building a pctx, not from another proxy.
Proposal
This issue owns settle's input. #1497 item 3 owns recording the cost-relevant headers on the event, and #1503 depends on this one.
Settle(in Input, rates) SettledwithInput{Host, Inference, ResponseHeaders}.IsEventStreamis derived fromResponseHeaders;Pathis only for logging and can be passed separately or dropped.Comparable(in Input)the same way.Avoidedkeeps apctxform for now: it needs tool-prune's record, the forwarded body andBodyMutated(), none of which belong in a pricing input.Store,Load,PublishandAmendare how plugins exchange the result; they stay onpctx(their serialization is #1499 item 4).- Keep
Settle(pctx, rates)as a thin wrapper over the new form, so existing callers and tests don't change. No behaviour change. - Where the wrapper lives (the inference-parser plugin, or a separate cost step) is decided in #1503.
Done when
SettleandComparablehave plain-value forms, and thepctxversions are wrappers over them.- A table test prices from plain
Inputvalues, including the LiteLLM cost-header cases and theComparablechecks on the discount and margin headers. (Gateway multipliers are on the rates side,pricing/multiplier.go, and are unaffected.) - Existing cost tests pass unchanged (about 43 test calls use
Settle(pctx, …)).
Evidence read at main @ e455a04 (2026-10-25); not built.
- Lenguaje dominante
- Go
- Estrellas
- 21
- Forks
- 43
- Merge medio
- 14 h 25 min
- PR fusionados (30 d)
- 245
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rossoctl/cortex
-
aiac enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
rossoctl/cortex#1546 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
UI shows costs for all sessions even when drilled into a sessionPosiblemente ocupada @esnible la tomó hace 15 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
rossoctl/cortex#1116 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
bug laptop
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
Los mantenedores suelen responder en 1 día
-
bug: Copied listener and parser code has drifted (hop-by-hop response headers, SSE BOM/CR handling)Abiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
Todos los issues de rossoctl/cortex
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Project submission: BivyAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
slavakurilyak/awesome-ai-agents#880 ·
Los mantenedores suelen responder en 1 día
-
后缀带有LTX的番号无法自动匹配Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
metatube-community/metatube-sdk-go#387 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/openserverless#282 · 2 comentarios ·