Skip to content

feat(cli): add models overrides subcommand - #7990

Merged
houko merged 3 commits into
librefang:mainfrom
DaBlitzStein:feat/models-overrides
Aug 30, 2026
Merged

houko merged 3 commits into
librefang:mainfrom
DaBlitzStein:feat/models-overrides

Conversation

@DaBlitzStein

Copy link
Copy Markdown
Contributor

Summary

  • Adds librefang models overrides <model> CLI subcommand to view, set, and clear per-model inference parameter overrides (context_window, max_output_tokens)
  • The API routes already exist (GET/PUT/DELETE /api/models/overrides/{id}) — this PR adds the missing CLI surface
  • Full i18n coverage across all 4 locales (en, ko, uk, zh-CN)

Verification

  • cargo check -p librefang-cli passes

@github-actions github-actions Bot added the size/M 50-249 lines changed label Aug 29, 2026

@houko houko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Merging — the command is wired into main.rs, the three routes it calls exist in routes/providers.rs, and the i18n gates are updated.
Two non-blocking notes for whenever you next touch this file.

--clear silently discards a value set in the same invocation.
librefang models overrides gpt-4o --clear --context-window 131072 returns after the DELETE and never sends the PUT, so the operator gets "Overrides cleared" and a context window that is not what they just typed.
#[arg(long, conflicts_with_all = ["context_window", "max_output_tokens"])] on clear turns that into a clap error at parse time.

The set path is a read-modify-write against the daemon: GET, mutate the object in memory, PUT the whole thing back.
Two concurrent models overrides calls, or one racing a dashboard edit, will have the later PUT overwrite the earlier one's field rather than merge with it.
Given how this is used interactively that is unlikely to bite, but if the route grows a PATCH it is the better verb here.

@houko
houko merged commit e1cb8ca into librefang:main Aug 30, 2026
42 checks passed
@DaBlitzStein
DaBlitzStein deleted the feat/models-overrides branch September 11, 2026 08:11
@houko houko mentioned this pull request Sep 13, 2026
@DaBlitzStein
DaBlitzStein restored the feat/models-overrides branch September 16, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M 50-249 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants