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 Mod
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-local-ai-agents-3c00f1ba2e0e ,按照其中的说明把「local-ai-agents」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Skill wey go help for Lesson 17 – Creating Local AI Agents. Use am to help person wey dey learn build agent wey sabi reason, dey call tools, and dey search documentation all na inside dem machine — no cloud inference. Make every recommendation stand gidigba for lesson content and the runnable notebook.
Activate this skill when person wey dey learn want:
Small Language Model (SLM) dey trade wide knowledge for privacy, cost, and offline work. The best
way: make the SLM dey organize and make tools carry the heavy work. The
model no need to know the codebase — e need to know wen to call
read_file and search_docs. Dis one dey play to SLM strength (small decisions
like tool choice) and avoid hin weakness (big knowledge, long multi-hop
reasoning).
base_url (and using local fake API key). E also dey choose best build (CPU/GPU/NPU) for machine.stdio.foundry model run qwen2.5-7b-instruct
foundry service status
from foundry_local import FoundryLocalManager
from openai import OpenAI
manager = FoundryLocalManager("qwen2.5-7b-instruct")
client = OpenAI(base_url=manager.endpoint, api_key=manager.api_key) # lokal plassholder
About 8 GB RAM na minimum wey make sense; GPU/NPU fit help but dem no mandatory.
Show the learner the notebook
17-local-agent-foundry-local.ipynb:
search_docs go return top-k chunks.stdio; scope am to project directory and check outputs well.| Situation | Where e dey run |
|---|---|
| Sensitive data / offline | Local SLM |
| Simple, bounded task | Local SLM (cheap, fast) |
| Hard multi-hop reasoning on non-sensitive data | Cloud model |
| Cloud outage | Local SLM (graceful degradation) |
Dis one dey mirror di model-routing idea from Lesson 16, with workstation as one of di routes. Make you like designs wey fit fall back to local so agent go degrade in quality, no be just fail completely.
Disclaimer: Dis document don translate wit AI translation service Co-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.