Real Python (@realpython) header
Real Python (@realpython) profile picture

Helping Python developers build with AI: apps, agents, models, and AI-assisted coding. Expert-reviewed tutorials and courses, read by 1M+ developers a month.

Joined August 2012
Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)
Win three years of Real Python, plus all four of our Python books. That's our Black Friday giveaway. Entering is free, you just need a free Real Python account. Entries close Friday, November 27. realpython.com/blackfriday?u…
1
1
1
9
1,980
💾 vLLM KV cache on NVMe matches DRAM AMD and Embedded LLM report that an NVMe KV cache using open-source MoRI UMBP matched a same-size DRAM pool within 1% on Kimi-K3, tested on AMD MI355X GPUs. A 1.8 TB DRAM pool costs about $76,000.
1
297
⚛️ DeepMind's agents find faster quantum algorithms Teams of Gemini 4 agents cut the cost of known quantum algorithms, and every result is proved in Lean. By DeepMind's cost measure, one fusion problem gets 11.8x cheaper. The paper, Lean library, and solutions are on GitHub.
1
33
📄 LlamaIndex's OCRia-nano-1 document parser for CPUs LlamaIndex releases open weights: seven models, 8.1M parameters in total, inside LiteParse. It reports 426 ms per page on one CPU core, twice the throughput of LiteParse's default Tesseract OCR. License: modified Open RAIL-M.
1
29
🛡️ Shirudo, OpenAI and Cisco's open-source exploit shield A BSD-licensed eBPF runtime that blocks exploits on running Linux without a restart. In OpenAI's example, Codex shields a live Elasticsearch process from Java4Shell. Pre-release, with kernel and TPM 2.0 requirements.
1
1
45
🚢 Anthropic's Claude Ship beta for pull requests A new /ship command in Claude Code pushes, opens, reviews, and fixes a pull request. Claude Approvals can approve routine changes on its own, following a policy file in your repo. Beta for Team and Enterprise plans on GitHub.
1
1
51
AI agents get closer to production: Claude Ship reviews and approves pull requests, and Codex writes Shirudo shields for unpatched Linux servers. Plus cheaper ways to run models, on one CPU core or from an SSD 🧵
2
3
1,325
Ever read "Model-View-Controller" and nodded without really getting it? Exploring the MVC Pattern in Python follows one user request through an app, then you build a small Flask app with it. realpython.com/courses/explo…
1
1
7
1,271
New to Git and not sure which commands you need? This beginner cheat sheet is one to keep open while you learn. Grab the PDF 👇 realpython.com/bonus/how-to-…
1
5
1,594
5. You don't need a new SDK. The tutorial uses plain requests with an Authorization: Bearer header. Already on the OpenAI SDK? Point base_url at OpenRouter's /api/v1 endpoint, pass your OpenRouter API key, and use model IDs like openai/gpt-3.5-turbo.
1
1
447
4. requests.post() doesn't raise when OpenRouter sends back an error, like a request your free credits don't cover. So check the parsed JSON for a "model" key before you read the answer, or call response.raise_for_status() first. The tutorial does both.
1
36
3. Set "model": "openrouter/auto" and OpenRouter picks both the model and the provider. For a one-sentence hello prompt, the tutorial got an answer from mistralai/mistral-nemo. The response's "model" field tells you which model actually answered.
1
22
2. One model is often served by several providers at different prices and speeds. Add "provider": {"sort": "price"} to the payload for the cheapest. "throughput" and "latency" are the other options. The tutorial's Llama 3.1 70B request went to a provider called Hyperbolic.
1
1
39
1. In an OpenRouter request, pass "models" (a list) instead of "model", and OpenRouter tries each one in order until one answers. The tutorial's list starts with openai/gpt-5. The answer came from openai/gpt-3.5-turbo, next in line. You don't write the retry loop.
1
1
53
If your Python app calls one hard-coded AI model, that provider's outage is your outage. OpenRouter puts many providers behind one API key: 1. Fallbacks in one field 2. Cheapest provider per model 3. Let it pick the model 4. Errors that don't raise 5. No new SDK 🧵
1
14
3,197