Tutorial Tutorial Tutorial Cloudflare One Cloudflare One Cloudflare One ~40 phút ~40 min ~40 នាទី Đồng bộ 2026-06-10 Synced 2026-06-10 ធ្វើសមកាល 2026-06-10

Cài đặt Workers AI với AI Gateway Set up Workers AI with AI Gateway ទាញយក Workers AI ជាមួយ AI Gateway

Hướng dẫn chi tiết đồng bộ từ docs Cloudflare — mỗi section có backlink tới đúng vị trí trên trang gốc. Detailed guide synced from Cloudflare docs — each section links to the matching anchor on the official page. មគ្គុទ្ទេសក៍លម្អិតធ្វើសមកាលពី docs Cloudflare — ផ្នែកនីមួយៗមានតំណទៅទីតាំងត្រូវគ្នានៅទំព័រផ្លូវការ។

← Danh mục ← Catalog ← បញ្ជី

Giải thích nhanh Quick context បរិបទរហ័ស

Thuộc Cloudflare One — Zero Trust, truy cập an toàn và kiểm soát traffic người dùng/thiết bị. Tutorial «Thiết lập Workers AI với AI Gateway» giúp bạn làm quen luồng triển khai thật — phù hợp đọc trước khi mở tài liệu gốc tiếng Anh. Docs gốc chia khoảng 5 bước chính; bản tóm tắt dưới đây giúp bạn nắm khung trước khi làm theo từng lệnh.

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.

វគ្គបណ្តុះបណ្តាលនេះនឹងដំណើរការអ្នកតាមរយៈការបង្កើតនិងដំឡើងគម្រោង Workers AI ។ អ្នកនឹងប្រើ Workers, a AI Gateway binding, and a large language model (LLM) to deploy your first AI-powered application on the Cloudflare global network ។

Lưu ý Note ចំណាំ

Lưu ý trước khi làm Notes before you start ចំណាំមុនពេលចាប់ផ្តើម

  • Đây là bản tóm tắt trên Orange Cloud Learning Hub — không thay thế tài liệu chính thức.
  • Luôn mở liên kết «Tài liệu gốc» bên dưới khi cần lệnh CLI, snippet code và ảnh minh họa đầy đủ.
  • Cần tài khoản Cloudflare, Wrangler CLI và (thường) hoàn thành hướng dẫn Get started của Workers/Pages.
  • Zero Trust thường cần quyền admin trên tenant Cloudflare One và IdP đã kết nối.
  • Docs Cloudflare cập nhật thường xuyên — đối chiếu ngày «Rà soát lần cuối» trên trang gốc khi triển khai production.
  • This is a summary on Orange Cloud Learning Hub — it does not replace the official documentation.
  • Open the Official docs link below for CLI commands, code snippets, and full screenshots.
  • Requires a Cloudflare account, Wrangler CLI, and (typically) completing the Workers/Pages Get started guide.
  • Zero Trust typically requires Cloudflare One tenant admin access and a connected IdP.
  • Cloudflare docs change frequently — verify the Last reviewed date on the official page before production use.
  • នេះគឺជាការបញ្ជាក់អំពី Orange Cloud Learning Hub — វាគឺជាការផ្លាស់ប្តូរនៃឯកសារផ្លូវការ។
  • ចុចតំណភ្ជាប់ Docs Official នៅខាងក្រោមសម្រាប់ការបញ្ជា CLI, សៀវភៅកូដនិងរូបថតពេញលេញ។
  • តម្រូវឱ្យមានគណនី Cloudflare, Wrangler CLI និង (ប្រហែលជា) ការបញ្ចប់គណនី Workers/Pages Get started ។
  • Zero Trust ជាទូទៅតម្រូវការ Cloudflare One អ្នកគ្រប់គ្រងហិរញ្ញវត្ថុ access និង IdP ។
  • Cloudflare បានផ្លាស់ប្តូរជាធម្មតានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅ។

Overview Overview Overview

Phần «Tổng quan» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "Overview" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «Overview» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Hướng dẫn này sẽ hướng dẫn bạn qua việc thiết lập và triển khai dự án Workers AI. Bạn sẽ sử dụng Workers, một AI Gateway ràng buộc, và một mô hình ngôn ngữ lớn (LLM), để triển khai ứng dụng AI đầu tiên của bạn trên mạng toàn cầu Cloudflare.
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.
វគ្គបណ្តុះបណ្តាលនេះនឹងដំណើរការអ្នកតាមរយៈការបង្កើតនិងដំឡើងគម្រោង Workers AI ។ អ្នកនឹងប្រើ Workers, a AI Gateway binding, and a large language model (LLM), ដើម្បីដំឡើងកម្មវិធី AI របស់អ្នកដំបូងនៅលើបណ្តាញពិភពលោក Cloudflare ។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

Điều kiện Prerequisites គោលបំណង

Phần «Yêu cầu trước» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "Prerequisites" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «គោលបំណង» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
  1. Đăng ký cho một Cloudflare account ↗.
  2. Cài đặt Node.js ↗
  1. Sign up for a Cloudflare account ↗.
  2. Install Node.js ↗.
  1. សូមចុះឈ្មោះសម្រាប់ Cloudflare account ↗ ។
  2. ទាញយក Node.js ↗ ។
Node.js Trình quản lý phiên bản
Node.js version manager
Node.js អ្នកគ្រប់គ្រងកំណែ
Sử dụng trình quản lý phiên bản nút như Volta ↗ hoặc nvm ↗ để tránh các vấn đề quyền và thay đổi các phiên bản Node.js. Wrangler, được thảo luận sau trong hướng dẫn này, yêu cầu một phiên bản nút của 16.17.0 hoặc mới hơn.
Use a Node version manager like Volta ↗ or nvm ↗ to avoid permission issues and change Node.js versions. Wrangler, discussed later in this guide, requires a Node version of 16.17.0 or later.
ប្រើកម្មវិធីគ្រប់គ្រងកំណែ Node ដូចជា Volta ↗ ឬ nvm ↗ ដើម្បីជួសជុលបញ្ហាការអនុញ្ញាតនិងផ្លាស់ប្តូរកំណែ Node.js ។ Wrangler ដែលត្រូវបានពិភាក្សាបន្ទាប់មកនៅក្នុងវគ្គសិក្សានេះត្រូវការកំណែ Node នៃ 16.17.0 ឬបន្ទាប់មក។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

1.Điều Tạo dự án Worker 1. Create a Worker Project 1 ។ ការបង្កើតគម្រោងការងារ

Bạn sẽ create a new Worker project using the create-Cloudflare CLI (C3). C3 is a command-line tool designed to help you set up and deploy new applications to Cloudflare.

Read the "1. Create a Worker Project" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «1 ។ ការបង្កើតគម្រោងការងារ» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Bạn sẽ tạo một dự án Công nhân mới bằng cách sử dụng create-Cloudflare CLI (C3). C3 là một công cụ dòng lệnh được thiết kế để giúp bạn thiết lập và triển khai các ứng dụng mới để Cloudflare.
You will create a new Worker project using the create-Cloudflare CLI (C3). C3 is a command-line tool designed to help you set up and deploy new applications to Cloudflare.
អ្នកនឹងបង្កើតគម្រោងការងារថ្មីដោយប្រើ create-Cloudflare CLI (C3) ។ C3 គឺជាឧបករណ៍បន្ទាត់គោលបំណងដែលត្រូវបានរចនាឡើងដើម្បីជួយអ្នកបង្កើតនិងដំឡើងកម្មវិធីថ្មីទៅ Cloudflare ។
Tạo một dự án mới có tên hello-ai bằng cách chạy:
Create a new project named hello-ai by running:
បានបង្កើតគម្រោងថ្មីដែលមានឈ្មោះ hello-ai ដោយធ្វើការ:
Mã sản phẩm: npm yarn pnpm
npm yarn pnpm
លក្ខណៈពិសេស NPM
text
npm create cloudflare@latest -- hello-ai
text
yarn create cloudflare hello-ai
text
pnpm create cloudflare@latest hello-ai
Chạy npm create cloudflare@latest sẽ nhắc bạn cài đặt gói create-cloudflare và dẫn bạn qua thiết lập. C3 cũng sẽ cài đặt Wrangler, nền tảng phát triển Cloudflare CLI.
Running npm create cloudflare@latest will prompt you to install the create-cloudflare package and lead you through setup. C3 will also install Wrangler, the Cloudflare Developer Platform CLI.
ការដំឡើង npm create cloudflare@latest នឹងបង្វិលអ្នកដើម្បីដំឡើងកញ្ចប់ create-cloudflare និងនាំអ្នកតាមរយៈការដំឡើង។ C3 នឹងដំឡើង Wrangler, Cloudflare ប្លាស្ទិចអ្នកអភិវឌ្ឍន៍ CLI ។
Để cài đặt, hãy chọn các tùy chọn sau:
For setup, select the following options:
សម្រាប់ការដំឡើងអ្នកជ្រើសរើសជម្រើសខាងក្រោម:
  • Đối với Bạn muốn bắt đầu với gì?, chọn Hello World example.
  • Đối với bạn muốn sử dụng mẫu nào?, chọn Worker only.
  • Đối với Ngôn ngữ nào bạn muốn sử dụng?, chọn TypeScript.
  • Đối với Do you want to use git for version control?, chọn Yes.
  • Đối với Bạn muốn triển khai ứng dụng của mình?, chọn No (chúng tôi sẽ thực hiện một số thay đổi trước khi triển khai).
  • For What would you like to start with?, choose Hello World example.
  • For Which template would you like to use?, choose Worker only.
  • For Which language do you want to use?, choose TypeScript.
  • For Do you want to use git for version control?, choose Yes.
  • For Do you want to deploy your application?, choose No (we will be making some changes before deploying).
  • សម្រាប់ តើអ្នកចង់ចាប់ផ្តើមជាមួយអ្វី?, ជ្រើស Hello World example ។
  • សម្រាប់គំរូ តើអ្នកចង់ប្រើគំរូណាមួយ?, ជ្រើស Worker only ។
  • សម្រាប់ តើអ្នកចង់ប្រើភាសាណាមួយ?, ជ្រើស TypeScript ។
  • សម្រាប់ តើអ្នកចង់ប្រើ git សម្រាប់ការគ្រប់គ្រងកំណែ?, ជ្រើស Yes ។
  • សម្រាប់ តើអ្នកចង់ដំឡើងកម្មវិធីរបស់អ្នក?, ជ្រើស No (យើងនឹងធ្វើការផ្លាស់ប្តូរមួយចំនួនមុនពេលដំឡើង) ។
Điều này sẽ tạo ra một thư mục hello-ai mới. Thư mục hello-ai sẽ bao gồm:
This will create a new hello-ai directory. Your new hello-ai directory will include:
នេះនឹងបង្កើតអាសយដ្ឋាន hello-ai ថ្មី។ សៀវភៅថ្មីរបស់អ្នក hello-ai នឹងមាន:
  • នេះជា "Hello World" អ្នកធ្វើការនៅ src/index.ts ។
  • អាសយដ្ឋាន Wrangler configuration file
Đi đến thư mục ứng dụng của bạn:
Go to your application directory:
សូមចូលទៅក្នុងកម្មវិធីកម្មវិធីរបស់អ្នក:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
cd hello-ai

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

2.Đối với Kết nối nhân viên của bạn với Workers AI 2. Connect your Worker to Workers AI 2 ។ ទូរស័ព្ទដៃរបស់អ្នកទៅ Workers AI

Phần «Kết nối your Worker to Workers AI» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "2. Connect your Worker to Workers AI" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «2 ។ ទូរស័ព្ទដៃរបស់អ្នកទៅ Workers AI» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Bạn phải tạo một liên kết AI cho Người lao động của bạn để kết nối với Workers AI. Các liên kết cho phép Workers của bạn tương tác với các tài nguyên, chẳng hạn như Workers AI, trên nền tảng Nhà phát triển Cloudflare.
You must create an AI binding for your Worker to connect to Workers AI. Bindings allow your Workers to interact with resources, like Workers AI, on the Cloudflare Developer Platform.
អ្នកត្រូវបង្កើតការបណ្តុះបណ្តាល AI សម្រាប់បុគ្គលិករបស់អ្នកដើម្បីភ្ជាប់ទៅ Workers AI ។ ការបណ្តុះបណ្តាលអនុញ្ញាតឱ្យ Workers របស់អ្នកចូលរួមជាមួយសម្ភារៈដូចជា Workers AI នៅលើបណ្តាញអភិវឌ្ឍន៍ Cloudflare ។
Để gắn Workers AI với Worker của bạn, hãy thêm điều sau vào cuối Wrangler configuration file của bạn:
To bind Workers AI to your Worker, add the following to the end of your Wrangler configuration file:
ដើម្បីបំពាក់ Workers AI ទៅលើ Worker របស់អ្នក, បន្ថែមដូចខាងក្រោមនៅចុងក្រោយនៃ Wrangler configuration file របស់អ្នក:
JSONC
JSONC
JSONC
text
{

  "ai": {

    "binding": "AI",

  },

}
TOML
TOML
TOML
text
[ai]

binding = "AI"
Kết nối của bạn là available in your Worker code trên env.AI.
ការភ្ជាប់របស់អ្នកគឺ available in your Worker code នៅលើ env.AI ។
Bạn có thể sử dụng "default" làm ID gateway trong bước tiếp theo. AI Gateway tự động tạo gateway mặc định trên yêu cầu xác thực đầu tiên. Ngoài ra, bạn có thể create a gateway manually và sử dụng ID của nó.
You can use "default" as the gateway ID in the next step. AI Gateway automatically creates a default gateway on the first authenticated request. Alternatively, you can create a gateway manually and use its ID.
អ្នកអាចប្រើ "default" ដូចជា ID gateway ក្នុងដំណោះស្រាយបន្ទាប់។ AI Gateway ដោយស្វ័យប្រវត្តិបង្កើតគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូគំរូ ទោះបីជាអ្នកអាច create a gateway manually និងប្រើ ID របស់វា។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

3 Cái Chạy một nhiệm vụ kết luận có chứa AI Gateway trong Worker của bạn 3. Run an inference task containing AI Gateway in your Worker 3 ។ ធ្វើការបញ្ជាក់ដែលមាន AI Gateway នៅលើ Worker របស់អ្នក

Phần «Chạy inference task containing AI Gateway in your Worker» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "3. Run an inference task containing AI Gateway in your Worker" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «3 ។ ធ្វើការបញ្ជាក់ដែលមាន AI Gateway នៅលើ Worker របស់អ្នក» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Bây giờ bạn đã sẵn sàng để chạy một nhiệm vụ suy luận trong Công nhân của bạn. Trong trường hợp này, bạn sẽ sử dụng một LLM, llama-3.1-8b-instruct-fast, để trả lời một câu hỏi.
You are now ready to run an inference task in your Worker. In this case, you will use an LLM, llama-3.1-8b-instruct-fast, to answer a question.
ឥឡូវនេះអ្នកមានការរៀបចំដើម្បីដោះស្រាយបញ្ហានៅក្នុងការងាររបស់អ្នក។ ក្នុងករណីនេះអ្នកនឹងប្រើ LLM, llama-3.1-8b-instruct-fast, ដើម្បីបើយោងតាមសំណួរ។
Cập nhật tệp index.ts trong thư mục ứng dụng hello-ai của bạn với mã sau:
Update the index.ts file in your hello-ai application directory with the following code:
ទាញយកឯកសារ index.ts នៅក្នុងកម្មវិធី hello-ai របស់អ្នកដោយប្រើកូដដូចខាងក្រោម:
Trang chủ / index.ts
src/index.ts
អាសយដ្ឋាន: src / index.ts
text
export interface Env {

  // If you set another name in the [Wrangler configuration file](/workers/wrangler/configuration/) as the value for 'binding',

  // replace "AI" with the variable name you defined.

  AI: Ai;

}


export default {

  async fetch(request, env): Promise<Response> {

    // Specify the gateway label and other options here

    const response = await env.AI.run(

      "@cf/meta/llama-3.1-8b-instruct-fast",

      {

        prompt: "What is the origin of the phrase Hello, World",

      },

      {

        gateway: {

          id: "default", // Uses the default gateway, or replace with your gateway ID

          skipCache: true, // Optional: Skip cache if needed

        },

      },

    );


    // Return the AI response as a JSON object

    return new Response(JSON.stringify(response), {

      headers: { "Content-Type": "application/json" },

    });

  },

} satisfies ExportedHandler<Env>;
Cho đến thời điểm này, bạn đã tạo một liên kết AI cho Người lao động của bạn và cấu hình Người lao động của bạn để có thể thực hiện mô hình Llama 3.1. Bây giờ bạn có thể thử nghiệm dự án của bạn tại địa phương trước khi bạn triển khai toàn cầu.
Up to this point, you have created an AI binding for your Worker and configured your Worker to be able to execute the Llama 3.1 model. You can now test your project locally before you deploy globally.
នៅពេលនេះអ្នកបានបង្កើតការបណ្តុះបណ្តាល AI សម្រាប់ Worker របស់អ្នកហើយបានកំណត់ Worker របស់អ្នកដើម្បីអនុវត្តគំរូ Llama 3.1 ។ ឥឡូវនេះអ្នកអាចធ្វើតេស្តគម្រោងរបស់អ្នកនៅកន្លែងមុនពេលអ្នកដំឡើងនៅទូទាំងពិភពលោក។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

Bốn Phát triển tại địa phương với Wrangler 4. Develop locally with Wrangler 4 ។ ការអភិវឌ្ឍផ្ទាល់ខ្លួនជាមួយ Wrangler

Phần «Develop locally với Wrangler» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "4. Develop locally with Wrangler" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «4 ។ ការអភិវឌ្ឍផ្ទាល់ខ្លួនជាមួយ Wrangler» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Trong thư mục dự án của bạn, hãy kiểm tra Workers AI tại chỗ bằng cách chạy wrangler dev:
While in your project directory, test Workers AI locally by running wrangler dev:
ប្រសិនបើអ្នកមានគោលបំណងក្នុងគោលបំណងគម្រោងរបស់អ្នក, សូមធ្វើតេស្ត Workers AI ក្នុងកន្លែងរបស់អ្នកដោយធ្វើតេស្ត wrangler dev:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
npx wrangler dev
Workers AI Phí sử dụng phát triển địa phương
Workers AI local development usage charges
Workers AI តម្លៃការប្រើប្រាស់ការអភិវឌ្ឍក្នុងស្រុក
Sử dụng Workers AI luôn truy cập vào tài khoản Cloudflare của bạn để chạy các mô hình AI và sẽ gây ra phí sử dụng ngay cả trong phát triển cục bộ.
Using Workers AI always accesses your Cloudflare account in order to run AI models and will incur usage charges even in local development.
ការប្រើប្រាស់ Workers AI ត្រូវតែចូលទៅក្នុងគណនី Cloudflare របស់អ្នកដើម្បីដំណើរការម៉ូដែល AI និងនឹងទទួលបានការទូទាត់ទូទាត់ផងដែរនៅក្នុងការអភិវឌ្ឍ lokal ។
Bạn sẽ được nhắc đăng nhập sau khi chạy wrangler dev. Khi bạn chạy npx wrangler dev, Wrangler sẽ cung cấp cho bạn một URL (rất có thể là localhost:8787) để xem xét Worker của bạn. Sau khi bạn đi đến URL Wrangler cung cấp, bạn sẽ thấy một thông báo tương tự như ví dụ sau:
You will be prompted to log in after you run wrangler dev. When you run npx wrangler dev, Wrangler will give you a URL (most likely localhost:8787) to review your Worker. After you go to the URL Wrangler provides, you will see a message that resembles the following example:
អ្នកនឹងត្រូវបានគេស្គាល់ដើម្បីចូលទៅក្នុងបន្ទាប់ពីអ្នកធ្វើការ wrangler dev ។ នៅពេលដែលអ្នកដំណើរការ npx wrangler dev, Wrangler នឹងផ្តល់ឱ្យអ្នកនូវ URL (ប្រហែលជា localhost:8787) ដើម្បីពិនិត្យមើល Worker របស់អ្នក។ បន្ទាប់ពីអ្នកចូលទៅ URL Wrangler បានផ្តល់ជូនអ្នកនឹងមើលប្រកាសដែលគួរឱ្យចាប់អារម្មណ៍ដូចខាងក្រោម:
text
{

  "response": "A fascinating question!\n\nThe phrase \"Hello, World!\" originates from a simple computer program written in the early days of programming. It is often attributed to Brian Kernighan, a Canadian computer scientist and a pioneer in the field of computer programming.\n\nIn the early 1970s, Kernighan, along with his colleague Dennis Ritchie, were working on the C programming language. They wanted to create a simple program that would output a message to the screen to demonstrate the basic structure of a program. They chose the phrase \"Hello, World!\" because it was a simple and recognizable message that would illustrate how a program could print text to the screen.\n\nThe exact code was written in the 5th edition of Kernighan and Ritchie's book \"The C Programming Language,\" published in 1988. The code, literally known as \"Hello, World!\" is as follows:\n\n    main()\n    {\n      printf(\"Hello, World!\");\n    }\n\nThis code is still often used as a starting point for learning programming languages, as it demonstrates how to output a simple message to the console.\n\nThe phrase \"Hello, World!\" has since become a catch-all phrase to indicate the start of a new program or a small test program, and is widely used in computer science and programming education.\n\nSincerely, I'm glad I could help clarify the origin of this iconic phrase for you!"

}

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

5 triển khai nhân viên AI của bạn 5. Deploy your AI Worker 5 ។ ការបណ្តុះបណ្តាលរបស់អ្នក AI

Phần «Triển khai your AI Worker» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "5. Deploy your AI Worker" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «5 ។ ការបណ្តុះបណ្តាលរបស់អ្នក AI» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Trước khi triển khai AI Worker của bạn trên toàn cầu, hãy đăng nhập bằng tài khoản Cloudflare của bạn bằng cách chạy:
Before deploying your AI Worker globally, log in with your Cloudflare account by running:
មុនពេលដំឡើង AI Worker របស់អ្នកនៅទូទាំងពិភពលោក, សូមចូលរួមជាមួយគណនីរបស់អ្នក Cloudflare ដោយធ្វើការ:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
npx wrangler login
Bạn sẽ được chuyển đến một trang web yêu cầu bạn đăng nhập vào bảng điều khiển Cloudflare. Sau khi đăng nhập, bạn sẽ được hỏi nếu Wrangler có thể thực hiện thay đổi đối với tài khoản Cloudflare của bạn. Cuộn xuống và chọn Allow để tiếp tục.
You will be directed to a web page asking you to log in to the Cloudflare dashboard. After you have logged in, you will be asked if Wrangler can make changes to your Cloudflare account. Scroll down and select Allow to continue.
You will be directed to a web page asking you to log in to the Cloudflare dashboard. After you have logged in, you will be asked if Wrangler can make changes to your Cloudflare account. Scroll down and select Allow to continue.
Cuối cùng, triển khai Công nhân của bạn để làm cho dự án của bạn có thể truy cập trên Internet. Để triển khai Công nhân của bạn, chạy:
Finally, deploy your Worker to make your project accessible on the Internet. To deploy your Worker, run:
ឥឡូវនេះអ្នកអាចធ្វើឱ្យគម្រោងរបស់អ្នកអាចរកបាននៅលើអ៊ីនធឺណិត។ ដើម្បីដំឡើងការងាររបស់អ្នក, Run:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
npx wrangler deploy
Một khi được triển khai, Worker của bạn sẽ có sẵn tại một URL như:
Once deployed, your Worker will be available at a URL like:
នៅពេលដែលអ្នកត្រូវបានដំឡើង, Worker របស់អ្នកនឹងអាចរកបាននៅលើ URL ដូចជា:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
https://hello-ai.<YOUR_SUBDOMAIN>.workers.dev
Công nhân của bạn sẽ được triển khai vào tên miền con workers.dev tùy chỉnh của bạn. Bây giờ bạn có thể truy cập URL để chạy AI Worker của bạn.
Your Worker will be deployed to your custom workers.dev subdomain. You can now visit the URL to run your AI Worker.
អ្នកជំនាញរបស់អ្នកនឹងត្រូវបានដំឡើងទៅលើអេឡិចត្រូនិក workers.dev របស់អ្នក។ ឥឡូវនេះអ្នកអាចចូលទៅក្នុង URL ដើម្បីដំណើរការ AI Worker របស់អ្នក។
Bằng cách hoàn thành hướng dẫn này, bạn đã tạo một Worker, kết nối nó với Workers AI thông qua một AI Gateway ràng buộc, và chạy thành công một nhiệm vụ suy luận bằng cách sử dụng mô hình Llama 3.1.
By completing this tutorial, you have created a Worker, connected it to Workers AI through an AI Gateway binding, and successfully ran an inference task using the Llama 3.1 model.
ដោយបញ្ចប់ការបណ្តុះបណ្តាលនេះអ្នកបានបង្កើត Worker ដែលបានតភ្ជាប់វាទៅ Workers AI ដោយសារតែការបណ្តុះបណ្តាល AI Gateway ហើយបានធ្វើដំណើរការបញ្ជាក់ដោយប្រើម៉ូដែល Llama 3.1 ។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

Bước tiếp theo Next steps ជំហានបន្ទាប់

Phần «Bước tiếp theo» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "Next steps" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «ជំហានបន្ទាប់» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
  • Workers bindings — Gọi mô hình của bên thứ ba, access gateway phương pháp, và tích hợp với SDK AI.
  • Workers bindings — Call third-party models, access gateway methods, and integrate with AI SDKs.
  • Workers bindings — ទូរស័ព្ទម៉ូដែលរបស់ក្រុមហ៊ុនបម្រើទីបី, access gateway ឧបករណ៍និងរួមបញ្ចូលជាមួយ SDK AI ។
json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"/directory/","name":"Directory"}},{"@type":"ListItem","position":2,"item":{"@id":"/ai-gateway/","name":"AI Gateway"}},{"@type":"ListItem","position":3,"item":{"@id":"/ai-gateway/integrations/","name":"Integrations"}},{"@type":"ListItem","position":4,"item":{"@id":"/ai-gateway/integrations/aig-workers-ai-binding/","name":"Set up Workers AI with AI Gateway"}}]}

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

Xem bản đầy đủ trên developers.cloudflare.com (ảnh, tab cấu hình). View the full guide on developers.cloudflare.com (images, config tabs). មើលមគ្គុទ្ទេសក៍ពេញលើ developers.cloudflare.com (រូបភាព, tab កំណត់)។

Tài liệu gốc ↗ Official docs ↗ ឯកសារផ្លូវការ ↗