Documentation
¶
Overview ¶
Package llmstats provides a durable sink for per-call LLM metrics. It implements llm.StatsSink by appending one JSON record per call to a local JSONL file (.sdd/stats/llm.jsonl), so prompt-cache effectiveness and token usage become measurable over time without an external service (d-tac-zis).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSink ¶
type FileSink struct {
// contains filtered or unexported fields
}
FileSink appends one JSON record per LLM call to a JSONL file. Safe for concurrent use — batch operations record from multiple goroutines.
func NewFileSink ¶
NewFileSink returns a sink that appends to <dir>/llm.jsonl, creating dir if it does not exist.
func (*FileSink) RecordCall ¶
RecordCall appends one JSON line for the call. Errors are swallowed: stats collection is best-effort and must never break a capture or summarize.