LogSpanModelContent
Content type for standard LLM inference spans. All fields are optional.Overview
LogSpanModelContent captures the input, output, and metadata of an LLM model call. It is wrapped in a LogSpanContent union via the actual_instance pattern. For the best observability experience, pass the raw provider request as input and the full provider response as output — Adaline will automatically extract cost, token usage, and model metadata.
Fields
Must be
"Model" when provided.The provider name (e.g.,
"openai", "anthropic"). 1–512 characters.The model identifier (e.g.,
"gpt-4o", "claude-sonnet-4-20250514"). 1–512 characters.The input payload as a JSON string. Must be valid, parseable JSON (the result of
json.dumps()).The output payload as a JSON string. Must be valid, parseable JSON (the result of
json.dumps()).Variable associated with this span for evaluation tracking. See LogSpanVariable.
Cost of inference in USD. Overrides the automatic cost calculated by Adaline. Minimum: 0.
Construction Pattern
All span content is wrapped in LogSpanContent using theactual_instance parameter:
input and output Best Practices
Both input and output must be valid JSON strings. For Model spans, you get the most out of Adaline when you pass the exact request payload as input and the full provider response as output. This enables Adaline to automatically:
- Calculate cost from token counts and model pricing
- Extract token usage (prompt, completion, and total tokens)
- Surface metadata such as stop reason and tool calls
- Power continuous evaluations with structured I/O
Examples
- OpenAI
- Anthropic