mirror of
https://github.com/FJurmanovic/sugarr.git
synced 2026-11-10 23:31:08 +00:00
LangfuseTracer was passing our internal camelCase usage fields (promptTokens/completionTokens/totalTokens) straight through as usageDetails. Langfuse only recognizes a flat schema (input/output/...) or OpenAI's native snake_case schema (prompt_tokens/completion_tokens/ total_tokens) for usage/cost calculation - anything else is silently ignored, so every generation was showing zero usage regardless of what LlmClient actually reported. Note: cost still requires a price-list entry for the model name. Langfuse's built-in list only covers hosted providers (OpenAI, Anthropic, Google); self-hosted models (e.g. LLM_MODEL=llama3 via Ollama) need a custom model price added in Project Settings > Models for a $ figure to show up, even with token counts now correct. Verified: full suite (80/80) passing, tsc/eslint clean.