Your browser is ancient!
Upgrade to a different browser to experience this site.

Llama for Python Programmers

What You'll Learn

  • Understand how to use llama.cpp Python APIs to build Llama 2-based large language model (LLM)applications.
  • Learn to run and interact with the Llama 2 large language model on commodity local hardware.
  • Learn to utilize zero- and few-shot prompting as well as advanced methods like grammars in llama.cpp to enhance and constrain Llama 2 model output.
  • Learn about the different Llama 2 model variants: the base model, chat model, and code llama and how to interact with these models in Python.
3 Modules
6 Hours
2 hrs per module (approx.)
Rating

About Llama for Python Programmers

Llama for Python Programmers is designed for programmers who want to leverage the Llama 2 large language model (LLM) and take advantage of the generative artificial intelligence (AI) revolution. In this course, you’ll learn how open-source LLMs can run on self-hosted hardware, made possible through techniques such as quantization by using the llama.cpp package. You’ll explore how Meta’s Llama 2 fits into the larger AI ecosystem, and how you can use it to develop Python-based LLM applications. Get hands-on skills using methods such as few-shot prompting and grammars to improve and constrain Llama 2 output, allowing you to get more robust data interchanges between Python application code and LLM inference. Lastly, gain insight into the different Llama 2 model variants, how they were trained, and how to interact with these models in Python.

This course does not require a data science or statistics background. It is developed specifically for Python application developers who are interested in integrating generative AI, such as Llama 2, into their work.

Skills You'll Gain

  • Artificial Intelligence
  • Generative AI Agents
  • Large Language Modeling
  • LLaMA (Language Model)
  • Machine Learning
  • Prompt Engineering
  • Python (Programming Language)

What You'll Earn

Certificate of Completion:
Certificates of completion acknowledge knowledge acquired upon completion of a non-credit course or program.
Experience Type
100% Online
Format
Self-Paced
Subject
  • Data Science
Platform
Coursera
Welcome Message

Welcome to Llama for Python Programmers, a course designed for software developers eager to explore and harness the capabilities of Llama 2, an open-access Large Language Model (LLM). This course guides Python programmers in integrating Llama 2 into projects, from tokenization to advanced application development. Through practical labs and programming assignments, you will gain hands-on experience building Llama 2 applications.

This abbreviated syllabus description was created with the help of AI tools and reviewed by staff. The full syllabus is available to those who enroll in the course.

Course Schedule

Module 1: Introduction to Llama 2: A High Quality Open Source Large Language Model

  • Video: Welcome to the Class: Llama for Python Programmers
  • Reading: Course Syllabus
  • Discussion Prompt: Meet Your Fellow Learners
  • Reading: Help Us Learn About You
  • Video: What is Llama 2? An Open Source Large Language Model (LLM)
  • Ungraded Lab: Llama 2 Workspace
  • Video: Llamas Llamas Everywhere! Inference, Chat, and Code Completion
  • Video: Open Source LLMs: Llama and Its Competitors
  • Video: The Elephant in the Room: Running Large Language Models on Small Hardware
  • Reading: Optional Readings: Llama License and Academic Papers
  • Video: Introducing Llama 3 - Understanding the Llama 3 and Llama 3.1 Herd of Models
  • Reading: The Llama 3 Herd of Models by Meta

Module 2: Under the Hood with Llama 2 and Python: Understanding How it Works

  • Ungraded Lab: Llama 2 Workspace
  • Video: Llama 2 Tokenization
  • Video: Building Our First Llama 2 Application with llama.cpp
  • Video: Choices/Parameters
  • Video: Llama 2 Chat and Conversations
  • Reading: Optional Readings: Sampling Methods, Bindings, and Quantization

Module 3: Building a Llama 2 Application

  • Ungraded Lab: Llama 2 Workspace
  • Video: Zero and Few Shot Prompting
  • Video: Controlling Model Output
  • Video: Using Grammars
  • Reading: Mycophiles Attack!
  • Ungraded Plugin: Assignment FAQ
  • Ungraded Lab: Llama's Adventure: A Journey Through the Dungeon (Optional)
  • Reading: Optional Reading: Grammars
  • Video: Course Conclusion
  • Reading: Post-Course Survey
  • Reading: Continue your learning with the AI Collection from Michigan Online
Grading Policy

Learners must achieve an overall grade of 80% to complete the course and receive the certificate. The course grade is based on three quizzes, worth 20% each, and a required programming assignment worth 40%.

Course content developed by U-M faculty and managed by the university. Faculty titles and affiliations are updated periodically.

Intermediate Level

Learners interested in the course should have a fundamental understanding of Python programming.

Enrollment Options

Individuals

This experience is available to individual learners on the following platforms:

U-M Community

Students, faculty, staff, and alumni of the University of Michigan get free access.

Organizations

Special pricing and tailored programming bundles available for organizational partners.

What are Coursera and edX?

Michigan Online learning experiences may be hosted on one or more learning platforms. Platform features may vary, including payment models, social communities, and learner support.

Coursera

  • Hosts online courses, series, and Teach-Outs from Michigan Online
  • Enroll and preview courses anytime
  • May earn a non-credit certificate from Coursera

edX

  • Hosts online courses and series from Michigan Online
  • Many offer a free (limited) audit option
  • May earn a non-credit certificate from edX

For more information visit the What are Coursera and edX? FAQ section

Reviews and Ratings

4.5

15 Ratings from Coursera

What Learners Are Saying

Michigan Online
For You

Sign up for a Michigan Online account to customize your experience!