model-switch

Switch the agent's primary model at runtime by patching gateway config.

3|Updated Jul 17, 2024
One-click install
npx skills add https://github.com/Castrozan/.dotfiles --skill model-switch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-switch
Source: https://github.com/Castrozan/.dotfiles/tree/main/agents/skills/model-switch
Command: npx skills add https://github.com/Castrozan/.dotfiles --skill model-switch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill switches the agent's primary model at runtime by patching the gateway config and letting the gateway auto-restart. Use it when a user requests a model change or when a different model is better suited for the workload.

Core Features & Use Cases

  • Alias resolution: Map user-friendly model names (aliases) to full model IDs.
  • Config patching: Update the gateway configuration to switch the primary model.
  • Auto-restart and confirmation: Let the gateway restart automatically and confirm the change to the user.
  • Use case: A user asks to switch from opus to kimi to reduce latency or cost.

Quick Start

Use the model-switch skill to change the active model, e.g., "switch to kimi" or "use opus".

Frequently Asked Questions about model-switch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I switch the agent's primary AI model at runtime?

To switch the agent's primary AI model at runtime, the skill patches the gateway configuration with the new model ID and lets the gateway auto-restart to apply the change. It then confirms the successful model switch to the user.

Can I use model aliases like kimi or opus instead of full model IDs?

Yes, you can use model aliases like kimi or opus instead of full model IDs. The skill automatically resolves user-friendly model aliases to their corresponding full model IDs before patching the gateway configuration.

When do I need to patch the gateway config to change models?

You need to patch the gateway config to change models when a user explicitly requests a model switch or when the system detects a better-suited model for the current workload, such as switching to reduce latency or cost.

Does the gateway restart automatically after a model config patch?

Yes, the gateway restarts automatically after applying a model config patch. The skill handles the gateway config patch and relies on this auto-restart mechanism to seamlessly activate the newly selected primary model.

What is the best way to update the gateway configuration for a new AI model?

The best way to update the gateway configuration for a new AI model is to use a dedicated model-switch skill that maps aliases to full IDs, patches the config, and triggers an automatic gateway restart to confirm the change.

Why switch the active model during a runtime workload?

Switching the active model during a runtime workload allows you to optimize for changing requirements, such as reducing latency or lowering costs by moving from a heavy model like opus to a lighter one like kimi.