# AI Engineer 101

**A practical guide to becoming an AI engineer — from Python tooling to production LLM systems.**

## Why I Wrote This Series

I came to AI engineering from a software engineering background. I knew how to build APIs, write tests, deploy containers — but when I started building systems that used LLMs, embeddings, and vector search, I realized the gap between "software engineer who uses AI APIs" and "AI engineer who builds reliable AI systems" was bigger than I expected.

The hard part wasn't calling an API. It was knowing how tokens actually work so I could debug why my prompts were getting truncated. It was understanding embeddings well enough to know why my retrieval was returning irrelevant results. It was learning to evaluate AI outputs when there's no single "correct" answer.

This series documents what I learned building AI-powered systems in my own projects — a RAG service over my personal knowledge base, an LLM-powered DevOps agent, and various automation tools. Every code example runs. Every pattern comes from something I actually built and debugged.

No fake product scenarios. No "imagine you're building a chatbot for a Fortune 500 company." This is what AI engineering looks like when you're building it yourself.

***

## How This Fits with Other Series

| Series                                                                                                                                      | Focus                                                                               |
| ------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| **AI Engineer 101 (this)**                                                                                                                  | The full picture — role, tooling, LLMs, embeddings, prompts, APIs, eval, production |
| [LLM API Development 101](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/llm-api-development-101)             | Deep dive into building FastAPI services with Claude                                |
| [RAG 101](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/rag-101)                                             | End-to-end retrieval-augmented generation with pgvector                             |
| [AI Agent Development 101](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/ai-agent-development-101)           | Building a single agent with ReAct, memory, and tool use                            |
| [PyTorch 101](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/pytorch-101)                                     | Tensors, autograd, neural networks from scratch                                     |
| [Hugging Face Transformers 101](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/hugging-face-transformers-101) | Using pre-trained models and fine-tuning                                            |

Read this series first if you're transitioning from software engineering to AI engineering. The other series go deeper on specific topics.

***

## What You Will Learn

### Part 1: What is an AI Engineer?

* The AI engineer role — how it differs from ML engineer and data scientist
* The skills map: software engineering + AI fundamentals + system thinking
* Where AI engineers fit in a team
* My path from DevOps/backend engineering to AI engineering

### Part 2: Python Tooling for AI Engineers

* Why Python dominates AI engineering (and where it doesn't)
* Project structure with `pyproject.toml`, `uv`, and virtual environments
* The essential library stack: FastAPI, Pydantic, httpx, sentence-transformers
* Setting up a reproducible AI development environment

### Part 3: How LLMs Work — What AI Engineers Need to Know

* Tokens, context windows, and why they matter for your code
* The transformer architecture in plain language
* Temperature, top-p, and sampling — what the parameters actually do
* Local models vs API models — when to use which

### Part 4: Embeddings and Vector Search

* What embeddings actually represent and why they're useful
* Generating embeddings with sentence-transformers and API providers
* Vector similarity: cosine, dot product, Euclidean distance
* Storing and querying vectors with pgvector

### Part 5: Prompt Engineering for Production Systems

* Why prompt engineering is software engineering, not guesswork
* System prompts, few-shot examples, and structured output
* Prompt templates with Pydantic validation
* Defensive prompting: handling edge cases and adversarial input

### Part 6: Building AI-Powered APIs with FastAPI

* Designing REST endpoints for LLM-backed services
* Streaming responses with Server-Sent Events
* Async patterns for concurrent LLM calls
* Rate limiting, retry logic, and cost control

### Part 7: Evaluating and Testing AI Systems

* Why traditional testing doesn't work for AI outputs
* Building evaluation datasets from your own usage
* Automated evaluation with LLM-as-judge
* Regression testing when you change models or prompts

### Part 8: AI Engineering in Production

* Observability for LLM systems: latency, token usage, cost tracking
* Guardrails and content filtering
* Caching strategies for embedding and LLM responses
* When to use a framework vs building from scratch

***

## Prerequisites

* Python 3.11+ (we use 3.12 features throughout)
* Familiarity with FastAPI and async/await
* A GitHub Models API key or OpenAI/Anthropic API key
* Basic understanding of REST APIs and JSON

If you've read [Python 101](https://blog.htunnthuthu.com/getting-started/programming/python-101) and [REST API 101](https://blog.htunnthuthu.com/getting-started/programming/rest-api-101), you're ready.

***

## Stack

| Layer              | Technology                                |
| ------------------ | ----------------------------------------- |
| Language           | Python 3.12                               |
| API Framework      | FastAPI                                   |
| Data Validation    | Pydantic v2                               |
| HTTP Client        | httpx                                     |
| Embeddings         | sentence-transformers / GitHub Models API |
| Vector Store       | PostgreSQL 16 + pgvector                  |
| LLM Providers      | GitHub Models API, OpenAI, Anthropic      |
| Testing            | pytest + pytest-asyncio                   |
| Package Management | uv                                        |

***

## Series Structure

### Phase 1 — Foundations

| Part                                                                                                                                 | Title                           |
| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------- |
| [Part 1](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/ai-engineer-101/part-1-what-is-an-ai-engineer) | What is an AI Engineer?         |
| [Part 2](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/ai-engineer-101/part-2-python-tooling)         | Python Tooling for AI Engineers |

### Phase 2 — Core AI Concepts

| Part                                                                                                                                       | Title                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------- |
| [Part 3](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/ai-engineer-101/part-3-how-llms-work)                | How LLMs Work — What AI Engineers Need to Know |
| [Part 4](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/ai-engineer-101/part-4-embeddings-and-vector-search) | Embeddings and Vector Search                   |

### Phase 3 — Building AI Systems

| Part                                                                                                                             | Title                                     |
| -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| [Part 5](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/ai-engineer-101/part-5-prompt-engineering) | Prompt Engineering for Production Systems |
| [Part 6](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/ai-engineer-101/part-6-building-ai-apis)   | Building AI-Powered APIs with FastAPI     |

### Phase 4 — Production Readiness

| Part                                                                                                                                       | Title                             |
| ------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------- |
| [Part 7](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/ai-engineer-101/part-7-evaluating-ai-systems)        | Evaluating and Testing AI Systems |
| [Part 8](https://blog.htunnthuthu.com/ai-and-machine-learning/artificial-intelligence/ai-engineer-101/part-8-ai-engineering-in-production) | AI Engineering in Production      |
