{"id":46198695,"url":"https://github.com/igorbenav/practical-language-models","last_synced_at":"2026-03-03T04:16:45.794Z","repository":{"id":338550087,"uuid":"1155687389","full_name":"igorbenav/practical-language-models","owner":"igorbenav","description":"An open book that teaches language models starting from the learning problem and neural networks, through word embeddings and transformers, all the way to building LLM applications, agents, and deploying them to production. Opinionated, hands-on, and meant to be read in order. Each chapter builds on the previous one.","archived":false,"fork":false,"pushed_at":"2026-02-15T04:39:42.000Z","size":5017,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-15T10:44:49.094Z","etag":null,"topics":["deep-learning","language-model","llm","machine-learning","neural-network","neural-networks","nlp","python","transformers"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igorbenav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"igorbenav"}},"created_at":"2026-02-11T19:42:18.000Z","updated_at":"2026-02-15T04:39:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/igorbenav/practical-language-models","commit_stats":null,"previous_names":["igorbenav/practical-language-models"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/igorbenav/practical-language-models","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorbenav%2Fpractical-language-models","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorbenav%2Fpractical-language-models/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorbenav%2Fpractical-language-models/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorbenav%2Fpractical-language-models/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igorbenav","download_url":"https://codeload.github.com/igorbenav/practical-language-models/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorbenav%2Fpractical-language-models/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30031981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T03:27:35.548Z","status":"ssl_error","status_checked_at":"2026-03-03T03:27:09.213Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","language-model","llm","machine-learning","neural-network","neural-networks","nlp","python","transformers"],"created_at":"2026-03-03T04:16:45.037Z","updated_at":"2026-03-03T04:16:45.790Z","avatar_url":"https://github.com/igorbenav.png","language":"Python","funding_links":["https://github.com/sponsors/igorbenav"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Practical Language Models\n\nFrom Intuition to Agents in Production.\n\n\u003ca href=\"docs/en/Practical-Language-Models.pdf\"\u003e\n   \u003cimg src=\"https://github.com/igorbenav/practical-language-models/blob/main/en/images/cover.png\" width=\"30%\" alt=\"Book Cover\"\u003e\n\u003c/a\u003e\n\nAn open book that teaches language models starting from the learning problem and neural networks, through word embeddings and transformers, all the way to building LLM applications, agents, and deploying them to production. Opinionated, hands-on, and meant to be read in order. Each chapter builds on the previous one.\n\nAssumes Python knowledge. No prior ML experience needed.\n\n**[Read the English version (PDF)](docs/en/Practical-Language-Models.pdf)**\n\n\u003c/div\u003e\n\n---\n\nThe book is highly visual, some chapters have over 20 original figures explaining concepts like loss landscapes, backpropagation and embedding spaces. Math is introduced with intuition first and formalized with equations and concrete numbers, but the text is written so that skipping the math still gives you a working understanding.\n\n## Table of Contents\n\n### Part I: Foundations\n\n| Chapter | Topic | Code |\n|:-------:|-------|:----:|\n| 1 | The Learning Problem | [chapter1](en/code/chapter1) |\n| 2 | Learning to Learn | [chapter2](en/code/chapter2) |\n| 3 | From Words to Numbers | [chapter3](en/code/chapter3) |\n| 4 | Attention and Transformers | |\n| 5 | Building a Language Model | |\n\n### Part II: Building with LLMs\n\n| Chapter | Topic | Code |\n|:-------:|-------|:----:|\n| 6 | What LLMs Can and Can't Do | |\n| 7 | Your First LLM Application | |\n| 8 | Tools: Letting Agents Act | |\n| 9 | Structured Output | |\n| 10 | Retrieval-Augmented Generation | |\n| 11 | Fine-Tuning | |\n| 12 | Multi-Step Workflows and Pipelines | |\n\n### Part III: Deploying to Production\n\n| Chapter | Topic | Code |\n|:-------:|-------|:----:|\n| 13 | Serving with FastAPI | |\n| 14 | Making It Reliable | |\n| 15 | Deployment | |\n\nMore chapters will be added.\n\n## Available Languages\n\n| Language | Directory | Status |\n|:--------:|:---------:|:------:|\n| English | [en/](en/) | In progress |\n\n## Getting Started\n\n### Prerequisites\n\n- [Python 3.11+](https://www.python.org/downloads/)\n- [uv](https://docs.astral.sh/uv/getting-started/installation/) - Python package manager\n- [Quarto](https://quarto.org/docs/get-started/) - Publishing system\n\n### Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/igorbenav/practical-language-models.git\n   cd practical-language-models\n   ```\n\n2. Install Python dependencies with uv:\n   ```bash\n   uv sync\n   ```\n\n## Building the Book\n\n| Format | Command | Output |\n|--------|---------|--------|\n| HTML (default) | `uv run quarto render en/` | `docs/en/index.html` |\n| PDF | `uv run quarto render en/ --to pdf` | `docs/en/` |\n| Preview with live reload | `uv run quarto preview en/` | localhost |\n\n\u003e Note: PDF rendering requires a LaTeX distribution (e.g., [TinyTeX](https://yihui.org/tinytex/), [TeX Live](https://www.tug.org/texlive/), or [MiKTeX](https://miktex.org/)).\n\n## Project Structure\n\n```\npractical-language-models/\n├── en/                          # English\n│   ├── _quarto.yml\n│   ├── index.qmd\n│   ├── references.qmd\n│   ├── references.bib\n│   ├── chapters/\n│   │   ├── chapter1.qmd\n│   │   ├── chapter2.qmd\n│   │   └── chapter3.qmd\n│   ├── images/                  # Figures (language-specific)\n│   │   ├── chapter1/\n│   │   ├── chapter2/\n│   │   └── chapter3/\n│   └── code/                    # Completed code per chapter\n│       ├── chapter1/\n│       ├── chapter2/\n│       └── chapter3/\n├── docs/                        # Rendered output\n│   └── en/\n├── README.md\n├── LICENSE\n├── pyproject.toml\n└── .gitignore\n```\n\n## Adding a New Language\n\nTo translate the book into a new language:\n\n1. Copy the `en/` directory as your starting point:\n   ```bash\n   cp -r en/ pt/   # for Portuguese, for example\n   ```\n\n2. In your new directory (e.g., `pt/`):\n   - Translate all `.qmd` files (chapters, index, references)\n   - Translate or recreate images that contain text (SVGs in `images/`)\n   - Update `_quarto.yml`: change `output-dir` to `../docs/pt`, translate the title/subtitle, and update `output-file` to use your language code (e.g., `\"Practical Language Models (pt)\"`)\n   - Code in `code/` may need translated comments\n\n3. Update the cover image:\n   - Edit `images/cover.svg` translate the text elements (title, subtitle, author) to your language\n   - Convert the SVG to PNG for PDF rendering (requires `rsvg-convert`, installed via `librsvg`):\n     ```bash\n     rsvg-convert -f png -w 2400 -h 3600 -o pt/images/cover.png pt/images/cover.svg\n     ```\n\n4. Build with:\n   ```bash\n   uv run quarto render pt/\n   uv run quarto render pt/ --to pdf\n   ```\n\n5. Add yourself to the contributors table below and submit a pull request.\n\n## Contributors\n\n| Name | GitHub | Role | Language |\n|------|--------|------|----------|\n| Igor Benav | [@igorbenav](https://github.com/igorbenav) | Author | English |\n\nWhen your translation or review is merged, add yourself in the same pull request to:\n\n1. The **Contributors** table above (this README)\n2. The **Contributors** table in your language's `index.qmd` (this appears in the actual book)\n\nRoles: \"Translator\", \"Reviewer\", or both.\n\n## Citation\n\n```bibtex\n@book{benav2026practical-language-models,\n  title     = {Practical Language Models: From Intuition to Agents in Production},\n  author    = {Igor Benav Magalhães},\n  year      = {2026},\n  url       = {https://github.com/igorbenav/practical-language-models}\n}\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorbenav%2Fpractical-language-models","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figorbenav%2Fpractical-language-models","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorbenav%2Fpractical-language-models/lists"}