Skip to content

Define custom models in json rather than the database schema#1752

Merged
chrarnoldus merged 7 commits intomainfrom
christiaan/cllm2
Mar 31, 2026
Merged

Define custom models in json rather than the database schema#1752
chrarnoldus merged 7 commits intomainfrom
christiaan/cllm2

Conversation

@chrarnoldus
Copy link
Copy Markdown
Contributor

@chrarnoldus chrarnoldus commented Mar 30, 2026

because database migrations are a pain

@chrarnoldus chrarnoldus self-assigned this Mar 30, 2026
kilo-code-bot bot and others added 5 commits March 30, 2026 21:03
Migrate all queries and type references from the old custom_llm table
to custom_llm2, which stores model configuration in a single JSON
definition column. Add missing fields (provider, force_reasoning,
interleaved_format) to CustomLlmDefinitionSchema and introduce
parseCustomLlm2Row helper to parse the JSON definition.
…omLlm

Query custom_llm2 (jsonb) and use definition fields directly instead of
mapping to the old CustomLlm type. Remove parseCustomLlm2Row helper and
revert additions of provider/force_reasoning/interleaved_format to
CustomLlmDefinitionSchema. Leave grokCodeFastOptimizedRequest untouched.
@chrarnoldus chrarnoldus changed the title Add schema custom_llm2 Define custom models in json rather than the database schema Mar 31, 2026
@chrarnoldus chrarnoldus marked this pull request as ready for review March 31, 2026 14:14
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot bot commented Mar 31, 2026

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 1
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

CRITICAL

File Line Issue
packages/db/src/migrations/0066_ambitious_jean_grey.sql 1 Existing custom_llm rows are never backfilled into custom_llm2, so current custom models disappear after deploy.

WARNING

File Line Issue
src/lib/providers/index.ts 128 Every custom model now advertises all API kinds, which can route unsupported request shapes to Anthropic/OpenAI backends.
Other Observations (not in diff)

N/A

Files Reviewed (5 files)
  • packages/db/src/migrations/0066_ambitious_jean_grey.sql - 1 issue
  • packages/db/src/schema-types.ts - 0 issues
  • packages/db/src/schema.ts - 0 issues
  • src/lib/custom-llm/listAvailableCustomLlms.ts - 0 issues
  • src/lib/providers/index.ts - 1 issue

@chrarnoldus chrarnoldus merged commit f62e151 into main Mar 31, 2026
28 checks passed
@chrarnoldus chrarnoldus deleted the christiaan/cllm2 branch March 31, 2026 14:29
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