Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implements CEL expression API for costs #153

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

mathetake
Copy link
Member

@mathetake mathetake commented Jan 21, 2025

This commit implements the CEL expression API
left as a TODO in #103. Closes #97.

Signed-off-by: Takeshi Yoneda <[email protected]>
@mathetake mathetake marked this pull request as ready for review January 21, 2025 17:29
@mathetake mathetake requested a review from a team as a code owner January 21, 2025 17:29
@mathetake
Copy link
Member Author

@yuzisun PTAL

Signed-off-by: Takeshi Yoneda <[email protected]>
Makefile Outdated Show resolved Hide resolved
Comment on lines -28 to +30
ModelNameHeaderKey, selectedBackendHeaderKey string
modelNameHeaderKey, selectedBackendHeaderKey string
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: shouldn't have been exported

Makefile Outdated Show resolved Hide resolved
p.costs.TotalTokens,
)
if err != nil {
return nil, fmt.Errorf("failed to evaluate CEL expression: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what does it mean for ext_proc to fail at this stage, when the response headers may have been sent? Does it make sense to make it fail?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will result in connection termination i guess

Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow customizing token cost calculation
2 participants