Lộ trình đang học Current learning path

Developer Platform Developer Platform

Build và deploy apps trên Cloudflare. Build and deploy apps on Cloudflare.

Về trang lộ trình Track home

Phần 5: AI trên Developer Platform Part 5: AI on the Developer Platform · Bài 2/5 Lesson 2/5

Adopt AI có kiểm soát với AI Gateway Adopt AI deliberately with AI Gateway

Đặt AI Gateway giữa app và model provider để quan sát request, cache khi phù hợp và thay provider mà không làm lộ credential ở client. Place AI Gateway between your app and model providers to observe requests, cache where appropriate, and change providers without exposing credentials in the client.

Adopt AI deliberately with AI Gateway
Minh họa từ Cloudflare Reference Architecture (developers.cloudflare.com) Illustration from Cloudflare Reference Architecture (developers.cloudflare.com)

Các bước thực hiện Step-by-step

  1. Tạo AI Gateway và đặt tên theo environment (development, staging, production). Create an AI Gateway and name it for the environment (development, staging, production).
  2. Route một model call từ Worker qua gateway thay vì gọi provider trực tiếp. Route one model call from the Worker through the gateway instead of calling a provider directly.
  3. Gắn request metadata không nhạy cảm: feature, environment và authenticated user/tenant ID đã được pseudonymize nếu cần. Attach non-sensitive request metadata: feature, environment, and a pseudonymized authenticated user or tenant ID where needed.
  4. Review logs, cache behavior, lỗi và usage trước khi thêm provider hoặc fallback khác. Review logs, cache behavior, errors, and usage before adding another provider or fallback.

Giải thích chi tiết Detailed explanation

Gateway là control plane cho adoption: giúp team so sánh model và quan sát usage mà không copy provider logic hoặc credential khắp codebase. Không log prompt/response nhạy cảm chỉ để debug. A gateway is an adoption control plane: it helps teams compare models and observe usage without copying provider logic or credentials across the codebase. Do not log sensitive prompts or responses just for debugging.

Ví dụ triển khai (Cloudflare Resources) Deployment examples (Cloudflare Resources)

Ví dụ chính thức từ Cloudflare Resources — gợi ý theo chủ đề bài học trong lộ trình này. Official examples from Cloudflare Resources — matched to this lesson within this path.

Tutorial Tutorial Cloudflare One Cloudflare One

Thiết lập Workers AI với AI Gateway Set up Workers AI with AI Gateway

Tóm tắt thực hành: Thiết lập Workers AI với AI Gateway trên AI Gateway. This guide will walk you through setting up and deploying a Workers AI project. You will use Workers, an AI Gateway binding, and a large language model (LLM) to deploy your first…

This guide will walk you through setting up and deploying a Workers AI project. You will use Workers, an AI Gateway binding, and a large language model (LLM) to deploy your first AI-powered application on the Cloudflare global network.

Tìm hiểu thêm Learn more

Xem thêm ví dụ trong lộ trình → More examples in this path →

Tài liệu Cloudflare Developers Cloudflare Developer docs

Sơ đồ kiến trúc (Cloudflare Docs) Architecture diagrams (Cloudflare Docs)

Multi-vendor AI architecture

Multi-vendor AI observability and control Multi-vendor AI observability and control

By shifting features such as rate limiting, caching, and error handling to the proxy layer, organizations can apply unified configurations across services and inference service providers. By shifting features such as rate limiting, caching, and error handling to the proxy layer, organizations can apply unified configurations across services and inference service providers.

Sơ đồ chính thức ↗ Official diagram ↗ · AI Artificial Intelligence (AI)

Sản phẩm liên quan Related products

Học xong hoặc muốn đổi hướng? Finished or want a different path?

Ba lộ trình độc lập — mỗi lộ trình chỉ gồm bài học và tài liệu trong phạm vi đó. Chọn lộ trình khác khi sẵn sàng, không cần học song song. Three independent paths — each includes only lessons and materials for that scope. Switch when you are ready; no need to study paths in parallel.

Chưa chắc — làm bài chọn lộ trình Not sure — use the path selector · So sánh cả ba lộ trình Compare all three paths