Skip to content

feat(db): add optional pricing field to CustomLlmDefinitionSchema#1920

Open
kilo-code-bot[bot] wants to merge 2 commits intomainfrom
feat/custom-llm-pricing
Open

feat(db): add optional pricing field to CustomLlmDefinitionSchema#1920
kilo-code-bot[bot] wants to merge 2 commits intomainfrom
feat/custom-llm-pricing

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot bot commented Apr 2, 2026

Summary

  • Adds an optional pricing field to CustomLlmDefinitionSchema in packages/db/src/schema-types.ts
  • Introduces CustomLlmPricingSchema with prompt, completion, and optional input_cache_read / input_cache_write string fields — all in dollars per token, matching the OpenRouter pricing convention (e.g. "0.000001" = $1 per million tokens)
  • Updates convert() in listAvailableCustomLlms.ts to use the stored pricing values when present, falling back to '0.0000000' when not set
  • input_cache_write is also now surfaced in the converted OpenRouter model shape (it was previously absent)

Verification

  • Reviewed changes manually; schema and conversion logic are consistent with the existing OpenRouter pricing patterns
  • Full typecheck could not be run in this environment (tsgo not found)

Visual Changes

N/A

Reviewer Notes

All price fields follow the OpenRouter convention of decimal strings (dollars per token, not microdollars). The fallback '0.0000000' preserves existing behaviour for models without pricing defined.

@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot bot commented Apr 2, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/db/src/schema-types.ts
  • src/lib/custom-llm/listAvailableCustomLlms.ts

Reviewed by gpt-5.4-20260305 · 267,063 tokens

@chrarnoldus
Copy link
Copy Markdown
Contributor

my hope is evals will then show cost

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.

1 participant