The LLMTokens model holds token counts for a single LLM call.

Properties

PropertyTypeDescription
completion_tokensnumberTokens generated by the model
prompt_tokensnumberTokens from the user prompt
total_tokensnumberSum of prompt and completion tokens

Example

Python
from xpander_sdk import LLMTokens

usage = LLMTokens(completion_tokens=123, prompt_tokens=45)
print(usage.total_tokens)

See the xpander-sdk docs for full property details.