llm-twin-course

decodingai-magazineMIT更新放缓

一套 12 节动手课程,带你用 LLMOps 最佳实践从零搭建可上线的 LLM 与 RAG 系统,覆盖数据采集、训练、推理到部署全流程。

🤖 𝗟𝗲𝗮𝗿𝗻 for 𝗳𝗿𝗲𝗲 how to 𝗯𝘂𝗶𝗹𝗱 an end-to-end 𝗽𝗿𝗼𝗱𝘂𝗰𝘁𝗶𝗼𝗻-𝗿𝗲𝗮𝗱𝘆 𝗟𝗟𝗠 & 𝗥𝗔𝗚 𝘀𝘆𝘀𝘁𝗲𝗺 using 𝗟𝗟𝗠𝗢𝗽𝘀 best practices: ~ 𝘴𝘰𝘶𝘳𝘤𝘦 𝘤𝘰𝘥𝘦 + 12 𝘩𝘢𝘯𝘥𝘴-𝘰𝘯 𝘭𝘦𝘴𝘴𝘰𝘯𝘴

暂无版本4,410star +2 / 7 天732fork同步于 2026-11-10 23:39 UTC

怎么上手

由 README 提炼,执行前请确认
README 未给出安装命令,需参考 INSTALL_AND_USAGE.md 文档
硬件要求按 README 说明

README 说明任意现代笔记本或工作站即可,因为 LLM 微调与推理都在 AWS SageMaker 上完成。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

一套免费课程加源码,带你从零搭出生产级 LLM 与 RAG 系统

一套 12 节动手课程,带你用 LLMOps 最佳实践从零搭建可上线的 LLM 与 RAG 系统,覆盖数据采集、训练、推理到部署全流程。

核心能力

  • 拆成数据采集、特征、训练、推理四个 Python 微服务
  • 用 Bytewax 流式管道清洗分块并写入 Qdrant 向量库
  • 用 LoRA/QLoRA 微调 LLM 并推送到 Hugging Face 模型仓库
  • 用 Comet ML 追踪实验、Opik 评估与监控提示词
  • 用 Gradio UI 演示按你的写作风格生成内容

容易踩的坑

安装与运行步骤不在 README 里,要另看 INSTALL_AND_USAGE.md;微调与推理依赖 AWS SageMaker,会产生少量费用;还需自备 OpenAI API(约 1 美元)以及 Comet ML、Qdrant 等外部服务账号

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    🎯 What you'll learn

    By finishing the "LLM Twin: Building Your Production-Ready AI Replica" free course, you will learn how to design, train, and deploy a production-ready LLM twin of yourself powered by LLMs, vector DBs, and LLMOps good practices.

    No more isolated scripts or Notebooks! Learn production ML by building and deploying an end-to-end production-grade LLM system.

    📖 About this course

    You will learn how to architect and build a real-world LLM system from start to finish - from data collection to deployment.

    You will also learn to leverage MLOps best practices, such as experiment trackers, model registries, prompt monitoring, and versioning.

    The end goal? Build and deploy your own LLM twin.

    What is an LLM Twin? It is an AI character that learns to write like somebody by incorporating its style and personality into an LLM.

    🪈 The architecture of the LLM Twin is split into 4 Python microservices

    The data collection pipeline

    • Crawl your digital data from various social media platforms, such as Medium, Substack and GitHub.
    • Clean, normalize and load the data to a Mongo NoSQL DB through a series of ETL pipelines.
    • Send database changes to a RabbitMQ queue using the CDC pattern.
    • Learn to package the crawlers as AWS Lambda functions.

    The feature pipeline

    • Consume messages in real-time from a queue through a Bytewax streaming pipeline.
    • Every message will be cleaned, chunked, embedded and loaded into a Qdrant vector DB.
    • In the bonus series, we refactor the cleaning, chunking, and embedding logic using Superlinked, a specialized vector compute engine. We will also load and index the vectors to a Redis vector DB.

    The training pipeline

    • Create a custom instruction dataset based on your custom digital data to do SFT.
    • Fine-tune an LLM using LoRA or QLoRA.
    • Use Comet ML's experiment tracker to monitor the experiments.
    • Evaluate the LLM using Opik
    • Save and version the best model to the Hugging Face model registry.
    • Run and automate the training pipeline using AWS SageMaker.

    The inference pipeline

    • Load the fine-tuned LLM from the Hugging Face model registry.
    • Deploy the LLM as a scalable REST API using AWS SageMaker inference endpoints.
    • Enhance the prompts using advanced RAG techniques.
    • Monitor the prompts and LLM generated results using Opik
    • In the bonus series, we refactor the advanced RAG layer to write more optimal queries using Superlinked.
    • Wrap up everything with a Gradio UI (as seen below) where you can start playing around with the LLM Twin to generate content that follows your writing style.

    Along the 4 microservices, you will learn to integrate 4 serverless tools:

    • Comet ML as your experiment tracker and data registry;
    • Qdrant as your vector DB;
    • AWS SageMaker as your ML infrastructure;
    • Opik as your prompt evaluation and monitoring tool.

    👥 Who should join?

    This course is ideal for:

    • ML/AI engineers who want to learn to engineer production-ready LLM & RAG systems using LLMOps good principles
    • Data Engineers, Data Scientists, and Software Engineers wanting to understand the engineering behind LLM & RAG systems

    Note: This course focuses on engineering practices and end-to-end system implementation rather than theoretical model optimization or research.

    🎓 Prerequisites

    CategoryRequirements
    SkillsBasic understanding of Python and Machine Learning
    HardwareAny modern laptop/workstation will do the job, as the LLM fine-tuning and inference will be done on AWS SageMaker.
    LevelIntermediate

    💰 Cost structure

    All tools used throughout the course will stick to their free tier, except:

    • OpenAI's API, which will cost ~$1
    • AWS for fine-tuning and inference, which will cost < $10 depending on how much you play around with our scripts and your region.

    🥂 Open-source course: Participation is open and Free

    As an open-source course, you don't have to enroll. Everything is self-paced, free of charge and with its resources freely accessible as follows:

    📚 How will you learn?

    The course contains 10 hands-on written lessons and the open-source code you can access on GitHub, showing how to build an end-to-end LLM system.

    Also, it includes 2 bonus lessons on how to improve the RAG system.

    You can read everything at your own pace.

    Lessons

    This self-paced course consists of 12 comprehensive lessons covering theory, system design, and hands-on implementation.

    Our recommendation for each module:

    1. Read the article
    2. Run the code to replicate our results
    3. Go deeper into the code by reading the src Python modules

    [!NOTE] Check the INSTALL_AND_USAGE doc for a step-by-step installation and usage guide.

    LessonArticleCategoryDescriptionSource Code
    1An End-to-End Framework for Production-Ready LLM SystemsSystem DesignLearn the overall architecture and design principles of production LLM systems.No code
    2Data CrawlingData EngineeringLearn to crawl and process social media content for LLM training.src/data_crawling
    3CDC MagicData EngineeringLearn to implement Change Data Capture (CDC) for syncing two data sources.src/data_cdc
    4Feature Streaming PipelinesFeature PipelineBuild real-time streaming pipelines for LLM and RAG data processing.src/feature_pipeline
    5Advanced RAG AlgorithmsFeature PipelineImplement advanced RAG techniques for better retrieval.src/feature_pipeline
    6Generate Fine-Tuning Instruct DatasetsTraining PipelineCreate custom instruct datasets for LLM fine-tuning.src/feature_pipeline/generate_dataset
    7LLM Fine-tuning PipelineTraining PipelineBuild an end-to-end LLM fine-tuning pipeline and deploy it to AWS SageMaker.src/training_pipeline
    8LLM & RAG EvaluationTraining PipelineLearn to evaluate LLM and RAG system performance.src/inference_pipeline/evaluation
    9Implement and Deploy the RAG Inference PipelineInference PipelineDesign, implement and deploy the RAG inference to AWS SageMaker.src/inference_pipeline
    10Prompt MonitoringInference PipelineBuild the prompt monitoring and production evaluation pipeline.src/inference_pipeline
    11Refactor the RAG module using 74.3% Less Code Bonus on RAGOptimize the RAG system.src/bonus_superlinked_rag
    12Multi-Index RAG AppsBonus on RAGBuild advanced multi-index RAG apps.src/bonus_superlinked_rag

    🏗️ Project Structure

    At Decoding ML we teach how to build production ML systems, thus the course follows the structure of a real-world Python project:

    llm-twin-course/
    ├── src/                     # Source code for all the ML pipelines and services
    │ ├── data_crawling/         # Data collection pipeline code
    │ ├── data_cdc/              # Change Data Capture (CDC) pipeline code
    │ ├── feature_pipeline/      # Feature engineering pipeline code
    │ ├── training_pipeline/     # Training pipeline code
    │ ├── inference_pipeline/    # Inference service code
    │ └── bonus_superlinked_rag/ # Bonus RAG optimization code
    ├── .env.example             # Example environment variables template
    ├── Makefile                 # Commands to build and run the project
    ├── pyproject.toml           # Project dependencies
    

    🚀 Install & Usage

    To understand how to install and run the LLM Twin code end-to-end, go to the INSTALL_AND_USAGE dedicated document.

    [!NOTE] Even though you can run everything solely using the INSTALL_AND_USAGE dedicated document, we recommend that you read the articles to understand the LLM Twin system and design choices fully.

    💡 Questions and troubleshooting

    Have questions or running into issues? We're here to help!

    Open a GitHub issue for:

    • Questions about the course material
    • Technical troubleshooting
    • Clarification on concepts

    🥂 Contributing

    As an open-source course, we may not be able to fix all the bugs that arise.

    If you find any bugs and know how to fix them, support future readers by contributing to this course with your bug fix.

    We will deeply appreciate your support for the AI community and future readers 🤗

    Contributors

    A big "Thank you 🙏" to all our contributors! This course is possible only because of their efforts.

    Sponsors

    Also, another big "Thank you 🙏" to all our sponsors who supported our work and made this course possible.

    Next steps

    Our LLM Engineer’s Handbook inspired the open-source LLM Twin course.

    Consider supporting our work by getting our book to learn a complete framework for building and deploying production LLM & RAG systems — from data to deployment.

    Perfect for practitioners who want both theory and hands-on expertise by connecting the dots between DE, research, MLE and MLOps:

    Buy the LLM Engineer’s Handbook

    License

    This course is an open-source project released under the MIT license. Thus, as long you distribute our LICENSE and acknowledge our work, you can safely clone or fork this project and use it as a source of inspiration for whatever you want (e.g., university projects, college degree projects, personal projects, etc.).