Skip to content

refactor: decouple model capabilities from static ModelInfo registry#144

Merged
MaleicAcid merged 1 commit into
zh-plus:masterfrom
iautolab:refactor/decouple-model-capabilities
May 22, 2026
Merged

refactor: decouple model capabilities from static ModelInfo registry#144
MaleicAcid merged 1 commit into
zh-plus:masterfrom
iautolab:refactor/decouple-model-capabilities

Conversation

@MaleicAcid

Copy link
Copy Markdown
Collaborator

Ref #143

- Remove max_tokens/context_window from ModelInfo (registry is now pricing-only)
- Add these fields as optional overrides on ModelConfig
- Rewrite _compute_max_tokens to return int|None: None means don't send
  max_tokens to API (server decides); when set, respects user cap and
  context-window constraints
- Store model_config on bot instance instead of copying fields into model_info
- Add OUTPUT_RATIO and _estimate_output_tokens for output budget estimation
- Add min_tokens chain (caller estimate -> _compute_max_tokens -> API)
- Handle LengthExceedException in LeanTranslator retry paths
- Update ContextReviewerAgent to read context_window from model_config
- Fix LiteLLM base_url passthrough in create_chatbot
- Update tests accordingly
@MaleicAcid MaleicAcid merged commit 7e96bd3 into zh-plus:master May 22, 2026
11 checks passed
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