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 specific LLM provider in agent mode.
What this skill does
# 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: ```bash 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: ```bash 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:** ```bash # 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):** ```bash 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):** ```bash 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: ```bash 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:** ```bash # 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:** ```bash # 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:** ```bash # 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:** ```bash # 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:** ```bash # 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: ```bash # 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 are optimized for real-time information and coding: - `grok-4-0709` - Latest with enhanced reasoning - `grok-3` - General purpose - `grok-code-fast-1` - Optimized for code generation ### Groq Known for ultra-fast inference with open-source models: - `llama-3.3-70b-versatile` - Best general purpose - `mixtral-8x7b-32768` - Mixture of experts ### DeepSeek Specialized in reasoning and coding: - `deepseek-reasoner` - Advanced step-by-step reasoning - `deepseek-coder` - Coding specialist - `deepseek-chat` - General chat ### OpenRouter Provides access to 300+ models: - Anthropic Claude models - OpenAI models - Google Gemini models - Meta Llama models - And many more ## API Key Management ### Recommended: Use Environment Variables for Multiple Providers The **best practice** for using multiple providers is to set all API keys as environment variables. This allows seamless switching between providers without reconfiguring keys. **Add to your shell profile** (`~/.zshrc` or `~/.bashrc`): ```bash # 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-... ``` After adding these, reload your shell: ```bash source ~/.zshrc # or source ~/.bashrc ``` **How it works:** - SwiftOpenAI-CLI automatically uses the **correct provider-specific key** based on the configured provider - When you switch to Grok, it uses `XAI_API_KEY` - When you switch to OpenAI, it uses `OPENAI_API_KEY` - No need to reconfigure keys each time ### Alternative: Single API Key via Config (Not Recommended for Multiple Providers) If you only use **one provider**, you can store the key in the config file: ```bash swiftopenai config set api-key <your-key> ``` **Limitation:** The config file only stores ONE api-key. If you switch providers, you'd need to reconfigure the key each time. ### Checking Current API Key ```bash # View current configuration (API key is masked) swiftopenai config list # Get specific API key setting swiftopenai config get api-key ``` **Priority:** Provider-specific environment variables take precedence over config file settings. ## Advanced Features ### Interactive Configuration For complex setups, use the interactive wizard: ```bash swiftopenai config setup ``` This launches a guided se
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.