Skip to content

Conversation

@ahmedhesham6
Copy link
Collaborator

Summary

This PR implements RFC 007 for dynamic model switching with a unified type system. It replaces the AgentModel enum (Smart/Eco/Recovery tiers) with a unified Model struct that contains all model metadata.

Changes Made

New Unified Model Type (libs/ai/src/types/model.rs)

  • Model struct with fields: id, name, provider, reasoning, cost, limit
  • ModelCost for pricing info (input/output per 1M tokens, cache pricing)
  • ModelLimit for token limits (context window, max output)

Model Catalogs

  • Added model definitions for Anthropic (libs/ai/src/providers/anthropic/models.rs)
  • Added model definitions for OpenAI (libs/ai/src/providers/openai/models.rs)
  • Added model definitions for Gemini (libs/ai/src/providers/gemini/models.rs)

API Changes

  • AgentProvider trait methods now take Model instead of string/enum
  • Added find_model() helper to search model catalog by ID
  • Re-exported Model, ModelCost, ModelLimit from stakpak_api

TUI Updates

  • Model switcher now works with Model struct
  • Sidebar shows model name, provider, and token limits from Model
  • Removed model label under input (info now in sidebar)

CLI Changes

  • Removed --model CLI argument
  • Model determined from config via get_default_model()
  • Default model changed to Claude Opus 4.5

Cleanup

  • Removed AgentModel enum entirely
  • Removed ModelSet struct
  • Removed unused parse_model, detect_provider methods
  • Removed debug eprintln! statements

Testing

  • All code compiles without errors
  • No clippy warnings
  • Code is formatted

Breaking Changes

  • AgentModel enum removed - use Model struct instead
  • --model CLI argument removed - configure model in config file

- Add unified Model struct with id, name, provider, reasoning, cost, limit
- Remove AgentModel enum (Smart/Eco/Recovery tiers)
- Update TUI to use Model struct for model switching
- Add find_model() helper to search model catalog by ID
- Update sidebar to show model info from Model struct
- Remove --model CLI argument (model now from config)
- Add model catalogs for Anthropic, OpenAI, and Gemini providers
- Default model changed to Claude Opus 4.5
- Clean up unused code (ModelSet, parse_model, detect_provider)

This implements RFC 007 for dynamic model switching with a unified type system.
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