/llm-router
This skill should be used when users want to route LLM requests to different AI providers (OpenAI, Grok/xAI, Groq, DeepSeek, OpenRouter) using SwiftOpenAI-CLI. Use this skill when users ask to "use grok", "ask grok", "use groq", "ask deepseek", or any similar request to query a
$ npx -y skills add jamesrochabrun/skills --skill llm-router --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/llm-router
Context preview
The summary Claude sees to decide when to auto-load this skill.
This skill should be used when users want to route LLM requests to different AI providers (OpenAI, Grok/xAI, Groq, DeepSeek, OpenRouter) using SwiftOpenAI-CLI. Use this skill when users ask to "use grok", "ask grok", "use groq", "ask deepseek", or any similar request to query a
SKILL.md
llm-router.SKILL.mdname: llm-router
description: This skill should be used when users want to route LLM requests to different AI providers (OpenAI, Grok/xAI, Groq, DeepSeek, OpenRouter) using SwiftOpenAI-CLI. Use this skill when users ask to "use grok", "ask grok", "use groq", "ask deepseek", or any similar request to query a specific LLM provider in agent mode.
LLM Router
Overview
Route AI requests to different LLM providers using SwiftOpenAI-CLI's agent mode. This skill automatically configures the CLI to use the requested provider (OpenAI, Grok, Groq, DeepSeek, or OpenRouter), ensures the tool is installed and up-to-date, and executes one-shot agentic tasks.
Core Workflow
When a user requests to use a specific LLM provider (e.g., "use grok to explain quantum computing"), follow this workflow:
Step 1: Ensure SwiftOpenAI-CLI is Ready
Check if SwiftOpenAI-CLI is installed and up-to-date:
scripts/check_install_cli.sh
This script will:
- Check if `swiftopenai` is installed
- Verify the version (minimum 1.4.4)
- Install or update if necessary
- Report the current installation status
Step 2: Configure the Provider
Based on the user's request, identify the target provider and configure SwiftOpenAI-CLI:
scripts/configure_provider.sh <provider> [model]
**Supported providers:**
- `openai` - OpenAI (GPT-4, GPT-5, etc.)
- `grok` - xAI Grok models
- `groq` - Groq (Llama, Mixtral, etc.)
- `deepseek` - DeepSeek models
- `openrouter` - OpenRouter (300+ models)
**Examples:**
# Configure for Grok
scripts/configure_provider.sh grok grok-4-0709
# Configure for Groq with Llama
scripts/configure_provider.sh groq llama-3.3-70b-versatile
# Configure for DeepSeek Reasoner
scripts/configure_provider.sh deepseek deepseek-reasoner
# Configure for OpenAI GPT-5
scripts/configure_provider.sh openai gpt-5
The script automatically:
- Sets the provider configuration
- Sets the appropriate base URL
- Sets the default model
- Provides guidance on API key configuration
Step 3: Verify API Key
The configuration script automatically checks if an API key is set and will **stop with clear instructions** if no API key is found.
**If API key is missing:**
The script exits with error code 1 and displays:
- ⚠️ Warning that API key is not set
- Instructions for setting via environment variable
- Instructions for setting via config (persistent)
**Do not proceed to Step 4 if the configuration script fails due to missing API key.**
Instead, inform the user they need to set their API key first:
**Option 1 - Environment variable (session only):**
export XAI_API_KEY=xai-... # for Grok
export GROQ_API_KEY=gsk_... # for Groq
export DEEPSEEK_API_KEY=sk-... # for DeepSeek
export OPENROUTER_API_KEY=sk-or-... # for OpenRouter
export OPENAI_API_KEY=sk-... # for OpenAI
**Option 2 - Config file (persistent):**
swiftopenai config set api-key <api-key-value>
After the user sets their API key, re-run the configuration script to verify.
Step 4: Execute the Agentic Task
Run the user's request using agent mode:
swiftopenai agent "<user's question or task>"
**Agent mode features:**
- One-shot task execution
- Built-in tool calling
- MCP (Model Context Protocol) integration support
- Conversation memory with session IDs
- Multiple output formats
**Examples:**
# Simple question
swiftopenai agent "What is quantum entanglement?"
# With specific model override
swiftopenai agent "Write a Python function" --model grok-3
# With session for conversation continuity
swiftopenai agent "Remember my name is Alice" --session-id chat-123
swiftopenai agent "What's my name?" --session-id chat-123
# With MCP tools (filesystem example)
swiftopenai agent "Read the README.md file" \
--mcp-servers filesystem \
--allowed-tools "mcp__filesystem__*"
Usage Patterns
Pattern 1: Simple Provider Routing
**User Request:** "Use grok to explain quantum computing"
**Execution:**
# 1. Check CLI installation
scripts/check_install_cli.sh
# 2. Configure for Grok
scripts/configure_provider.sh grok grok-4-0709
# 3. Execute the task
swiftopenai agent "Explain quantum computing"
Pattern 2: Specific Model Selection
**User Request:** "Ask DeepSeek Reasoner to solve this math problem step by step"
**Execution:**
# 1. Check CLI installation
scripts/check_install_cli.sh
# 2. Configure for DeepSeek with Reasoner model
scripts/configure_provider.sh deepseek deepseek-reasoner
# 3. Execute with explicit model
swiftopenai agent "Solve x^2 + 5x + 6 = 0 step by step" --model deepseek-reasoner
Pattern 3: Fast Inference with Groq
**User Request:** "Use groq to generate code quickly"
**Execution:**
# 1. Check CLI installation
scripts/check_install_cli.sh
# 2. Configure for Groq (known for fast inference)
scripts/configure_provider.sh groq llama-3.3-70b-versatile
# 3. Execute the task
swiftopenai agent "Write a function to calculate fibonacci numbers"
Pattern 4: Access Multiple Models via OpenRouter
**User Request:** "Use OpenRouter to access Claude"
**Execution:**
# 1. Check CLI installation
scripts/check_install_cli.sh
# 2. Configure for OpenRouter
scripts/configure_provider.sh openrouter anthropic/claude-3.5-sonnet
# 3. Execute with Claude via OpenRouter
swiftopenai agent "Explain the benefits of functional programming"
Provider-Specific Considerations
OpenAI (GPT-5 Models)
GPT-5 models support advanced parameters:
# Minimal reasoning for fast coding tasks
swiftopenai agent "Write a sort function" \
--model gpt-5 \
--reasoning minimal \
--verbose low
# High reasoning for complex problems
swiftopenai agent "Explain quantum mechanics" \
--model gpt-5 \
--reasoning high \
--verbose high
**Verbosity levels:** `low`, `medium`, `high` **Reasoning effort:** `minimal`, `low`, `medium`, `high`
Grok (xAI)
Grok models
Read more
name: llm-router description: This skill should be used when users want to route LLM requests to different AI providers (OpenAI, Grok/xAI, Groq, DeepSeek, OpenRouter) using SwiftOpenAI-CLI. Use this skill when users ask to "use grok", "ask grok", "use groq", "ask deepseek", or any similar request to query a specific LLM provider in agent mode.
LLM Router
Overview
Route AI requests to different LLM providers using SwiftOpenAI-CLI's agent mode. This skill automatically configures the CLI to use the requested provider (OpenAI, Grok, Groq, DeepSeek, or OpenRouter), ensures the tool is installed and up-to-date, and executes one-shot agentic tasks.
Core Workflow
When a user requests to use a specific LLM provider (e.g., "use grok to explain quantum computing"), follow this workflow:
Step 1: Ensure SwiftOpenAI-CLI is Ready
Check if SwiftOpenAI-CLI is installed and up-to-date:
scripts/check_install_cli.sh
This script will:
- Check if `swiftopenai` is installed
- Verify the version (minimum 1.4.4)
- Install or update if necessary
- Report the current installation status
Step 2: Configure the Provider
Based on the user's request, identify the target provider and configure SwiftOpenAI-CLI:
scripts/configure_provider.sh <provider> [model]
**Supported providers:**
- `openai` - OpenAI (GPT-4, GPT-5, etc.)
- `grok` - xAI Grok models
- `groq` - Groq (Llama, Mixtral, etc.)
- `deepseek` - DeepSeek models
- `openrouter` - OpenRouter (300+ models)
**Examples:**
# Configure for Grok scripts/configure_provider.sh grok grok-4-0709 # Configure for Groq with Llama scripts/configure_provider.sh groq llama-3.3-70b-versatile # Configure for DeepSeek Reasoner scripts/configure_provider.sh deepseek deepseek-reasoner # Configure for OpenAI GPT-5 scripts/configure_provider.sh openai gpt-5
The script automatically:
- Sets the provider configuration
- Sets the appropriate base URL
- Sets the default model
- Provides guidance on API key configuration
Step 3: Verify API Key
The configuration script automatically checks if an API key is set and will **stop with clear instructions** if no API key is found.
**If API key is missing:**
The script exits with error code 1 and displays:
- ⚠️ Warning that API key is not set
- Instructions for setting via environment variable
- Instructions for setting via config (persistent)
**Do not proceed to Step 4 if the configuration script fails due to missing API key.**
Instead, inform the user they need to set their API key first:
**Option 1 - Environment variable (session only):**
export XAI_API_KEY=xai-... # for Grok export GROQ_API_KEY=gsk_... # for Groq export DEEPSEEK_API_KEY=sk-... # for DeepSeek export OPENROUTER_API_KEY=sk-or-... # for OpenRouter export OPENAI_API_KEY=sk-... # for OpenAI
**Option 2 - Config file (persistent):**
swiftopenai config set api-key <api-key-value>
After the user sets their API key, re-run the configuration script to verify.
Step 4: Execute the Agentic Task
Run the user's request using agent mode:
swiftopenai agent "<user's question or task>"
**Agent mode features:**
- One-shot task execution
- Built-in tool calling
- MCP (Model Context Protocol) integration support
- Conversation memory with session IDs
- Multiple output formats
**Examples:**
# Simple question swiftopenai agent "What is quantum entanglement?" # With specific model override swiftopenai agent "Write a Python function" --model grok-3 # With session for conversation continuity swiftopenai agent "Remember my name is Alice" --session-id chat-123 swiftopenai agent "What's my name?" --session-id chat-123 # With MCP tools (filesystem example) swiftopenai agent "Read the README.md file" \ --mcp-servers filesystem \ --allowed-tools "mcp__filesystem__*"
Usage Patterns
Pattern 1: Simple Provider Routing
**User Request:** "Use grok to explain quantum computing"
**Execution:**
# 1. Check CLI installation scripts/check_install_cli.sh # 2. Configure for Grok scripts/configure_provider.sh grok grok-4-0709 # 3. Execute the task swiftopenai agent "Explain quantum computing"
Pattern 2: Specific Model Selection
**User Request:** "Ask DeepSeek Reasoner to solve this math problem step by step"
**Execution:**
# 1. Check CLI installation scripts/check_install_cli.sh # 2. Configure for DeepSeek with Reasoner model scripts/configure_provider.sh deepseek deepseek-reasoner # 3. Execute with explicit model swiftopenai agent "Solve x^2 + 5x + 6 = 0 step by step" --model deepseek-reasoner
Pattern 3: Fast Inference with Groq
**User Request:** "Use groq to generate code quickly"
**Execution:**
# 1. Check CLI installation scripts/check_install_cli.sh # 2. Configure for Groq (known for fast inference) scripts/configure_provider.sh groq llama-3.3-70b-versatile # 3. Execute the task swiftopenai agent "Write a function to calculate fibonacci numbers"
Pattern 4: Access Multiple Models via OpenRouter
**User Request:** "Use OpenRouter to access Claude"
**Execution:**
# 1. Check CLI installation scripts/check_install_cli.sh # 2. Configure for OpenRouter scripts/configure_provider.sh openrouter anthropic/claude-3.5-sonnet # 3. Execute with Claude via OpenRouter swiftopenai agent "Explain the benefits of functional programming"
Provider-Specific Considerations
OpenAI (GPT-5 Models)
GPT-5 models support advanced parameters:
# Minimal reasoning for fast coding tasks swiftopenai agent "Write a sort function" \ --model gpt-5 \ --reasoning minimal \ --verbose low # High reasoning for complex problems swiftopenai agent "Explain quantum mechanics" \ --model gpt-5 \ --reasoning high \ --verbose high
**Verbosity levels:** `low`, `medium`, `high` **Reasoning effort:** `minimal`, `low`, `medium`, `high`
Grok (xAI)
Grok models
A comprehensive plugin and marketplace for Claude Code containing 24 custom skills across engineering, Apple development, product management, design, content, trading, database, QA, educational, and AI architecture domains.
Repo: jamesrochabrun/skills
Other skills on jamesrochabrun-skills.
- /anthropic-architect
Determine the best Anthropic architecture for your project by analyzing requirements and recommending the optimal combination of Skills, Agents, Prompts, and SDK primitives.
Open skill - /anthropic-prompt-engineer
Master Anthropic's prompt engineering techniques to generate new prompts or improve existing ones using best practices for Claude AI models.
Open skill - /apple-hig-designer
Design iOS apps following Apple's Human Interface Guidelines. Generate native components, validate designs, and ensure accessibility compliance for iPhone, iPad, and Apple Watch.
Open skill - /book-illustrator
Expert children's book illustrator guide with 2024-2025 best practices, focusing on age-appropriate styles, color theory, character design, and visual storytelling for kids books that captivate young readers.
Open skill - /content-brief-generator
Generate comprehensive content briefs for writers, ensuring clarity, alignment, and strategic content creation across all formats.
Open skill - /design-brief-generator
Generate comprehensive design briefs for design projects. Use this skill when designers ask to "create a design brief", "structure a design project", "define design requirements", or need help planning design work.
Open skill

