Loading...
Loading...
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.
npx skill4agent add jamesrochabrun/skills llm-routerscripts/check_install_cli.shswiftopenaiscripts/configure_provider.sh <provider> [model]openaigrokgroqdeepseekopenrouter# 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-5export 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 OpenAIswiftopenai config set api-key <api-key-value>swiftopenai agent "<user's question or task>"# 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__*"# 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"# 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# 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"# 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"# 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 highlowmediumhighminimallowmediumhighgrok-4-0709grok-3grok-code-fast-1llama-3.3-70b-versatilemixtral-8x7b-32768deepseek-reasonerdeepseek-coderdeepseek-chat~/.zshrc~/.bashrc# API Keys for LLM Providers
export OPENAI_API_KEY=sk-...
export XAI_API_KEY=xai-...
export GROQ_API_KEY=gsk_...
export DEEPSEEK_API_KEY=sk-...
export OPENROUTER_API_KEY=sk-or-v1-...source ~/.zshrc # or source ~/.bashrcXAI_API_KEYOPENAI_API_KEYswiftopenai config set api-key <your-key># View current configuration (API key is masked)
swiftopenai config list
# Get specific API key setting
swiftopenai config get api-keyswiftopenai config setup# Start a session
swiftopenai agent "My project is a React app" --session-id project-123
# Continue the session
swiftopenai agent "What framework did I mention?" --session-id project-123# With GitHub MCP
swiftopenai agent "List my repos" \
--mcp-servers github \
--allowed-tools "mcp__github__*"
# With filesystem MCP
swiftopenai agent "Read package.json and explain dependencies" \
--mcp-servers filesystem \
--allowed-tools "mcp__filesystem__*"
# Multiple MCP servers
swiftopenai agent "Complex task" \
--mcp-servers github,filesystem,postgres \
--allowed-tools "mcp__*"# Plain text (default)
swiftopenai agent "Calculate 5 + 3" --output-format plain
# Structured JSON
swiftopenai agent "List 3 colors" --output-format json
# Streaming JSON events (Claude SDK style)
swiftopenai agent "Analyze data" --output-format stream-json# Check current config
swiftopenai config list
# Set the appropriate API key
swiftopenai config set api-key <your-key>
# Or use environment variable
export XAI_API_KEY=xai-... # for Grokreferences/providers.mdswiftopenai modelsswiftopenai config set debug truecheck_install_cli.shconfigure_provider.sh--session-idreferences/providers.md# User: "Use grok to tell me about recent AI developments"
scripts/check_install_cli.sh
scripts/configure_provider.sh grok grok-4-0709
swiftopenai agent "Tell me about recent AI developments"# User: "Ask deepseek to explain how to solve this algorithm problem"
scripts/check_install_cli.sh
scripts/configure_provider.sh deepseek deepseek-reasoner
swiftopenai agent "Explain step by step how to implement quicksort"# User: "Use groq to quickly generate a REST API"
scripts/check_install_cli.sh
scripts/configure_provider.sh groq llama-3.3-70b-versatile
swiftopenai agent "Generate a REST API with authentication in Python"# User: "Use openrouter to access claude and write documentation"
scripts/check_install_cli.sh
scripts/configure_provider.sh openrouter anthropic/claude-3.5-sonnet
swiftopenai agent "Write comprehensive documentation for a todo app API"# User: "Use gpt-5 with high reasoning to solve this complex problem"
scripts/check_install_cli.sh
scripts/configure_provider.sh openai gpt-5
swiftopenai agent "Design a distributed caching system" \
--model gpt-5 \
--reasoning high \
--verbose high