Repository navigation
feat(llm): set profile prices in the settings dialog - #541
Open
Phantom-IN wants to merge 1 commit into
Open
Phantom-IN wants to merge 1 commit into
Phantom-IN wants to merge 1 commit into
Conversation
The cost ledger (BaaRai#70) stores four prices per profile and the usage API turns them into cost_eur, but the UI never got the follow-up: the profile list did not return the prices and the dialog had no inputs for them. That also made prices fragile. SaveProfile always rewrites the price columns, and the dialog's save payload had no price fields, so editing a profile in the UI reset prices set through the API to zero. Return the prices in LLMProfileDTO, add the four inputs to the dialog and send them on save. A negative price is stored as unset.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the UI follow-up #70 mentions ("the dashboard card line and the profile-dialog price inputs"), the dialog half of it.
The four price columns and
cost_euron the usage API already exist, but there was no way to set prices from the UI, and the profile list didn't return them. There was also a bug:SaveProfilealways rewrites the price columns, and the dialog's save payload had no price fields. So if you set prices through the API and then edited the profile in the UI (say, changed the rate limit), the prices went back to 0.Changes:
LLMProfileDTOreturns the four prices.pgSaveProfiletreats a negative price as unset, likemax_tokens.trandzh-CN.The dashboard cost line can come in a separate PR.
TestProfilePricesThroughAPIsaves a profile through the handler and checks the list returns the prices, with a negative one stored as 0.go test ./server/passes against Postgres 16, apart from the two tests that fail on my Mac on main too.tsc --noEmitandnpm run test:i18npass, and biome reports nothing new.