🇬🇧 English
Local AI means that the model is a file on your computer. Nothing you type leaves the room, there is no monthly bill, and it works with no internet. That is why this course spends its first units on the computer: to run a model yourself, you must be at home in the command line and know what an address and a port are.
The numbers of classes are a guide, for classes of about ninety minutes. A lesson marked "more" is for a student who finishes early.
🇹🇭 ไทย
AI ในเครื่องหมายความว่าโมเดลเป็นไฟล์อยู่บนคอมพิวเตอร์ของคุณ สิ่งที่คุณพิมพ์ไม่ออกไปนอกห้อง ไม่มีค่าใช้จ่ายรายเดือน และใช้ได้โดยไม่มีอินเทอร์เน็ต นี่คือเหตุผลที่คอร์สนี้ใช้หน่วยแรก ๆ ไปกับตัวคอมพิวเตอร์ เพราะการจะรันโมเดลเอง คุณต้องคุ้นกับบรรทัดคำสั่ง และรู้ว่าที่อยู่กับพอร์ตคืออะไร
จำนวนคาบเป็นเพียงแนวทาง สำหรับคาบเรียนที่ยาวประมาณเก้าสิบนาที บทเรียนที่มีคำว่า "เพิ่มเติม" มีไว้สำหรับผู้เรียนที่ทำเสร็จก่อน
🇨🇳 中文
本地 AI 的意思是:模型是你电脑上的一个文件。你输入的内容不会离开这间屋子,没有月费,没有网络也能用。所以这门课把最前面的单元花在电脑本身上:要自己运行模型,你得熟悉命令行,并且知道地址和端口是什么。
课时数只是参考,按每节课大约九十分钟计算。标着「更多」的课程是给提前完成的学生的。
| Unitหน่วย单元 | What it teachesสอนอะไร教什么 | Classesจำนวนคาบ课时 |
|---|---|---|
| 1 | Windows, macOS and the command lineWindows, macOS และบรรทัดคำสั่งWindows、macOS 和命令行 | 2 |
| 2 | Networking basicsพื้นฐานเครือข่าย网络基础 | 2 |
| 3 | Python basicsพื้นฐาน PythonPython 基础 | 4 |
| 4 | Small real programs: email and QR codesโปรแกรมเล็ก ๆ ที่ใช้ได้จริง: อีเมลและคิวอาร์โค้ด真正能用的小程序:电子邮件和二维码 | 2 |
| 5 | A website on GitHub Pages, with HTML, JavaScript and a chatbot's helpเว็บไซต์บน GitHub Pages ด้วย HTML, JavaScript และมีแชตบอตช่วยGitHub Pages 上的网站,用 HTML、JavaScript,并请聊天机器人帮忙 | 3 |
| 6 | A private repository for Python projectsรีโพซิทอรีส่วนตัวสำหรับโปรเจกต์ Python存放 Python 项目的私有仓库 | 1 |
| 7 | Ollama: a language model on your computerOllama: โมเดลภาษาบนคอมพิวเตอร์ของคุณOllama:你电脑上的语言模型 | 2 |
| 8 | Decider: a model that picksDecider: โมเดลที่เลือกคำตอบDecider:会做选择的模型 | 2 |
| 9 | Agno: a team of agentsAgno: ทีมของเอเจนต์Agno:一支智能体团队 | 2 |
| 10 | DockerDockerDocker | 2 |
| 11 | BentoML: your model as a web serviceBentoML: โมเดลของคุณในรูปเว็บเซอร์วิสBentoML:把你的模型变成网络服务 | 2 |
| 12 | Reverse engineering: read a program you did not writeวิศวกรรมย้อนกลับ: อ่านโปรแกรมที่คุณไม่ได้เขียน逆向工程:读懂不是你写的程序 | 2 |
| 13 | Your own projectโปรเจกต์ของคุณเอง你自己的项目 | 2 |
💻 Part 1 — Your computer · ส่วนที่ 1 — คอมพิวเตอร์ของคุณ · 第 1 部分 —— 你的电脑
1 Windows, macOS and the command line · Windows, macOS และบรรทัดคำสั่ง · Windows、macOS 和命令行
2 classes2 คาบ2 节课
The student finds their way round their own computer: files and folders, installing a program, and the terminal, where you type a command and the computer answers. Everything later in the course is started from a terminal.ผู้เรียนทำความรู้จักกับคอมพิวเตอร์ของตัวเอง ทั้งไฟล์และโฟลเดอร์ การติดตั้งโปรแกรม และเทอร์มินัล ซึ่งเป็นที่ที่คุณพิมพ์คำสั่งแล้วคอมพิวเตอร์ตอบกลับ ทุกอย่างในคอร์สหลังจากนี้เริ่มจากเทอร์มินัล学生熟悉自己的电脑:文件和文件夹、安装程序,以及终端,也就是你输入命令、电脑给出回答的地方。课程后面的一切都是从终端启动的。
| Lessonบทเรียน课程 | What the class does with itในคาบเรียนใช้ทำอะไร课上用它做什么 |
|---|---|
| Windows Basics | For Windows students: the desktop, the Start menu, settings and windows.สำหรับผู้เรียนที่ใช้ Windows: เดสก์ท็อป เมนู Start การตั้งค่า และหน้าต่าง给用 Windows 的学生:桌面、开始菜单、设置和窗口。 |
| Start Python on a Mac or Windows | The first half only: the words programmers use, files and folders, and the Terminal.เฉพาะครึ่งแรก: คำที่โปรแกรมเมอร์ใช้ ไฟล์และโฟลเดอร์ และเทอร์มินัล只学前半部分:程序员用的词、文件和文件夹,以及终端。 |
| File Management | Folders, file names and file types, so that nobody loses their work.โฟลเดอร์ ชื่อไฟล์ และชนิดของไฟล์ เพื่อไม่ให้ใครทำงานหาย文件夹、文件名和文件类型,这样谁都不会弄丢自己的作业。 |
| sed, awk, curl and > on a Mac moreเพิ่มเติม更多 | For Mac students who want more of the command line: pipes, and saving what a command prints.สำหรับผู้เรียนที่ใช้ Mac และอยากรู้เรื่องบรรทัดคำสั่งมากขึ้น: ไปป์ และการบันทึกสิ่งที่คำสั่งพิมพ์ออกมา给想多学一点命令行的 Mac 学生:管道,以及把命令打印的内容保存下来。 |
By the end, the student can open a terminal, move between folders, make a folder and a file, and say where a file is.เมื่อจบหน่วย ผู้เรียนเปิดเทอร์มินัล ย้ายไปมาระหว่างโฟลเดอร์ สร้างโฟลเดอร์และไฟล์ และบอกได้ว่าไฟล์อยู่ที่ไหน学完之后,学生能打开终端,在文件夹之间移动,新建文件夹和文件,并说出一个文件在哪里。
2 Networking basics · พื้นฐานเครือข่าย · 网络基础
2 classes2 คาบ2 节课
A local model is a program that waits at an address on your own computer. This unit gives the student the words for that: network, address, name, Wi-Fi, and the commands that show whether one computer can reach another.โมเดลในเครื่องคือโปรแกรมที่รออยู่ที่ที่อยู่หนึ่งบนคอมพิวเตอร์ของคุณเอง หน่วยนี้ให้คำศัพท์สำหรับเรื่องนั้นแก่ผู้เรียน ได้แก่ เครือข่าย ที่อยู่ ชื่อ Wi-Fi และคำสั่งที่บอกว่าคอมพิวเตอร์เครื่องหนึ่งติดต่ออีกเครื่องได้หรือไม่本地模型是一个在你自己电脑的某个地址上等待的程序。这个单元教给学生相关的词:网络、地址、名称、Wi-Fi,以及用来查看一台电脑能不能连到另一台的命令。
| Lessonบทเรียน课程 | What the class does with itในคาบเรียนใช้ทำอะไร课上用它做什么 |
|---|---|
| Networks: Types & Topologies | What a network is, and the network at home or at school.เครือข่ายคืออะไร และเครือข่ายที่บ้านหรือที่โรงเรียน什么是网络,以及家里或学校里的网络。 |
| IP Addresses & Subnetting | The address of a computer. The class does the addresses and leaves the subnetting.ที่อยู่ของคอมพิวเตอร์ ในคาบเรียนทำเรื่องที่อยู่ และข้ามเรื่องซับเน็ต电脑的地址。课上只讲地址,不讲子网划分。 |
| Wi-Fi & Wireless | How a laptop joins a network without a cable.แล็ปท็อปเข้าร่วมเครือข่ายโดยไม่ใช้สายได้อย่างไร笔记本电脑怎样不用网线就连上网络。 |
| DNS & Domain Names | How a name such as krueng.ai becomes an address.ชื่ออย่าง krueng.ai กลายเป็นที่อยู่ได้อย่างไรkrueng.ai 这样的名字怎样变成地址。 |
| Network Troubleshooting Tools | The commands that test a connection, tried by each student on their own computer.คำสั่งที่ใช้ทดสอบการเชื่อมต่อ โดยผู้เรียนแต่ละคนลองบนคอมพิวเตอร์ของตัวเอง测试连接的命令,每个学生在自己的电脑上试一试。 |
| Tailscale: your own private network moreเพิ่มเติม更多 | For later: reach your own computer from another place, safely.สำหรับภายหลัง: เข้าถึงคอมพิวเตอร์ของคุณเองจากที่อื่นอย่างปลอดภัย留到以后:从别的地方安全地连到你自己的电脑。 |
By the end, the student can find their computer's address, test whether another computer answers, and explain what localhost and a port are.เมื่อจบหน่วย ผู้เรียนหาที่อยู่ของคอมพิวเตอร์ตัวเอง ทดสอบว่าคอมพิวเตอร์อีกเครื่องตอบกลับหรือไม่ และอธิบายได้ว่า localhost กับพอร์ตคืออะไร学完之后,学生能找到自己电脑的地址,测试另一台电脑有没有回应,并解释 localhost 和端口是什么。
🐍 Part 2 — Python · ส่วนที่ 2 — Python · 第 2 部分 —— Python
3 Python basics · พื้นฐาน Python · Python 基础
4 classes4 คาบ4 节课
The student installs Python and writes real programs: values, lists, loops, functions and files. This is the longest unit, because every unit after it is written in Python.ผู้เรียนติดตั้ง Python และเขียนโปรแกรมจริง ได้แก่ ค่า ลิสต์ ลูป ฟังก์ชัน และไฟล์ นี่คือหน่วยที่ยาวที่สุด เพราะทุกหน่วยหลังจากนี้เขียนด้วย Python学生安装 Python,并写出真正的程序:值、列表、循环、函数和文件。这是最长的一个单元,因为后面每个单元都是用 Python 写的。
| Lessonบทเรียน课程 | What the class does with itในคาบเรียนใช้ทำอะไร课上用它做什么 |
|---|---|
| Start Python on a Mac or Windows | The second half: install Python, write and run a file, IDLE, Jupyter, and its two Python lessons.ครึ่งหลัง: ติดตั้ง Python เขียนและรันไฟล์ IDLE, Jupyter และบทเรียน Python สองบทของหน้านั้น后半部分:安装 Python,写文件并运行,IDLE、Jupyter,以及其中的两节 Python 课。 |
| Python Toolkit | Seven tools for after the basics. The class needs three of them here: pathlib, json and requests.เครื่องมือเจ็ดอย่างสำหรับหลังเรียนพื้นฐาน ในคาบเรียนตรงนี้ต้องใช้สามอย่าง คือ pathlib json และ requests学完基础之后用的七种工具。这里课上需要其中三种:pathlib、json 和 requests。 |
| Classes, taught with a window | What a class is, taught by building a small window. Units 9 and 11 use classes.คลาสคืออะไร สอนด้วยการสร้างหน้าต่างเล็ก ๆ หน่วยที่ 9 และ 11 ใช้คลาส什么是类,通过做一个小窗口来教。第 9 和第 11 单元会用到类。 |
| Catch Your Own Bugs | Write tests for your own program, then break it and watch the tests catch you.เขียนเทสต์ให้โปรแกรมของตัวเอง แล้วทำให้มันพัง และดูเทสต์จับได้给自己的程序写测试,然后故意把它弄坏,看测试怎么抓住你。 |
| Python: English & Concepts Exam | A check at the end of the unit.แบบทดสอบท้ายหน่วย单元结束时的检查。 |
| Data Classes, attrs and Pydantic moreเพิ่มเติม更多 | Three ways to make an object that holds data.สามวิธีในการสร้างออบเจกต์ที่เก็บข้อมูล创建数据对象的三种方法。 |
By the end, the student can write a Python file of thirty lines with a function and a loop, run it from the terminal, and read its error messages.เมื่อจบหน่วย ผู้เรียนเขียนไฟล์ Python ยาวสามสิบบรรทัดที่มีฟังก์ชันและลูป รันจากเทอร์มินัล และอ่านข้อความแจ้งข้อผิดพลาดของมันได้学完之后,学生能写出一个三十行的 Python 文件,里面有函数和循环,能从终端运行它,并读懂它的错误信息。
4 Small real programs: email and QR codes · โปรแกรมเล็ก ๆ ที่ใช้ได้จริง: อีเมลและคิวอาร์โค้ด · 真正能用的小程序:电子邮件和二维码
2 classes2 คาบ2 节课
Before any AI, the student makes Python do something a person can see: an email arrives, and a QR code opens a page on a phone. They also install their first library.ก่อนจะถึง AI ผู้เรียนให้ Python ทำสิ่งที่คนมองเห็นได้ คืออีเมลส่งมาถึง และคิวอาร์โค้ดเปิดหน้าเว็บบนโทรศัพท์ได้ ผู้เรียนยังได้ติดตั้งไลบรารีตัวแรกด้วย在接触 AI 之前,学生先让 Python 做一些人看得见的事:一封邮件送到了,一个二维码在手机上打开了网页。他们还会安装自己的第一个库。
| Lessonบทเรียน课程 | What the class does with itในคาบเรียนใช้ทำอะไร课上用它做什么 |
|---|---|
| Email, files and AI in Python | Ten tutorials. The class does the first ones: send an email, write and read files, and attach a file.บทเรียนสิบบท ในคาบเรียนทำบทแรก ๆ คือส่งอีเมล เขียนและอ่านไฟล์ และแนบไฟล์十个教程。课上做前面几个:发一封邮件,写文件和读文件,再添加附件。 |
| Six More Free Python Libraries | Make a QR code, then choose one more library: the space station, streets or earthquakes.สร้างคิวอาร์โค้ด แล้วเลือกไลบรารีอีกหนึ่งตัว: สถานีอวกาศ ถนน หรือแผ่นดินไหว做一个二维码,然后再选一个库:空间站、街道或地震。 |
| A bot that reads your mail once an hour moreเพิ่มเติม更多 | A program that stays on and answers email by itself.โปรแกรมที่เปิดค้างไว้และตอบอีเมลเอง一个一直开着、自己回复邮件的程序。 |
| What Is an API? moreเพิ่มเติม更多 | How one program asks another over the internet.โปรแกรมหนึ่งถามอีกโปรแกรมหนึ่งผ่านอินเทอร์เน็ตได้อย่างไร一个程序怎样通过互联网向另一个程序提问。 |
By the end, the student can install a library, send an email from a program, and make a QR code for any address.เมื่อจบหน่วย ผู้เรียนติดตั้งไลบรารี ส่งอีเมลจากโปรแกรม และสร้างคิวอาร์โค้ดสำหรับที่อยู่ใดก็ได้学完之后,学生能安装一个库,从程序里发邮件,并为任何地址做一个二维码。
🌐 Part 3 — A website, and a place for your work · ส่วนที่ 3 — เว็บไซต์ และที่เก็บงานของคุณ · 第 3 部分 —— 一个网站,和一个存放作品的地方
5 A website on GitHub Pages · เว็บไซต์บน GitHub Pages · GitHub Pages 上的网站
3 classes3 คาบ3 节课
The student puts a real website on the internet, free. First they learn enough HTML and JavaScript to read a page. Then they ask a chatbot such as ChatGPT to write the HTML, read what it wrote, and change it. Then they publish it with Git and GitHub Pages.ผู้เรียนนำเว็บไซต์จริงขึ้นอินเทอร์เน็ตโดยไม่เสียเงิน ขั้นแรกเรียน HTML และ JavaScript ให้พออ่านหน้าเว็บได้ จากนั้นขอให้แชตบอตอย่าง ChatGPT เขียน HTML ให้ อ่านสิ่งที่มันเขียน แล้วแก้ไข จากนั้นเผยแพร่ด้วย Git และ GitHub Pages学生把一个真正的网站免费放到互联网上。先学足够读懂网页的 HTML 和 JavaScript。然后请 ChatGPT 这样的聊天机器人来写 HTML,读它写的内容,再修改。最后用 Git 和 GitHub Pages 发布。
| Lessonบทเรียน课程 | What the class does with itในคาบเรียนใช้ทำอะไร课上用它做什么 |
|---|---|
| What Is HTML? Your First Web Page | Write a first page by hand and open it in a browser.เขียนหน้าเว็บแรกด้วยมือ แล้วเปิดในเบราว์เซอร์亲手写出第一个网页,并在浏览器里打开。 |
| JavaScript Lab | An overview: the nine small machines of the lab, such as a variable, a loop and an event.ภาพรวม: เครื่องจักรเล็ก ๆ เก้าตัวของแล็บ เช่น ตัวแปร ลูป และอีเวนต์概览:实验室里的九台小机器,比如变量、循环和事件。 |
| AI Code Generation | Ask a chatbot for the code of a page, then read it line by line.ขอโค้ดของหน้าเว็บจากแชตบอต แล้วอ่านทีละบรรทัด请聊天机器人写出网页的代码,然后一行一行地读。 |
| Prompt Lab | How to write a request that gets a better answer from the chatbot.วิธีเขียนคำขอให้ได้คำตอบที่ดีขึ้นจากแชตบอต怎样写请求,才能从聊天机器人那里得到更好的回答。 |
| Introduction to Git | Save versions of your work on your own computer.บันทึกเวอร์ชันของงานไว้บนคอมพิวเตอร์ของคุณเอง在自己的电脑上保存作品的各个版本。 |
| Ship a Real Website: Git & GitHub Pages Lab | The main lesson of the unit: push the page to GitHub and see it live at an address.บทเรียนหลักของหน่วย: พุชหน้าเว็บขึ้น GitHub แล้วเห็นมันออนไลน์ที่ที่อยู่หนึ่ง本单元的主课:把网页推送到 GitHub,并在一个地址上看到它上线。 |
| Make a Space Game in JavaScript moreเพิ่มเติม更多 | A game to put on the new website.เกมสำหรับนำไปใส่ในเว็บไซต์ใหม่可以放到新网站上的一个游戏。 |
By the end, the student has a website of their own at a public address, and can change it and publish the change.เมื่อจบหน่วย ผู้เรียนมีเว็บไซต์ของตัวเองที่ที่อยู่สาธารณะ และแก้ไขแล้วเผยแพร่การแก้ไขนั้นได้学完之后,学生有了一个自己的、有公开地址的网站,并且能修改它、发布修改。
6 A private repository for Python projects · รีโพซิทอรีส่วนตัวสำหรับโปรเจกต์ Python · 存放 Python 项目的私有仓库
1 class1 คาบ1 节课
The website is public: anybody can read it. Python work is different. It is unfinished, and it may sit beside a password or a key. So the student makes a second repository on GitHub that only they can see, and saves every later unit of this course in it.เว็บไซต์เป็นสาธารณะ ใครก็อ่านได้ แต่งาน Python ต่างออกไป มันยังไม่เสร็จ และอาจอยู่ข้างรหัสผ่านหรือคีย์ ผู้เรียนจึงสร้างรีโพซิทอรีที่สองบน GitHub ที่มีแต่ตัวเองเห็น และบันทึกงานของทุกหน่วยหลังจากนี้ไว้ในนั้น网站是公开的:谁都能看。Python 作业不一样。它还没做完,旁边还可能放着密码或密钥。所以学生在 GitHub 上再建一个只有自己能看到的仓库,把这门课后面每个单元的作业都存在里面。
| Lessonบทเรียน课程 | What the class does with itในคาบเรียนใช้ทำอะไร课上用它做什么 |
|---|---|
| Learn Git and GitHub | The words and the commands: repository, commit, push and pull.คำศัพท์และคำสั่ง: repository, commit, push และ pull相关的词和命令:repository、commit、push 和 pull。 |
| In class, with the teacherทำในคาบเรียนกับครู课上和老师一起做 | Make a private repository, copy it to the computer, and put the programs of units 3 and 4 in it, one folder for each project.สร้างรีโพซิทอรีส่วนตัว คัดลอกมาที่คอมพิวเตอร์ แล้วใส่โปรแกรมของหน่วยที่ 3 และ 4 ลงไป โปรเจกต์ละหนึ่งโฟลเดอร์建一个私有仓库,把它复制到电脑上,再把第 3 和第 4 单元的程序放进去,每个项目一个文件夹。 |
| In class, with the teacherทำในคาบเรียนกับครู课上和老师一起做 | Write a .gitignore file, so that Git leaves out the virtual environment and any file that holds a password.เขียนไฟล์ .gitignore เพื่อให้ Git ไม่เก็บสภาพแวดล้อมเสมือนและไฟล์ใดก็ตามที่มีรหัสผ่าน写一个 .gitignore 文件,让 Git 不收录虚拟环境和任何存有密码的文件。 |
By the end, the student has a private repository with their Python work in it, and no password inside it.เมื่อจบหน่วย ผู้เรียนมีรีโพซิทอรีส่วนตัวที่มีงาน Python ของตัวเองอยู่ข้างใน และไม่มีรหัสผ่านอยู่ในนั้น学完之后,学生有了一个私有仓库,里面是自己的 Python 作业,而且没有任何密码。
🧠 Part 4 — AI on your own computer · ส่วนที่ 4 — AI บนคอมพิวเตอร์ของคุณเอง · 第 4 部分 —— 你自己电脑上的 AI
7 Ollama: a language model on your computer · Ollama: โมเดลภาษาบนคอมพิวเตอร์ของคุณ · Ollama:你电脑上的语言模型
2 classes2 คาบ2 节课
The student installs Ollama, a free program that runs language models, and talks to a model that is a file on their own laptop. Then they call that model from Python. This is where units 1 and 2 pay off: the model waits at an address and a port on the student's own computer.ผู้เรียนติดตั้ง Ollama ซึ่งเป็นโปรแกรมฟรีที่รันโมเดลภาษา แล้วคุยกับโมเดลที่เป็นไฟล์อยู่บนแล็ปท็อปของตัวเอง จากนั้นเรียกโมเดลนั้นจาก Python ตรงนี้เองที่หน่วยที่ 1 และ 2 ได้ใช้ประโยชน์ เพราะโมเดลรออยู่ที่ที่อยู่และพอร์ตบนคอมพิวเตอร์ของผู้เรียนเอง学生安装 Ollama,一个运行语言模型的免费程序,并和一个就存在自己笔记本电脑上的模型对话。然后用 Python 调用这个模型。第 1 和第 2 单元在这里派上了用场:模型就在学生自己电脑的一个地址和端口上等着。
| Lessonบทเรียน课程 | What the class does with itในคาบเรียนใช้ทำอะไร课上用它做什么 |
|---|---|
| Stop Paying for AI, Run It Free | Why local, how to install Ollama, and how to choose a model that fits the computer's memory.ทำไมต้องรันในเครื่อง ติดตั้ง Ollama อย่างไร และเลือกโมเดลให้พอดีกับหน่วยความจำของคอมพิวเตอร์อย่างไร为什么要本地运行,怎样安装 Ollama,以及怎样选一个适合电脑内存的模型。 |
| Ollama: Run AI Models on Your Own PC | Install it, download a model and talk to it in the terminal.ติดตั้ง ดาวน์โหลดโมเดล แล้วคุยกับมันในเทอร์มินัล安装它,下载一个模型,在终端里和它对话。 |
| Build an AI Tutor in Python | Call the model from Python, and give it a role.เรียกโมเดลจาก Python และกำหนดบทบาทให้มัน用 Python 调用模型,并给它一个角色。 |
| A chat window of your own | A desktop chat program that remembers the conversation.โปรแกรมแชตบนเดสก์ท็อปที่จำบทสนทนาได้一个能记住对话的桌面聊天程序。 |
| Local AI Stack on Windows, on a Mac moreเพิ่มเติม更多 | A fuller set of local AI tools, for each kind of computer.ชุดเครื่องมือ AI ในเครื่องที่ครบกว่า สำหรับคอมพิวเตอร์แต่ละแบบ更完整的一套本地 AI 工具,两种电脑各有一份。 |
| How does ChatGPT actually work? moreเพิ่มเติม更多 | A short video on what a language model does.วิดีโอสั้นว่าโมเดลภาษาทำอะไร一段短视频,讲语言模型在做什么。 |
By the end, the student has a model running with no internet, and a Python program of their own that asks it a question.เมื่อจบหน่วย ผู้เรียนมีโมเดลที่รันได้โดยไม่มีอินเทอร์เน็ต และมีโปรแกรม Python ของตัวเองที่ถามคำถามมัน学完之后,学生有了一个不用联网就能运行的模型,还有一个自己写的、向它提问的 Python 程序。
8 Decider: a model that picks · Decider: โมเดลที่เลือกคำตอบ · Decider:会做选择的模型
2 classes2 คาบ2 节课
A language model answers with a sentence, and a program cannot do much with a sentence. Decider is a small model that answers with a choice, a yes or no, or a score, and says how sure it is. The student installs the decider-ai library and lets a model make a decision inside a program.โมเดลภาษาตอบเป็นประโยค และโปรแกรมทำอะไรกับประโยคได้ไม่มาก Decider คือโมเดลขนาดเล็กที่ตอบเป็นตัวเลือก ใช่หรือไม่ใช่ หรือคะแนน และบอกว่ามั่นใจแค่ไหน ผู้เรียนติดตั้งไลบรารี decider-ai แล้วให้โมเดลตัดสินใจภายในโปรแกรม语言模型用一句话来回答,而程序拿一句话做不了多少事。Decider 是一个小模型,它的回答是一个选项、是或否,或者一个分数,并且说出自己有多确定。学生安装 decider-ai 库,让模型在程序里做一次决定。
| Lessonบทเรียน课程 | What the class does with itในคาบเรียนใช้ทำอะไร课上用它做什么 |
|---|---|
| Decider: a model that picks, and says how sure it is | The whole unit: the three kinds of question, and three ways to call the model from Python.ทั้งหน่วย: คำถามสามแบบ และสามวิธีในการเรียกโมเดลจาก Python整个单元:三种问题,以及用 Python 调用模型的三种方法。 |
| Jev: asking for an answer instead of a sentence moreเพิ่มเติม更多 | The same idea with a hosted model, to compare.แนวคิดเดียวกันกับโมเดลที่อยู่บนเซิร์ฟเวอร์ของผู้อื่น เพื่อเปรียบเทียบ同样的想法,用托管在别处的模型,用来对比。 |
By the end, the student can sort a list of messages with a model, and use how sure the model is to decide when to ask a person.เมื่อจบหน่วย ผู้เรียนจัดกลุ่มรายการข้อความด้วยโมเดล และใช้ความมั่นใจของโมเดลตัดสินใจว่าเมื่อไรควรถามคน学完之后,学生能用模型给一组消息分类,并根据模型有多确定来决定什么时候该去问人。
9 Agno: a team of agents · Agno: ทีมของเอเจนต์ · Agno:一支智能体团队
2 classes2 คาบ2 节课
An agent is a model that can use tools, such as a Python function you wrote. With Agno the student gives an agent a tool, then builds a small team of agents with a boss, all on a local model with no key.เอเจนต์คือโมเดลที่ใช้เครื่องมือได้ เช่น ฟังก์ชัน Python ที่คุณเขียน ด้วย Agno ผู้เรียนให้เครื่องมือแก่เอเจนต์ แล้วสร้างทีมเอเจนต์เล็ก ๆ ที่มีหัวหน้า ทั้งหมดรันบนโมเดลในเครื่องโดยไม่ต้องใช้คีย์智能体是能使用工具的模型,比如你写的一个 Python 函数。用 Agno,学生给智能体一个工具,再组建一支有主管的小团队,全部运行在本地模型上,不需要密钥。
| Lessonบทเรียน课程 | What the class does with itในคาบเรียนใช้ทำอะไร课上用它做什么 |
|---|---|
| Agno: manage a team of AI agents in Python | The whole unit: ten short files, from one agent to a team, saved conversations and an approval step.ทั้งหน่วย: ไฟล์สั้น ๆ สิบไฟล์ ตั้งแต่เอเจนต์หนึ่งตัวจนถึงทีม บทสนทนาที่บันทึกไว้ และขั้นตอนขออนุมัติ整个单元:十个短文件,从一个智能体到一支团队、保存的对话,还有一个审批步骤。 |
| smolagents moreเพิ่มเติม更多 | Another, smaller library for agents, to compare.ไลบรารีสำหรับเอเจนต์อีกตัวที่เล็กกว่า เพื่อเปรียบเทียบ另一个更小的智能体库,用来对比。 |
By the end, the student has written a tool, given it to an agent, and run a team of agents on their own computer.เมื่อจบหน่วย ผู้เรียนได้เขียนเครื่องมือ ให้เอเจนต์ใช้ และรันทีมเอเจนต์บนคอมพิวเตอร์ของตัวเอง学完之后,学生写过一个工具,把它交给了智能体,并在自己的电脑上运行了一支智能体团队。
📦 Part 5 — Share what you built · ส่วนที่ 5 — แบ่งปันสิ่งที่คุณสร้าง · 第 5 部分 —— 分享你做出来的东西
10 Docker · Docker · Docker
2 classes2 คาบ2 节课
A program that works on one computer often fails on the next. Docker packs a program, and everything it needs, into one box that runs the same everywhere. The student installs Docker and packs one of their own programs.โปรแกรมที่ทำงานได้บนคอมพิวเตอร์เครื่องหนึ่งมักใช้ไม่ได้บนเครื่องถัดไป Docker แพ็กโปรแกรมและทุกอย่างที่มันต้องใช้ลงในกล่องเดียวที่รันได้เหมือนกันทุกที่ ผู้เรียนติดตั้ง Docker แล้วแพ็กโปรแกรมของตัวเองหนึ่งตัว在一台电脑上能用的程序,换一台常常就不行了。Docker 把程序和它需要的一切装进一个盒子里,在哪里运行都一样。学生安装 Docker,并把自己的一个程序装进去。
| Lessonบทเรียน课程 | What the class does with itในคาบเรียนใช้ทำอะไร课上用它做什么 |
|---|---|
| Docker Lab: boxes for your programs | The words, four small machines to drive, and how to install Docker on Windows and on a Mac.คำศัพท์ เครื่องจักรเล็ก ๆ สี่ตัวให้ลองใช้ และวิธีติดตั้ง Docker บน Windows และบน Mac相关的词、四台可以动手操作的小机器,以及怎样在 Windows 和 Mac 上安装 Docker。 |
| Write Your Own Dockerfile | Pack a first program into a box of your own.แพ็กโปรแกรมแรกลงในกล่องของคุณเอง把第一个程序装进你自己的盒子。 |
| Linux Lab: Ubuntu and Rocky in a box moreเพิ่มเติม更多 | Learn the Linux command line inside a container.เรียนบรรทัดคำสั่งของ Linux ภายในคอนเทนเนอร์在容器里学习 Linux 命令行。 |
By the end, the student can start a container, write a short Dockerfile, and run their own program inside a box.เมื่อจบหน่วย ผู้เรียนเปิดคอนเทนเนอร์ เขียน Dockerfile สั้น ๆ และรันโปรแกรมของตัวเองในกล่องได้学完之后,学生能启动一个容器,写一个简短的 Dockerfile,并在盒子里运行自己的程序。
11 BentoML: your model as a web service · BentoML: โมเดลของคุณในรูปเว็บเซอร์วิส · BentoML:把你的模型变成网络服务
2 classes2 คาบ2 节课
So far only the student's own programs can use the student's model. BentoML turns a Python function into a web service that any program can ask. The lesson's later tutorials put the Decider model of unit 8 and the Ollama model of unit 7 inside a service, and open it to the other computers in the room.จนถึงตอนนี้ มีแต่โปรแกรมของผู้เรียนเองที่ใช้โมเดลของผู้เรียนได้ BentoML เปลี่ยนฟังก์ชัน Python ให้เป็นเว็บเซอร์วิสที่โปรแกรมใดก็ถามได้ บทเสริมช่วงหลังของบทเรียนนำโมเดล Decider ของหน่วยที่ 8 และโมเดล Ollama ของหน่วยที่ 7 ใส่ไว้ในเซอร์วิส แล้วเปิดให้คอมพิวเตอร์เครื่องอื่นในห้องใช้到目前为止,只有学生自己的程序能用学生的模型。BentoML 把一个 Python 函数变成任何程序都能提问的网络服务。这一课后面的教程把第 8 单元的 Decider 模型和第 7 单元的 Ollama 模型放进服务里,并开放给教室里的其他电脑。
| Lessonบทเรียน课程 | What the class does with itในคาบเรียนใช้ทำอะไร课上用它做什么 |
|---|---|
| BentoML with Python: turn a function into a web service | The whole unit: eight steps, then the tutorials with a real model and a local network.ทั้งหน่วย: แปดขั้น แล้วต่อด้วยบทเสริมที่ใช้โมเดลจริงและเครือข่ายภายใน整个单元:八个步骤,然后是用到真实模型和局域网的教程。 |
| Python and local AI: an adaptive test | A practice test on every lesson of this syllabus. It asks about the lessons where each student is weakest.แบบฝึกทดสอบสำหรับทุกบทเรียนในหลักสูตรนี้ โดยถามในบทเรียนที่นักเรียนแต่ละคนยังอ่อนที่สุด针对本大纲每一课的练习测试。它会就每个学生最薄弱的课程提问。 |
| Flask: give your Python a web page moreเพิ่มเติม更多 | A small website written in Python.เว็บไซต์เล็ก ๆ ที่เขียนด้วย Python用 Python 写的一个小网站。 |
| Gradio moreเพิ่มเติม更多 | A web page for a model, made from one Python function.หน้าเว็บสำหรับโมเดล สร้างจากฟังก์ชัน Python หนึ่งตัว给模型用的网页,由一个 Python 函数生成。 |
By the end, a classmate's computer can ask the student's model a question over the school network.เมื่อจบหน่วย คอมพิวเตอร์ของเพื่อนร่วมชั้นถามคำถามโมเดลของผู้เรียนผ่านเครือข่ายของโรงเรียนได้学完之后,同学的电脑可以通过学校的网络向这位学生的模型提问。
12 Reverse engineering: read a program you did not write · วิศวกรรมย้อนกลับ: อ่านโปรแกรมที่คุณไม่ได้เขียน · 逆向工程:读懂不是你写的程序
2 classes2 คาบ2 节课
Every program so far came with a lesson that explained it. A real program comes finished, with no plan. In this unit the student takes programs apart with REA, a free tool. First come two hello programs of the student's own, one in JavaScript and one in C, so that every answer of the tool can be marked. Then comes Rectangle, a free open-source Mac app. The first class works on Windows or on a Mac. The second class needs a Mac.โปรแกรมทุกตัวจนถึงตอนนี้มาพร้อมบทเรียนที่อธิบายมัน แต่โปรแกรมจริงมาแบบทำเสร็จแล้ว โดยไม่มีแบบแปลน ในหน่วยนี้ผู้เรียนแยกโปรแกรมออกดูด้วย REA ซึ่งเป็นเครื่องมือฟรี เริ่มจากโปรแกรม hello สองตัวของผู้เรียนเอง ตัวหนึ่งเป็น JavaScript และอีกตัวเป็น C เพื่อให้ตรวจคำตอบทุกข้อของเครื่องมือได้ จากนั้นคือ Rectangle ซึ่งเป็นแอปแมคฟรีแบบโอเพนซอร์ส คาบแรกใช้ได้บน Windows หรือบน Mac คาบที่สองต้องใช้ Mac到目前为止,每个程序都配有一节讲解它的课。真实的程序是做好了才来到你手里的,没有设计图。在这个单元,学生用免费的工具 REA 把程序拆开来看。先是学生自己写的两个 hello 程序,一个用 JavaScript,一个用 C,这样工具的每个回答都能打分。然后是 Rectangle,一个免费的开源 Mac 应用。第一节课在 Windows 或 Mac 上都能上。第二节课需要 Mac。
| Lessonบทเรียน课程 | What the class does with itในคาบเรียนใช้ทำอะไร课上用它做什么 |
|---|---|
| Reverse engineering with REA: read a program you did not write | The whole unit: part 1 in the first class, parts 2 and 3 in the second. Only programs whose licence allows it are studied.ทั้งหน่วย: ส่วนที่ 1 ในคาบแรก ส่วนที่ 2 และ 3 ในคาบที่สอง ศึกษาเฉพาะโปรแกรมที่สัญญาอนุญาตยอมให้ทำ整个单元:第一节课上第 1 部分,第二节课上第 2 和第 3 部分。只研究许可证允许研究的程序。 |
By the end, the student can say what a finished program is built on and which code one of its menu items runs, and can say how each of those answers was checked.เมื่อจบหน่วย ผู้เรียนบอกได้ว่าโปรแกรมที่ทำเสร็จแล้วสร้างอยู่บนอะไร และรายการเมนูหนึ่งรายการของมันรันโค้ดไหน และบอกได้ว่าตรวจคำตอบแต่ละข้ออย่างไร学完之后,学生能说出一个做好的程序建立在什么之上、它的一个菜单项运行的是哪段代码,还能说出每个答案是怎样检查过的。
13 Your own project · โปรเจกต์ของคุณเอง · 你自己的项目
2 classes2 คาบ2 节课
The student chooses one thing to build with a local model, keeps it in the private repository of unit 6, and shows it to the class. The lessons below are starting points. Each one adds one new idea to what the course has taught.ผู้เรียนเลือกสิ่งหนึ่งที่จะสร้างด้วยโมเดลในเครื่อง เก็บไว้ในรีโพซิทอรีส่วนตัวของหน่วยที่ 6 แล้วนำเสนอให้ชั้นเรียนดู บทเรียนข้างล่างเป็นจุดเริ่มต้น แต่ละบทเพิ่มแนวคิดใหม่หนึ่งอย่างจากสิ่งที่คอร์สสอนมา学生选一样东西,用本地模型把它做出来,存在第 6 单元的私有仓库里,并展示给全班。下面的课程是起点。每一课都在这门课教过的内容上增加一个新想法。
| Lessonบทเรียน课程 | The project it startsโปรเจกต์ที่เริ่มจากบทเรียนนี้它能开启的项目 |
|---|---|
| Build RAG in Python | A model that answers from your own documents.โมเดลที่ตอบจากเอกสารของคุณเอง一个根据你自己的文档来回答的模型。 |
| Keyestudio Smart Home with Python | A small house that a program controls. It needs the Keyestudio kit.บ้านหลังเล็กที่โปรแกรมควบคุม ต้องมีชุดคิต Keyestudio一座由程序控制的小屋。需要 Keyestudio 套件。 |
| Free Thai Speech-to-Text on Your PC | Turn a recording into text on your own computer.เปลี่ยนเสียงที่บันทึกไว้เป็นข้อความบนคอมพิวเตอร์ของคุณเอง在自己的电脑上把录音变成文字。 |
| Python to EXE | Turn your program into an app that opens with a double-click.เปลี่ยนโปรแกรมของคุณเป็นแอปที่เปิดได้ด้วยการดับเบิลคลิก把你的程序变成双击就能打开的应用。 |
| Fine-Tune an LLM with Python | For a strong student: teach a small model something new.สำหรับผู้เรียนที่เก่ง: สอนสิ่งใหม่ให้โมเดลขนาดเล็ก给学得好的学生:教一个小模型一点新东西。 |
By the end, the student has one working project of their own, saved in their repository and shown to other people.เมื่อจบหน่วย ผู้เรียนมีโปรเจกต์ของตัวเองที่ใช้งานได้หนึ่งชิ้น บันทึกไว้ในรีโพซิทอรี และได้นำเสนอให้คนอื่นดู学完之后,学生有了一个能运行的、属于自己的项目,存在仓库里,并且展示给别人看过。