← govind p lal
AI and ML Bootcamp · Lecture 23 · lecture notes

Hugging Face End-to-End

In short — What is Hugging Face and what does it offer? It is the GitHub of AI: a hub of models, datasets and spaces, plus the libraries and deployment options to use them. The lecture also covers loop engineering (slash loop and slash goal) and a basic way to eval an agent.

What Hugging Face is

Hugging Face is the GitHub of AI. Everything AI related lives there: models, datasets, and ways to deploy or serve apps.

Companies post under their own org (e.g. Z.ai), like an org on GitHub. A model is a repository.

Models on the Hub

Almost 3 million models, filterable by task (text generation, image-to-text, text-to-image...), size, library, local apps and inference provider.

Small models (e.g. Qwen3 0.6B, Z-Image text-to-image) run locally or fast. A small image model made a picture in about 2.8 seconds, though with artifacts like two headlights.

Ways to use a model

WayHow
transformers librarypipeline (simple) or AutoTokenizer + AutoModel (lower level)
Inference providerPay a host (Groq, Together, Fireworks, Cerebras, SambaNova...) via HF router
Local runtimeDownload weights, serve with vLLM, SGLang, Ollama etc.
diffusersImage and video generation models
transformers.jsTiny models directly in the browser
from transformers import pipeline
clf = pipeline('sentiment-analysis')
print(clf('Hugging Face makes this easy'))
!

No GPU? Use small models, free Colab/Kaggle GPUs, or HF Pro (~$7/month, limited GPU hours).

Datasets

Spaces

import gradio as gr

def chat(message, history):
    return 'reply from model'

gr.ChatInterface(chat).launch()

Other Hugging Face tools

Loop engineering

Evaluating an agent

Process

How startups ship and agent harness choices

Glossary

Hub
Hugging Face platform hosting models, datasets and spaces.
Space
A web app hosted on Hugging Face, often a model demo.
Safetensors
File format storing model weights.
Inference provider
Company that hosts a model and serves it through an API.
pipeline
High-level transformers function that runs a task in a few lines.
Gradio
Python library for building ML app front ends without JavaScript.
Trackio
Hugging Face's lightweight experiment tracking library.
smolagents
Hugging Face's open-source agent library.
/goal
Coding agent command that iterates until a stated condition is met.
/loop
Coding agent command that repeats a prompt on an interval.