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

Discussion 595 cost cents default #607

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

Conversation

stephan-buckmaster
Copy link
Contributor

This change adds defaults for language_models.input_token_cost_cents and output_token_cost_cents, and also adds those fields to the UI for Language Models.

stephan-buckmaster and others added 30 commits April 16, 2024 06:44
…crypted_data setting and use update! instead of update in tests
@krschacht
Copy link
Contributor

Good catch about the UI not allowing save!

One thing I was undecided on was if we should actually support nil. My preliminary thinking was: $0 means the tokens are free, which is appropriate for local models, and should be reflected in the interface when it shows you the cost of a conversation as $0. But nil means the token cost is unknown so this too could be reflected in the interface. In this case it shouldn’t show $0, instead it should show no information or maybe we have it explicitly show “unknown.”

@stephan-buckmaster
Copy link
Contributor Author

stephan-buckmaster commented Jan 26, 2025 via email

@krschacht
Copy link
Contributor

Rather than adding another state tracker, I think it's reasonable for us to just use "nil" to indicate that state. Because it may be that this LLM doesn't support cost tracking, or maybe it does but someone just hasn't bothered to put the $ figure into the settings yet. We can actually be agnostic as to which of those situations we're in, we can just assume "nil" means we won't do any cost math — we won't assume $0.

@stephan-buckmaster
Copy link
Contributor Author

stephan-buckmaster commented Jan 27, 2025 via email

@krschacht
Copy link
Contributor

What if we just keep: (a) adding the fields to the form, (b) updating the permit to include these fields — but remove the migration and remove the validation. So basically, we'll just revert to the short-circuit (return if assistant.language_model.output_token_cost_cents.blank?)

I think that might cover us. I didn't test this to be certain, but when those token costs are nil does the app just gracefully handle it? Hopefully no costs appear anywhere for that language model.

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.

2 participants