generative-ai

Tutorials on generative AI with Python, from prompting LLMs to building your own AI-powered apps.

LLM Serving: Ollama Locally, vLLM in Production

Renting tokens from an API is easy; the bill and the data both leave the building. LLM serving is the craft of running an open Large Language Model yourself, fast enough for real users, and this post walks both ends of it with tested Python: Ollama on your laptop for development, vLLM in production, plus the KV-cache math that decides how many users one Graphics Processing Unit (GPU) can actually hold. “The cheapest, fastest, and most reliable components are those ... Read More

Build an MCP Server in Python (FastMCP, Step by Step)

Write a useful function once and every AI assistant should be able to call it: Claude Desktop, your editor, your own agent loop. That is exactly what you get when you build MCP server tooling around code you already trust. In this workshop we wrap the access-log parser and the bookmark Application Programming Interface (API) from earlier posts into one FastMCP server with three tools, a resource, and a prompt, all offline. “Write the tool once, then let every assistant ... Read More

Model Context Protocol (MCP): Connect Your AI to Anything

The Model Context Protocol is a single, open way for an AI app to talk to outside tools, files, and data, so you stop writing custom glue for every new integration. Think of it like the USB port on your laptop. Before USB, every device had its own weird plug. After USB, one shape fits the mouse, the drive, the keyboard. MCP does the same thing for AI: one protocol, and any tool that speaks it plugs straight in. You ... Read More