[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699R3YK47F3AW59307YHAWA":3,"skill-same:01M699R3YK47F3AW59307YHAWA":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":46,"ownerHtmlUrl":47,"ownerBlogUrl":48,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M699R3YK47F3AW59307YHAWA","local-ai-agents",null,"Build local-first AI agents wey dey run fully for developer workstation wit Microsoft Foundry Local and Qwen function-calling models. E cover Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG wit Chroma, local MCP servers, hybrid cloud\u002Flocal routing, and di privacy\u002Fcost\u002Foffline trade-offs. E based on Lesson 17 of AI Agents for Beginners. USE FOR: run agent locally, offline agent, on-device agent, Foundry Local, Qwen function calling, local tool calling, local RAG, Chroma vector database, local MCP server, privacy-preserving agent, hybrid local and cloud agent, small language model agent, engineering assistant for my machine. DO NOT USE FOR: deploying agents to di cloud at scale (use deploying-scalable-agents \u002F Lesson 16), building your first agent concept (Lesson 01), Foundry (cloud) hosted agents, GPU cluster \u002F server-side inference provisioning.","microsoft\u002Fai-agents-for-beginners","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M6998ZK2275KMJE6Y5SEA2X2",79423,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fai-agents-for-beginners\u002Fblob\u002Fmain\u002Ftranslations\u002Fpcm\u002F.agents\u002Fskills\u002Flocal-ai-agents\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[27,28,29,30,31,32,9,33,34,35],"ai agents","local ai agents","MCP","assistant","inference","mcp server","foundry","foundry local","microsoft foundry","2026-11-10 10:12:30",false,"---\nname: local-ai-agents\nlicense: MIT\ndescription: 'Build local-first AI agents wey dey run fully for developer workstation\n  wit Microsoft Foundry Local and Qwen function-calling models. E cover Small Language\n  Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local\n  RAG wit Chroma, local MCP servers, hybrid cloud\u002Flocal routing, and di privacy\u002Fcost\u002Foffline\n  trade-offs. E based on Lesson 17 of AI Agents for Beginners. USE FOR: run agent\n  locally, offline agent, on-device agent, Foundry Local, Qwen function calling, local\n  tool calling, local RAG, Chroma vector database, local MCP server, privacy-preserving\n  agent, hybrid local and cloud agent, small language model agent, engineering assistant\n  for my machine. DO NOT USE FOR: deploying agents to di cloud at scale (use deploying-scalable-agents\n  \u002F Lesson 16), building your first agent concept (Lesson 01), Foundry (cloud) hosted\n  agents, GPU cluster \u002F server-side inference provisioning.'\n---\n# How to Create Local AI Agents wit Foundry Local and Qwen\n\n> Skill wey go help for [Lesson 17 – Creating Local AI Agents](..\u002F..\u002F..\u002F17-creating-local-ai-agents\u002FREADME.md).\n> Use am to help person wey dey learn build agent wey sabi reason, dey call tools, and dey search\n> documentation all na inside dem machine — no cloud inference. Make every\n> recommendation stand gidigba for lesson content and the runnable notebook.\n\n## Triggers\n\nActivate this skill when person wey dey learn want:\n- Run agent **fully inside device** for privacy, cost, or offline reasons.\n- Serve model locally with **Foundry Local** and connect via the OpenAI-compatible endpoint.\n- Use **Qwen function-calling** model to make local tool calls correct.\n- Add **local RAG** (Chroma) or **local MCP server**.\n- Design **hybrid** local\u002Fcloud routing way.\n\n## Core mental model\n\nSmall Language Model (SLM) dey trade wide knowledge for privacy, cost, and offline work. The best\nway: **make the SLM dey organize and make tools carry the heavy work.** The\nmodel no need to *know* the codebase — e need to know wen to call\n`read_file` and `search_docs`. Dis one dey play to SLM strength (small decisions\nlike tool choice) and avoid hin weakness (big knowledge, long multi-hop\nreasoning).\n\n## Why these specific pieces\n\n- **Foundry Local** get **OpenAI-compatible HTTP endpoint**, so cloud agent code fit transfer by just changing `base_url` (and using local fake API key). E also dey choose best build (CPU\u002FGPU\u002FNPU) for machine.\n- **Qwen** models get epp to call functions and always dey give correct tool calls — na dis one make local *chat* model become local *agent*.\n- **Chroma** dey run inside process and dey store vectors for disk, so all RAG work (embed → store → retrieve → reason) remains local.\n- **MCP** na transport, no be cloud service: MCP server fit run local with `stdio`.\n\n## Setup essentials\n\n```bash\nfoundry model run qwen2.5-7b-instruct\nfoundry service status\n```\n\n```python\nfrom foundry_local import FoundryLocalManager\nfrom openai import OpenAI\n\nmanager = FoundryLocalManager(\"qwen2.5-7b-instruct\")\nclient = OpenAI(base_url=manager.endpoint, api_key=manager.api_key)  # lokal plassholder\n```\n\nAbout 8 GB RAM na minimum wey make sense; GPU\u002FNPU fit help but dem no mandatory.\n\n## Key patterns wey you fit repeat\n\nShow the learner the notebook\n[`17-local-agent-foundry-local.ipynb`](..\u002F..\u002F..\u002F17-creating-local-ai-agents\u002Fcode_samples\u002F17-local-agent-foundry-local.ipynb):\n\n- **Sandboxed tools**: every file tool dey resolve paths and no allow anything wey dey outside one project root — even if na local, tool dey run wit user permissions.\n- **Tool-calling loop**: register tools with OpenAI tools schema, run requested tools locally, give the results back, keep am up till final answer.\n- **Local RAG**: put docs inside Chroma collection; `search_docs` go return top-k chunks.\n- **Local MCP**: connect to local server thru `stdio`; scope am to project directory and check outputs well.\n\n## Hybrid routing (local as one of the models)\n\n| Situation | Where e dey run |\n|-----------|---------------|\n| Sensitive data \u002F offline | Local SLM |\n| Simple, bounded task | Local SLM (cheap, fast) |\n| Hard multi-hop reasoning on non-sensitive data | Cloud model |\n| Cloud outage | Local SLM (graceful degradation) |\n\nDis one dey mirror di model-routing idea from Lesson 16, with workstation as one\nof di routes. Make you like designs wey fit fall back to local so agent go degrade in\nquality, no be just fail completely.\n\n## Guardrails for the assistant\n\n- Keep every file\u002Ftool work confined to sandboxed project directory.\n- No send code or data go cloud when the learner talk say na privacy\u002Foffline e wan — keep everything local.\n- Set correct expectations for SLM quality; rely on tools and RAG, no be the model memorized knowledge.\n- Note say Lesson 17 no get **Foundry Responses** endpoint, so cloud smoke-test ka no go work — make sure by running notebook local.\n\n---\n\n\u003C!-- CO-OP TRANSLATOR DISCLAIMER START -->\n**Disclaimer**:\nDis document don translate wit AI translation service [Co-op Translator](https:\u002F\u002Fgithub.com\u002FAzure\u002Fco-op-translator). Even tho we dey try make am correct, abeg make you know say automated translation fit get errors or mistakes. Di original document for dia own language na im be di correct source. For important info, make person wey sabi human translation do am. We no go responsible for any misunderstanding or wrong understanding wey fit happen because of dis translation.\n\u003C!-- CO-OP TRANSLATOR DISCLAIMER END -->","# How to Create Local AI Agents wit Foundry Local and Qwen\n\n> Skill wey go help for [Lesson 17 – Creating Local AI Agents](..\u002F..\u002F..\u002F17-creating-local-ai-agents\u002FREADME.md).\n> Use am to help person wey dey learn build agent wey sabi reason, dey call tools, and dey search\n> documentation all na inside dem machine — no cloud inference. Make every\n> recommendation stand gidigba for lesson content and the runnable notebook.\n\n## Triggers\n\nActivate this skill when person wey dey learn want:\n- Run agent **fully inside device** for privacy, cost, or offline reasons.\n- Serve model locally with **Foundry Local** and connect via the OpenAI-compatible endpoint.\n- Use **Qwen function-calling** model to make local tool calls correct.\n- Add **local RAG** (Chroma) or **local MCP server**.\n- Design **hybrid** local\u002Fcloud routing way.\n\n## Core mental model\n\nSmall Language Model (SLM) dey trade wide knowledge for privacy, cost, and offline work. The best\nway: **make the SLM dey organize and make tools carry the heavy work.** The\nmodel no need to *know* the codebase — e need to know wen to call\n`read_file` and `search_docs`. Dis one dey play to SLM strength (small decisions\nlike tool choice) and avoid hin weakness (big knowledge, long multi-hop\nreasoning).\n\n## Why these specific pieces\n\n- **Foundry Local** get **OpenAI-compatible HTTP endpoint**, so cloud agent code fit transfer by just changing `base_url` (and using local fake API key). E also dey choose best build (CPU\u002FGPU\u002FNPU) for machine.\n- **Qwen** models get epp to call functions and always dey give correct tool calls — na dis one make local *chat* model become local *agent*.\n- **Chroma** dey run inside process and dey store vectors for disk, so all RAG work (embed → store → retrieve → reason) remains local.\n- **MCP** na transport, no be cloud service: MCP server fit run local with `stdio`.\n\n## Setup essentials\n\n```bash\nfoundry model run qwen2.5-7b-instruct\nfoundry service status\n```\n\n```python\nfrom foundry_local import FoundryLocalManager\nfrom openai import OpenAI\n\nmanager = FoundryLocalManager(\"qwen2.5-7b-instruct\")\nclient = OpenAI(base_url=manager.endpoint, api_key=manager.api_key)  # lokal plassholder\n```\n\nAbout 8 GB RAM na minimum wey make sense; GPU\u002FNPU fit help but dem no mandatory.\n\n## Key patterns wey you fit repeat\n\nShow the learner the notebook\n[`17-local-agent-foundry-local.ipynb`](..\u002F..\u002F..\u002F17-creating-local-ai-agents\u002Fcode_samples\u002F17-local-agent-foundry-local.ipynb):\n\n- **Sandboxed tools**: every file tool dey resolve paths and no allow anything wey dey outside one project root — even if na local, tool dey run wit user permissions.\n- **Tool-calling loop**: register tools with OpenAI tools schema, run requested tools locally, give the results back, keep am up till final answer.\n- **Local RAG**: put docs inside Chroma collection; `search_docs` go return top-k chunks.\n- **Local MCP**: connect to local server thru `stdio`; scope am to project directory and check outputs well.\n\n## Hybrid routing (local as one of the models)\n\n| Situation | Where e dey run |\n|-----------|---------------|\n| Sensitive data \u002F offline | Local SLM |\n| Simple, bounded task | Local SLM (cheap, fast) |\n| Hard multi-hop reasoning on non-sensitive data | Cloud model |\n| Cloud outage | Local SLM (graceful degradation) |\n\nDis one dey mirror di model-routing idea from Lesson 16, with workstation as one\nof di routes. Make you like designs wey fit fall back to local so agent go degrade in\nquality, no be just fail completely.\n\n## Guardrails for the assistant\n\n- Keep every file\u002Ftool work confined to sandboxed project directory.\n- No send code or data go cloud when the learner talk say na privacy\u002Foffline e wan — keep everything local.\n- Set correct expectations for SLM quality; rely on tools and RAG, no be the model memorized knowledge.\n- Note say Lesson 17 no get **Foundry Responses** endpoint, so cloud smoke-test ka no go work — make sure by running notebook local.\n\n---\n\n\u003C!-- CO-OP TRANSLATOR DISCLAIMER START -->\n**Disclaimer**:\nDis document don translate wit AI translation service [Co-op Translator](https:\u002F\u002Fgithub.com\u002FAzure\u002Fco-op-translator). Even tho we dey try make am correct, abeg make you know say automated translation fit get errors or mistakes. Di original document for dia own language na im be di correct source. For important info, make person wey sabi human translation do am. We no go responsible for any misunderstanding or wrong understanding wey fit happen because of dis translation.\n\u003C!-- CO-OP TRANSLATOR DISCLAIMER END -->",{"name":5,"license":15,"description":7},"main","f09e94ffe170f8af6d3db7c42987bbe4db227723","translations\u002Fpcm\u002F.agents\u002Fskills\u002Flocal-ai-agents",26019,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fai-agents-for-beginners","https:\u002F\u002Faka.ms\u002Fai-agents-beginners","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-07 12:51:12",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add microsoft\u002Fai-agents-for-beginners --skill local-ai-agents",{"tool":57,"command":58},"bunx","bunx skills add microsoft\u002Fai-agents-for-beginners --skill local-ai-agents",{"tool":60,"command":61},"pnpm","pnpm dlx skills add microsoft\u002Fai-agents-for-beginners --skill local-ai-agents","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fai-agents-for-beginners\u002Fblob\u002Fmain\u002Ftranslations\u002Fpcm\u002F.agents\u002Fskills\u002Flocal-ai-agents\u002FSKILL.md",true,[],[66,82,91,96,104,111],{"skillNo":67,"name":68,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":79,"publishedAt":36},"01M69A206TRZ8KK0CW0HYJF5V5","testing-course-samples","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fai-agents-for-beginners\u002Fblob\u002Fmain\u002Ftranslations\u002Fzh-TW\u002F.agents\u002Fskills\u002Ftesting-course-samples\u002FSKILL.md",[71,74],{"categoryNo":72,"categoryName":73,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":75,"categoryName":76,"taxonomyType":77,"taxonomyTypeDesc":78},"01JBSEEDCAT000000000000039","教师与教育","PROFESSION","适用职业",[80,81],"testing","testing course samples",{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":88,"publishedAt":36},"01M69A1XRB2SFHYRMEH0K08EKZ","microsoft-docs","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fai-agents-for-beginners\u002Fblob\u002Fmain\u002Ftranslations\u002Fzh-TW\u002F.agents\u002Fskills\u002Fmicrosoft-docs\u002FSKILL.md",[87],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[89,9,90],"docs","microsoft docs",{"skillNo":92,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":36},"01M69A1VPZFJQ1HNGTZQ5P3WSC","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fai-agents-for-beginners\u002Fblob\u002Fmain\u002Ftranslations\u002Fzh-TW\u002F.agents\u002Fskills\u002Flocal-ai-agents\u002FSKILL.md",[],[27,28],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":36},"01M69A1S947N7MM6V9JF85S2E7","jupyter-notebook","當使用者要求建立、搭建或編輯 Jupyter 筆記本（`.ipynb`）用於實驗、探索或教學時使用；優先使用隨附範本並執行輔助腳本 `new_notebook.py` 來產生一個乾淨的起始筆記本。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fai-agents-for-beginners\u002Fblob\u002Fmain\u002Ftranslations\u002Fzh-TW\u002F.agents\u002Fskills\u002Fjupyter-notebook\u002FSKILL.md",[],[103],"jupyter notebook",{"skillNo":105,"name":106,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":36},"01M69A1Q8EXPWKZSQK69V6WF22","deploying-scalable-agents","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fai-agents-for-beginners\u002Fblob\u002Fmain\u002Ftranslations\u002Fzh-TW\u002F.agents\u002Fskills\u002Fdeploying-scalable-agents\u002FSKILL.md",[],[110],"deploying scalable agents",{"skillNo":112,"name":113,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":36},"01M69A1MHZTH3RH9N8VYSYG74X","azure-openai-to-responses","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fai-agents-for-beginners\u002Fblob\u002Fmain\u002Ftranslations\u002Fzh-TW\u002F.agents\u002Fskills\u002Fazure-openai-to-responses\u002FSKILL.md",[],[117],"azure openai to responses"]