Awee

inference:estimate

Estimates the token count and cost for a prompt without running the model

Estimates the token count and cost for a prompt without running the model

Options

NameTypeDescription
promptstringThe prompt string or template file path
prompt_varsmap[string]anyVariables injected into the prompt template
expectstringThe expected output format (e.g. "text")
expect_typestringThe expected output Go type (e.g. "string")
providerstringThe inference provider (e.g. "ollama", "openai")
modelstringThe model identifier (e.g. "mistral:latest", "gpt-4")
temperaturefloat32The model temperature setting
top_pfloat32The model top_p setting
max_tokensintThe maximum number of output tokens to request
currencystringThe currency code for cost conversion (e.g. "EUR", "USD")

Outputs

NameTypeDescription
promptstringThe fully rendered prompt string
modelstringThe model used for the estimate
providerstringThe inference provider used
tokens_inputintEstimated number of input tokens
cost_input_usdstringEstimated input cost in USD
cost_input_convertedstringEstimated input cost in the requested currency

How is this guide?

On this page