Simple local token tracking for Pipelines
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 20/100
Línea de trabajo
Comienza experimentando con los tracers compatibles existentes que permiten la ejecución local y, después, compara su comportamiento con el patrón de LangfuseConnector y la integración de tracing de Haystack-Datadog. El issue no identifica archivos ni tests, y los criterios de finalización siguen siendo exploratorios: determina si un enfoque local y ligero de seguimiento de tokens encaja en Pipelines sin persistencia, visualización ni estimación de costes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Idea
Discussing with Robin, it turned out that it could be useful to have a simple component/utility
to make tokens usage visible and organized.
While tracers provide this, they typically require either sending data to an external service
or running a local backend (e.g., Docker).
Ideal features
- track token usage per component in a Pipeline and per model name
- local execution
- no backend or lightweight one
- integrate naturally with Pipelines (not a component that must be explicitly connected to many others)
Non-goals: persistence, visualization, cost estimation
Possible design
This could follow a pattern similar to LangfuseConnector and others.
(might be hard to implement or go against the framework design)
pipe = Pipeline()
pipe.add_component("token_tracker", TokenTracker())
pipe.add_component("prompt_builder", ChatPromptBuilder())
pipe.add_component("llm", OpenAIChatGenerator())
pipe.connect("prompt_builder.prompt", "llm.messages")
messages = [ChatMessage.from_user("Tell me about {{location}}")]
response = pipe.run(
data={
"prompt_builder": {
"template_variables": {"location": "Berlin"},
"tmpelate": messages,
},
},
)
print(response["token_tracker"])
# info on token usage
An alternative approach would be closer to a tracer (like Haystack-Datadog integration), but this would probably need
some kind of backend. Still, it could be useful to explore this direction.
Future work
If this feature is relevant, a good first step would be to experiment with existing supported tracers (those that allow execution). They may already satisfy most of the requirements, or at least provide an inspiration for a lightweight solution.
@deep-rloebbert feel free to jump in: corrections, details, and examples are welcome.
👋 Hello there! This issue will be handled internally and isn't open for external contributions. If you'd like to contribute, please take a look at issues labeled contributions welcome or good first issue. We'd really appreciate it!
- Lenguaje dominante
- Python
- Estrellas
- 27.2k
- Forks
- 3.5k
- Merge medio
- 1 d 18 h
- PR fusionados (30 d)
- 254
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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 deepset-ai/haystack
-
feat: `ByteStream.from_file_path` should keep the file path in `meta`Posiblemente ocupada @pinjun99 la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
deepset-ai/haystack#14081 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
BlockingConfirmationStrategy ignores an empty argument replacementPosiblemente ocupada @sjrl la tomó hace 6 días. AbiertoP1
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
deepset-ai/haystack#13863 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
CSVToDocument row mode fails on CR-separated CSV inputPosiblemente ocupada @julian-risch la tomó hace 66 días. AbiertoP3
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
deepset-ai/haystack#13022 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
CSVToDocument row mode drops a real extra_columns field on ragged rowsQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertohandled internally P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
deepset-ai/haystack#12994 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
CSVDocumentCleaner deletes a row that says N/A, and both CSV components empty those cellsPosiblemente ocupada @michaelkillgta la tomó hace 72 días. AbiertoP3
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
deepset-ai/haystack#12784 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de deepset-ai/haystack
Issues similares
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertogood first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
omarelshamy25x/shamy-hijri#63 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
polish
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresPosiblemente ocupada @AshutoshSingh840 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
UKGovernmentBEIS/control-arena#992 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Los mantenedores suelen responder en 1 día