{"skill":{"slug":"task-complexity-router","displayName":"AI Task Router Auto-Route Prompts by Complexity (Local/Cloud)","summary":"Regex-based routing sends simple tasks to local AI, medium to mid-tier, complex to premium — saving 60%+ on API costs.","description":"---\nname: \"AI Task Router — Auto-Route Prompts by Complexity (Local/Cloud)\"\ndescription: \"Regex-based routing sends simple tasks to local AI, medium to mid-tier, complex to premium — saving 60%+ on API costs.\"\nauthor: \"@TheShadowRose\"\nversion: \"1.0.0\"\ntags: [\"task-routing\", \"cost-optimization\", \"complexity-detection\", \"ollama\", \"auto-routing\", \"smart-dispatch\"]\nlicense: \"MIT\"\n---\n\n# AI Task Router — Auto-Route Prompts by Complexity (Local/Cloud)\n\nRegex-based routing sends simple tasks to local AI, medium to mid-tier, complex to premium — saving 60%+ on API costs.\n\n---\n\nAutomatically routes prompts to the cheapest model that can handle them.\n\n## How It Works\n\nPattern matching classifies tasks into tiers:\n\n| Task Type | Example | Routed To | Cost |\n|-----------|---------|-----------|------|\n| Simple | \"hi\", \"thanks\", \"what time is it\" | Local (Ollama) | $0 |\n| Moderate | \"write an email\", \"analyze this\" | Mid-tier (Sonnet) | $ |\n| Complex | \"debug this codebase\", \"write a chapter\" | Premium (Opus) | $$$ |\n\n## Usage\n\n```javascript\nconst { TaskRouter } = require('./src/task-router');\n\nconst router = new TaskRouter({\n  defaultModel: 'local',\n  escalationModel: 'sonnet',\n  heavyModel: 'opus'\n});\n\nconst result = router.route('analyze the sales data from Q3');\n// { model: 'sonnet', reason: 'Analysis task', confidence: 0.8 }\n```\n\n## Custom Rules\n\nAdd your own routing patterns:\n\n```javascript\nrouter.addRule({\n  name: 'code-review',\n  pattern: /\\b(review|refactor|debug|optimize)\\b.*\\b(code|function|class)\\b/i,\n  model: 'opus',\n  reason: 'Code review needs deep reasoning'\n});\n```\n\n## Cost Savings\n\nTypical usage pattern routes ~70% of tasks to free local models, ~25% to mid-tier, and ~5% to premium. With Opus at $15/M tokens vs Ollama at $0, this saves 60-80% on API costs.\n---\n\n## ⚠️ Disclaimer\n\nThis software is provided \"AS IS\", without warranty of any kind, express or implied.\n\n**USE AT YOUR OWN RISK.**\n\n- The author(s) are NOT liable for any damages, losses, or consequences arising from \n  the use or misuse of this software — including but not limited to financial loss, \n  data loss, security breaches, business interruption, or any indirect/consequential damages.\n- This software does NOT constitute financial, legal, trading, or professional advice.\n- Users are solely responsible for evaluating whether this software is suitable for \n  their use case, environment, and risk tolerance.\n- No guarantee is made regarding accuracy, reliability, completeness, or fitness \n  for any particular purpose.\n- The author(s) are not responsible for how third parties use, modify, or distribute \n  this software after purchase.\n\nBy downloading, installing, or using this software, you acknowledge that you have read \nthis disclaimer and agree to use the software entirely at your own risk.\n\n\n**DATA DISCLAIMER:** This software processes and stores data locally on your system. \nThe author(s) are not responsible for data loss, corruption, or unauthorized access \nresulting from software bugs, system failures, or user error. Always maintain \nindependent backups of important data. This software does not transmit data externally \nunless explicitly configured by the user.\n\n---\n\n## Support & Links\n\n| | |\n|---|---|\n| 🐛 **Bug Reports** | TheShadowyRose@proton.me |\n| ☕ **Ko-fi** | [ko-fi.com/theshadowrose](https://ko-fi.com/theshadowrose) |\n| 🛒 **Gumroad** | [shadowyrose.gumroad.com](https://shadowyrose.gumroad.com) |\n| 🐦 **Twitter** | [@TheShadowyRose](https://twitter.com/TheShadowyRose) |\n| 🐙 **GitHub** | [github.com/TheShadowRose](https://github.com/TheShadowRose) |\n| 🧠 **PromptBase** | [promptbase.com/profile/shadowrose](https://promptbase.com/profile/shadowrose) |\n\n*Built with [OpenClaw](https://github.com/openclaw/openclaw) — thank you for making this possible.*\n\n---\n\n🛠️ **Need something custom?** Custom OpenClaw agents & skills starting at $500. If you can describe it, I can build it. → [Hire me on Fiverr](https://www.fiverr.com/s/jjmlZ0v)","topics":["Auto Routing","Complexity Detection","Cost Optimization","Ollama","Smart Dispatch"],"tags":{"auto-routing":"1.0.0","complexity-detection":"1.0.0","cost-optimization":"1.0.0","latest":"1.0.0","ollama":"1.0.0","smart-dispatch":"1.0.0","task-routing":"1.0.0"},"stats":{"comments":0,"downloads":864,"installsAllTime":32,"installsCurrent":5,"stars":0,"versions":1},"createdAt":1773275409895,"updatedAt":1778491839794},"latestVersion":{"version":"1.0.0","createdAt":1773275409895,"changelog":"Initial upload","license":"MIT-0"},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"theshadowrose","userId":"s1736mx5m1zt9qzh6fvzvffnhh83hgf8","displayName":"Shadow Rose","image":"https://avatars.githubusercontent.com/u/262919821?v=4"},"moderation":null}