Learn Python - Free Tutorials & AI Guides

Free Python Tutorials, AI Guides & Coding Projects

pdf-inspector: Fast Rust PDF Classification and Text Extraction

pdf-inspector: Fast Rust PDF Classification and Text Extraction

pdf-inspector: Fast Rust PDF Classification and Text Extraction PDFs are the lingua franca of business documents - invoices, research papers, legal contracts, financial reports - yet extracting structured text from them remains surprisingly painful. The hard problem is not parsing...

MiniMind: Train a 64M-Parameter LLM From Scratch in 2 Hours

MiniMind: Train a 64M-Parameter LLM From Scratch in 2 Hours

MiniMind: Train a 64M-Parameter LLM From Scratch in 2 Hours Most introductions to large language models stop at calling a transformers API: load a pretrained checkpoint, attach a LoRA adapter, and fine-tune on a small dataset. While useful, this skips...

Catch2: The Natural C++ Testing Framework with Expression Decomposition

Catch2: The Natural C++ Testing Framework with Expression Decomposition

Catch2: The Natural C++ Testing Framework with Expression Decomposition Testing C++ code should not feel like writing boilerplate. Catch2, the second most popular C++ unit testing framework according to the 2022 JetBrains C++ ecosystem survey, is built on the principle...

abseil-cpp: Google's Foundation C++ Libraries for the Modern Standard

abseil-cpp: Google's Foundation C++ Libraries for the Modern Standard

abseil-cpp: Google’s Foundation C++ Libraries for the Modern Standard When you use protobuf, gRPC, OpenTelemetry C++, or any of Google’s open-source C++ projects, you are using Abseil. abseil-cpp is Google’s collection of C++ common libraries, battle-tested in Google’s own codebase,...

yaml-cpp: A Complete YAML 1.2 Parser and Emitter in C++

yaml-cpp: A Complete YAML 1.2 Parser and Emitter in C++

yaml-cpp: A Complete YAML 1.2 Parser and Emitter in C++ YAML is the configuration format of choice for countless projects, from Kubernetes manifests to CI/CD pipelines, CLAUDE.md agent instructions, and application configs. Behind many C++ projects that read or write...

meshoptimizer: Making 3D Meshes Smaller and Faster to Render

meshoptimizer: Making 3D Meshes Smaller and Faster to Render

meshoptimizer: Making 3D Meshes Smaller and Faster to Render Every time a GPU renders a 3D triangle, it runs a multi-stage pipeline: fetch vertex data from memory, run the vertex shader, rasterize the triangle into pixels, then run the pixel...

PyShine Screen Recorder: Native C++ Engine for Perfect A/V Sync

PyShine Screen Recorder: Native C++ Engine for Perfect A/V Sync

PyShine Screen Recorder: Native C++ Engine for Perfect A/V Sync Screen recording seems simple until you try to build one. The moment you combine audio and video capture on Windows, you discover the painful realities of thread scheduling, the Python...

Needle 2: A 14MB Foundation Model for Tiny Devices

Needle 2: A 14MB Foundation Model for Tiny Devices

Needle 2: A 14MB Foundation Model for Tiny Devices Needle 2 is an open 45-million-parameter model built by Cactus Compute that does one thing exceptionally well: tool calling. The entire model, weights and engine combined, ships as a single 14MB...

dotnet/skills: Microsoft's 80+ AI Agent Skills for .NET, C#, and MSBuild, Explained

dotnet/skills: Microsoft's 80+ AI Agent Skills for .NET, C#, and MSBuild, Exp...

dotnet/skills: Microsoft’s 80+ AI Agent Skills for .NET, C#, and MSBuild, Explained When Microsoft’s .NET team decided to teach AI coding agents how to work with C#, MSBuild, Blazor, MAUI, and the entire .NET ecosystem, they did not write a...

System Prompts Leaks: The Hidden Rules Powering ChatGPT, Claude, Gemini, Grok & 30+ AI Agents, Exposed

System Prompts Leaks: The Hidden Rules Powering ChatGPT, Claude, Gemini, Grok...

System Prompts Leaks: The Hidden Rules Powering ChatGPT, Claude, Gemini, Grok & 30+ AI Agents, Exposed “The chat before the chat” is the industry joke for the system prompt. For most end users it is invisible. But a single open-source...

OfficeCLI - The Office Suite Built for AI Agents

OfficeCLI - The Office Suite Built for AI Agents

OfficeCLI - The Office Suite Built for AI Agents Every AI agent that tries to create a Word document, an Excel spreadsheet, or a PowerPoint presentation today runs into the same wall. Either it shells out to 50 lines of...

LLM Alignment: RLHF, DPO, and How Models Learn to Be Helpful

LLM Alignment: RLHF, DPO, and How Models Learn to Be Helpful

LLM Alignment: RLHF, DPO, and How Models Learn to Be Helpful A pretrained large language model is an incredible statistical achievement. It has absorbed trillions of tokens of human knowledge and can predict the next token with astonishing accuracy. But...

Parameter-Efficient Fine-Tuning: LoRA, QLoRA, and Adapter Methods

Parameter-Efficient Fine-Tuning: LoRA, QLoRA, and Adapter Methods

Parameter-Efficient Fine-Tuning: LoRA, QLoRA, and Adapter Methods In 2021, Microsoft Research introduced a paper with a quiet revolution inside its title: “LoRA: Low-Rank Adaptation of Large Language Models.” Two years later, a follow-up paper added three letters – QLoRA –...

Mixture of Experts: How LLMs Scale to Trillions Without Slowing Down

Mixture of Experts: How LLMs Scale to Trillions Without Slowing Down

Mixture of Experts: How LLMs Scale to Trillions Without Slowing Down Every token you generate with GPT-4, DeepSeek-V3, or Mixtral activates only a fraction of the model’s parameters. A 671-billion-parameter model can run at the speed of a 37-billion-parameter model...

Positional Encoding: How LLMs Know Word Order Without Recurrence

Positional Encoding: How LLMs Know Word Order Without Recurrence

Positional Encoding: How LLMs Know Word Order Without Recurrence Recurrent neural networks processed tokens one at a time, left to right. The order of words was baked into the computation graph. When the Transformer [1] replaced recurrence with self-attention in...

MCP vs API: Why Traditional REST Endpoints Are Failing AI Agents

MCP vs API: Why Traditional REST Endpoints Are Failing AI Agents

MCP vs API: Why Traditional REST Endpoints Are Failing AI Agents Before 2023, giving software access to a third-party service was a solved problem. You read the REST docs, pulled an API key, wrote a wrapper class, and called it...

LLM Sampling and Decoding Strategies: Temperature, Top-k, Top-p, Min-p, and Beam Search

LLM Sampling and Decoding Strategies: Temperature, Top-k, Top-p, Min-p, and B...

LLM Sampling and Decoding Strategies: Temperature, Top-k, Top-p, Min-p, and Beam Search A language model does not output text. At every generation step it outputs a vector of raw scores – one logit per token in its vocabulary, often 32,000...

LLM Quantization: Running 70B Models on a Laptop with FP16, INT8, and INT4

LLM Quantization: Running 70B Models on a Laptop with FP16, INT8, and INT4

LLM Quantization: Running 70B Models on a Laptop with FP16, INT8, and INT4 A Llama-2 70B model in FP32 precision requires 280 GB of GPU memory – far more than any single consumer GPU can provide. Quantization compresses those weights...

I Built an LLM From Scratch: 30M Parameters, 4 Hours, 1 GPU

I Built an LLM From Scratch: 30M Parameters, 4 Hours, 1 GPU

I Built an LLM From Scratch: 30M Parameters, 4 Hours, 1 GPU There is a particular kind of understanding that only comes from building the thing yourself. I have written about tokenizers, attention, KV-caches, and sampling in this series –...

LLM Training Pipeline: From Pretraining to RLHF and DPO

LLM Training Pipeline: From Pretraining to RLHF and DPO

LLM Training Pipeline: From Pretraining to RLHF and DPO A capable LLM like Llama-3 or GPT-4 is not born in a single training run. It is built in three distinct stages, each with different data, objectives, and compute requirements. The...

LLM Tokenization: How Text Becomes Numbers

LLM Tokenization: How Text Becomes Numbers

LLM Tokenization: How Text Becomes Numbers Large language models do not read text. They process sequences of integers. Before a single token of your prompt reaches the transformer layers, it must pass through a tokenizer – a deterministic algorithm that...

LLM Prompt vs Decode: Understanding the Two Phases of LLM Inference

LLM Prompt vs Decode: Understanding the Two Phases of LLM Inference

LLM Prompt vs Decode: Understanding the Two Phases of LLM Inference When you send a request to a large language model – whether through ChatGPT, a local Ollama instance, or a production API – the model does not process your...

LLM Decode Deep Dive: KV-Cache, GPU VRAM, and the Memory Bottleneck

LLM Decode Deep Dive: KV-Cache, GPU VRAM, and the Memory Bottleneck

LLM Decode Deep Dive: KV-Cache, GPU VRAM, and the Memory Bottleneck In the previous post, we established that LLM inference has two phases: prompt (prefill) and decode. We learned that prefill is compute-bound while decode is memory-bandwidth-bound. But we did...

LLM Attention Mechanism: The Heart of the Transformer

LLM Attention Mechanism: The Heart of the Transformer

LLM Attention Mechanism: The Heart of the Transformer If the transformer is the engine of modern AI, attention is its combustion chamber. Every breakthrough in large language models – from GPT to Llama to Gemini – is built on the...

Watch PyShine on YouTube