deploying-scalable-agents
Skill này làm gì
Skill này hướng dẫn việc chuyển một agent AI từ bản nguyên mẫu sang triển khai production. Nó dành cho nhóm muốn agent của mình chạy ổn định, được giám sát và được kiểm thử trước mỗi bản phát hành.
Khi nào nên dùng
- ✓Khi bạn muốn triển khai một agent đang chạy tốt lên Microsoft Foundry như một dịch vụ được host và có phiên bản.
- ✓Khi bạn cần các bước phê duyệt, caching hoặc kiểm tra đánh giá trước khi một phiên bản agent mới được đưa ra.
- ✓Khi bạn muốn thêm tracing và giám sát cho một agent chạy trên production.
Liên kết skill
https://github.com/microsoft/ai-agents-for-beginners/blob/main/.agents/skills/deploying-scalable-agents/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy giúp tôi đưa nguyên mẫu agent của mình lên Microsoft Foundry với giám sát.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent xem xét nguyên mẫu của bạn và gợi ý một mẫu triển khai. Sau đó nó thêm các phần như định tuyến model, bước phê duyệt, giám sát và smoke test sau khi triển khai.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Deploying Scalable Agents with Microsoft Foundry
Companion skill for Lesson 16 – Deploying Scalable Agents. Use it to help a learner move an agent from prototype to a scalable, observable production deployment. Ground every recommendation in the lesson content and the runnable notebook; do not invent Foundry APIs.
Triggers
Activate this skill when a learner wants to:
- Deploy an agent to Microsoft Foundry as a hosted agent and make it versioned/observable.
- Choose between client-hosted, hosted-agent, and agent-workflow deployment patterns.
- Add model routing, response caching, or bounded concurrency to control latency and cost.
- Add an evaluation gate so a bad agent version cannot ship.
- Add a human-in-the-loop approval step for high-risk actions.
- Instrument an agent with OpenTelemetry tracing for production observability.
- Smoke-test a deployed agent as a fast post-deploy gate.
Core mental model
A production agent is mostly the operational skeleton around the model (~80%), not the model itself. Map every recommendation to one of these concerns:
| Concern | Prototype → Production |
|---|---|
| Hosting | notebook → versioned hosted service |
| Identity | your az login → managed identity + scoped RBAC |
| State | in-memory → externalised thread/memory store |
| Failure | traceback → retries, fallbacks, alerts |
| Cost | "a few cents" → tracked, routed, cached, budgeted |
| Quality | eyeballing → automated evaluation gate |
| Trust | you approve → policy + human-in-the-loop |
Deployment patterns (pick one, or combine)
- Client-hosted — the reasoning loop runs in your process. Max control; you own scaling/state.
- Hosted agent (Foundry Agent Service) — Foundry hosts the loop, stores threads, enforces RBAC/content safety, shows the agent in the portal. Less control, far less operational surface.
- Agent workflow — multiple agents/tools composed into a graph with branching, approval nodes, and durable checkpoints.
Lifecycle (the loop that ships an agent)
create → version → evaluate (gate) → deploy hosted → observe online → collect failures → repeat.
Offline evaluation is a gate, not an afterthought — a version does not ship
unless it clears the threshold. Online observability feeds real failures back
into the offline test set.
Scaling and cost levers (in priority order)
- Right-size the model — use the smallest model that passes the evaluation gate.
- Route by complexity — small/fast model for simple requests, large model for real reasoning (DIY classifier or Foundry Model Router).
- Cache — serve near-duplicate requests without a model call.
- Stateless design + bounded concurrency — externalise state; retry with backoff.
Key patterns to reproduce
Point the learner at these from the notebook
16-python-agent-framework.ipynb:
- Request handler: cache → route by complexity → trace span → run → cache.
- Evaluation gate: score an offline test set; return
pass_rate >= thresholdand only deploy if true. - Human approval:
@tool(approval_mode="always_require")for actions like large refunds. - Tracing: wrap each request in
tracer.start_as_current_span(...)and set attributes likerouted.model,customer.id.
Smoke-testing a deployed agent
After deploy, verify the endpoint actually answers (a green deploy can still be
silent). Use the AI Smoke Test
action via .github/workflows/smoke-test.yml
with the catalog in tests/. The runner POSTs each
prompt to POST {project_endpoint}/agents/{agent_name}/endpoint/protocols/openai/responses
and asserts on the reply text. The identity needs the Azure AI User role at
Foundry project scope; the token audience must be https://ai.azure.com/.
Layer the gates: smoke test (reachable/responding, every deploy) → offline evaluation (good enough to ship, before promotion) → online evaluation (how is it doing in the wild, continuous).
Enterprise controls
- RBAC: give each hosted agent a managed identity with least privilege.
- MCP in production: treat every MCP server as an untrusted boundary — pin the version, scope its i
Câu hỏi thường gặp
Nó bao gồm những tùy chọn triển khai nào?
Nó bao gồm agent do client host, agent được host và workflow agent.
Nó giúp kiểm soát chi phí như thế nào?
Nó bàn về định tuyến model, caching phản hồi và giới hạn số yêu cầu chạy đồng thời.
Nó có thêm phê duyệt của con người không?
Có. Nó bao gồm một bước phê duyệt cho các hành động rủi ro cao.
Chi tiết
Mô tả gốc của tác giả
Take a working agent prototype to a scalable, observable production deployment on Microsoft Foundry. Covers deployment patterns (client-hosted, hosted agents, agent workflows), the agent lifecycle, model routing, response caching, evaluation gates, human-in-the-loop approval, observability with OpenTelemetry, cost optimisation, and smoke-testing deployed agents with the AI Smoke Test action. Based on Lesson 16 of AI Agents for Beginners. USE FOR: deploy an agent to production, scale an agent, Microsoft Foundry hosted agent, Foundry Agent Service, model routing, response caching, evaluation gat
Độ phổ biến
- Sao GitHub
- 79k
- Vị trí xếp hạng
- #1724
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
azure-openai-to-responses
79kGiúp agent của bạn chuyển một ứng dụng Python từ Azure OpenAI Chat Completions sang Responses API mới hơn, từng bước một.
jupyter-notebook
79kGiúp agent của bạn tạo hoặc dọn gọn các notebook Jupyter cho thí nghiệm hoặc hướng dẫn từng bước, bằng các template có sẵn.
local-ai-agents
79kDạy agent của bạn xây dựng trợ lý AI chạy hoàn toàn trên máy tính với model và công cụ cục bộ, không cần cloud.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.