Web Development

Build web apps and services with tested examples: HTTP, REST APIs, servers, routing, and templating across the Python and Groovy tutorials.

LLM Cost Optimization: Tokens, Caching, and Model Tiers

AI features rarely die because the model was not smart enough. They die in a budget review. LLM cost optimization is how you stop that meeting from happening: know what each request costs, cache the prefix you keep resending, batch the jobs nobody is waiting on, and route easy work to cheap models. This post works all four levers in runnable Python, plus a guard that catches runaway spend. “Optimization hinders evolution.” Alan Perlis, Epigrams on Programming Last Updated: July ... Read More

Streamlit Tutorial: Turn a Python Script into a Data App

Ten lines of plain Python is all it takes to turn a data script into a web app your teammate can open in a browser. That is what this Streamlit tutorial shows you: no HTML, no JavaScript, no front-end framework. You write Python, add a few Streamlit calls, and it draws the buttons, sliders, charts, and tables. By the end you will have a data explorer with upload, filters, a live chart, and a metrics row, and know how to ... Read More

Python Profiling: Find Slow Code with cProfile and py-spy

Python profiling is how you find the slow parts of your code with evidence instead of a hunch. This guide shows you the three tools that matter, cProfile for the big picture, timeit for tiny measurements, and py-spy for a program that is already running, then walks you through reading a flame graph and fixing the hotspots for a real, measured speedup. “Measure. Do not tune for speed until you have measured, and even then do not unless one part ... Read More