Discover Packages
github.com/envoyproxy/ai-gateway
internal
llmcostcel
package
Version:
v0.6.0
Opens a new window with list of versions in this module.
Published: May 5, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package llmcostcel provides functions to create and evaluate CEL programs to calculate costs.
This exists as a separate package to be used both in the controller to validate the expression
and in the external processor to evaluate the expression.
func EvaluateProgram(prog cel .Program , modelName, backend, routeName string , inputTokens, cachedInputTokens, cacheCreationInputTokens, outputTokens, totalTokens, reasoningTokens uint32 ) (uint64 , error )
EvaluateProgram evaluates the given CEL program with the given variables.
NewProgram creates a new CEL program from the given expression.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.