Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
Publisher · verified by editors

Machine Learning Mastery

AI news source. Articles are auto-selected and adapted by Hamidun News editors.

71 articles in Hamidun·Latest: December 2· Active·machinelearningmastery.com ↗

Latest publications

A Python Prompt Test in Under 150 Lines Catches Edits That Silently Break AI Answers
LLMMachine Learning Mastery

A Python Prompt Test in Under 150 Lines Catches Edits That Silently Break AI Answers

A walkthrough of building a Python harness under 150 lines that flags, after every prompt edit, which assistant answers have stopped working.

Dec 2, 2026·3 min
Why model.generate() Isn't a Service Yet: A Mini LLM Engine with a 4-Request Queue
LLMMachine Learning Mastery

Why model.generate() Isn't a Service Yet: A Mini LLM Engine with a 4-Request Queue

A single model.generate() call is not enough for a service. You need a queue, KV-cache memory accounting, cancellation, and metrics. A Machine Learning Mastery walkthrough of a Python mini-engine recommends vLLM.

Dec 1, 2026·3 min
How to Write an MCP Client with Python SDK 2.0 and Let Claude Call Tools
AutonomousMachine Learning Mastery

How to Write an MCP Client with Python SDK 2.0 and Let Claude Call Tools

A step-by-step tutorial: an MCP client built on Python SDK 2.0 connects a local weather server over stdio and lets Claude call its tools. Old v1 code no longer works.

Nov 30, 2026·3 min
Qwen2.5-7B Checked Its Own Work in Three Roles and Caught an Error, but Slowed Down 6.3x
AutonomousMachine Learning Mastery

Qwen2.5-7B Checked Its Own Work in Three Roles and Caught an Error, but Slowed Down 6.3x

One 7B model on Colab played author, critic and judge in turn and fixed an answer from 50 to 90, but took 16.67 s instead of 2.63 s and used 7.8x more tokens.

Nov 27, 2026·3 min
Microsoft BitNet on a Laptop CPU Delivers 34 Tokens per Second at 0.4 GB of Memory
ResearchMachine Learning Mastery

Microsoft BitNet on a Laptop CPU Delivers 34 Tokens per Second at 0.4 GB of Memory

Microsoft's BitNet stores its weights as just three values and runs on a regular CPU with no GPU. We look at how to run it and where it is stronger or weaker than 4-bit Qwen.

Nov 26, 2026·3 min
A Simple 500-Text Test: BGE Small Separated Topics 1.7 Times More Cleanly Than MiniLM
ResearchMachine Learning Mastery

A Simple 500-Text Test: BGE Small Separated Topics 1.7 Times More Cleanly Than MiniLM

A guide to embeddings: how the models differ, how much memory a million vectors takes, and how to compare two models on your own texts with a short Python script.

Nov 24, 2026·3 min
Local AI Agent in Python: Qwen3 4B and Ollama Search Your Files Without an API Key
AutonomousMachine Learning Mastery

Local AI Agent in Python: Qwen3 4B and Ollama Search Your Files Without an API Key

A step-by-step breakdown of building a Python assistant for a project folder on Qwen3 4B and Ollama. The model weighs about 2.5 GB, runs locally, and needs no API key.

Nov 23, 2026·3 min
A vLLM Request with n=4 Uses Roughly Four Times the KV Cache for Its Outputs
ResearchMachine Learning Mastery

A vLLM Request with n=4 Uses Roughly Four Times the KV Cache for Its Outputs

According to a Machine Learning Mastery breakdown, vLLM with n=4 runs four responses at once and holds roughly four times the KV cache, while top-k and top-p barely save any compute.

Nov 22, 2026·3 min
TabPFN-3.5 Tops the TabArena Leaderboard, but Boosting Wins on Very Large Tables
HardwareMachine Learning Mastery

TabPFN-3.5 Tops the TabArena Leaderboard, but Boosting Wins on Very Large Tables

The pretrained tabular model TabPFN-3.5 ranks first on TabArena for small and medium datasets, but it is capped at 1 million rows and needs a GPU. Here is what to choose in 2026.

Nov 21, 2026·3 min
Operator Fusion and FlashAttention: Keeping GPUs from Idling While They Wait for Memory
LLMMachine Learning Mastery

Operator Fusion and FlashAttention: Keeping GPUs from Idling While They Wait for Memory

Language model inference on a GPU is often slowed not by math but by memory traffic and launching many small operations. Operator fusion, FlashAttention, and CUDA Graphs address this.

Nov 21, 2026·4 min
LLM Compression Without Quantization: Pruning Cuts MLP Width from 8192 to 2048 Channels
HardwareMachine Learning Mastery

LLM Compression Without Quantization: Pruning Cuts MLP Width from 8192 to 2048 Channels

Quantization isn't the only way to cut inference costs: pruning and distillation shrink the model itself. In a teaching example, an MLP block is compressed from 8192 to 2048 channels, a 4x reduction.

Nov 21, 2026·3 min
How to Serve a Local Llama 3 Classifier via FastAPI Without Paid Clouds
LLMMachine Learning Mastery

How to Serve a Local Llama 3 Classifier via FastAPI Without Paid Clouds

Scikit-LLM turns a local Llama 3 into a regular classifier with fit and predict, and FastAPI serves it over HTTP, with no paid cloud API and no fine-tuning.

Nov 21, 2026·3 min
How to Compress an LLM to 8 Bits End to End: SmoothQuant and FP8 Against Outliers
ResearchMachine Learning Mastery

How to Compress an LLM to 8 Bits End to End: SmoothQuant and FP8 Against Outliers

Quantizing LLM weights to 8 bits is straightforward, but activations are harder because they change with every request. We break down W8A8, SmoothQuant and FP8, and how to run them through LLM Compressor and vLLM.

Nov 21, 2026·3 min
Quantization Makes INT8 LLM Weights Half the Size of FP16: A TorchAO Guide
HardwareMachine Learning Mastery

Quantization Makes INT8 LLM Weights Half the Size of FP16: A TorchAO Guide

Every token an LLM generates requires rereading all of its weights from memory. Here's how 8-bit integers (INT8) halve that footprint and what to check before you deploy.

Nov 21, 2026·3 min
Graph-RAG: Database Beats Wiki and PDFs — 44% Fewer Hallucinations on Average
AutonomousMachine Learning Mastery

Graph-RAG: Database Beats Wiki and PDFs — 44% Fewer Hallucinations on Average

How to build Graph-RAG from a live database, wiki and PDFs with strict priorities: on conflict, the assistant trusts the database. IDC estimates graph context cuts hallucinations by 44%.

Nov 18, 2026·3 min
Schema Passed, Invoice Total Off by 10x: How to Validate LLM Structured Output
LLMMachine Learning Mastery

Schema Passed, Invoice Total Off by 10x: How to Validate LLM Structured Output

Pydantic accepted the model's response, the schema matched, and yet EUR 1,250 on the invoice turned into 125. Here is how to catch such errors: validation against the source, bounded retries, and constrained decoding.

Nov 12, 2026·3 min
How to Lock Down AI Agent Code: subprocess, Docker and microVM — Three Levels of Protection
AutonomousMachine Learning Mastery

How to Lock Down AI Agent Code: subprocess, Docker and microVM — Three Levels of Protection

An agent that writes and runs code is only as safe as the place where that code runs. We break down three levels of isolation, from subprocess to Firecracker, and the price of each.

Nov 12, 2026·3 min
How Much Memory a Model Will Eat: How GQA, Sliding Windows, and MLA Change the KV-Cache
HardwareMachine Learning Mastery

How Much Memory a Model Will Eat: How GQA, Sliding Windows, and MLA Change the KV-Cache

Two models with the same parameter count can need very different amounts of inference memory. Here is how the KV-cache works and how to estimate how many requests your GPU can handle.

Nov 12, 2026·3 min
Groq processed five reviews in 2 seconds, Ollama in 81: what the test leaves out
LLMMachine Learning Mastery

Groq processed five reviews in 2 seconds, Ollama in 81: what the test leaves out

Where should you classify reviews: on your own computer or through an API? A tutorial test found a nearly 40-fold difference, but compared different models. Here is what is worth checking on your own data.

Nov 9, 2026·2 min
Unsloth Turns Qwen3.5-4B Into a 10-Intent Classifier on a Single T4
ResearchMachine Learning Mastery

Unsloth Turns Qwen3.5-4B Into a 10-Intent Classifier on a Single T4

When a model needs to choose the next action rather than produce an eloquent response, generation becomes unnecessary. Unsloth proposes training Qwen3.5-4B to identify a user's intent and return a confidence score.

Nov 8, 2026·2 min
16-bit formats halve model weight memory without changing the architecture
HardwareMachine Learning Mastery

16-bit formats halve model weight memory without changing the architecture

The same AI model can take up 28 GB or 14 GB—the number format makes all the difference. But blindly switching to fewer bits can slow the model down and degrade its responses.

Nov 8, 2026·3 min
Google's DiffusionGemma writes text in blocks of 256 tokens at once, rather than one at a time
ResearchMachine Learning Mastery

Google's DiffusionGemma writes text in blocks of 256 tokens at once, rather than one at a time

Google has released an experimental open model that does not type word by word, but instead “develops” an entire paragraph out of noise. Here is how to run it and how it differs from conventional LLMs.

Nov 8, 2026·2 min
pgvector vs Qdrant: a benchmark on 100 000 vectors with 1536 dimensions
BusinessMachine Learning Mastery

pgvector vs Qdrant: a benchmark on 100 000 vectors with 1536 dimensions

Machine Learning Mastery offers a reproducible pgvector vs Qdrant test: identical HNSW, 1536 dimensions, 100 thousand vectors, p50/p95/p99 and QPS on an ordinary laptop.

Oct 29, 2026·3 min
Your Own LLM Test Harness in Python: 4 Modules and About 60 Lines of Code
LLMMachine Learning Mastery

Your Own LLM Test Harness in Python: 4 Modules and About 60 Lines of Code

How to build a custom LLM test harness with 20–50 real prompts, async runs, two kinds of judges, and a log that lets you rescore results without new API calls.

Oct 27, 2026·3 min
Machine Learning Mastery shows how to build RAG on scikit-learn without a vector database
LLMMachine Learning Mastery

Machine Learning Mastery shows how to build RAG on scikit-learn without a vector database

Machine Learning Mastery walks through a lightweight end-to-end RAG pipeline: open-model embeddings, vector search in scikit-learn, and answer generation from retrieved context.

Oct 13, 2026·3 min
Unsloth and Llama 3: How to Teach a Model to Call APIs Reliably via JSON
LLMMachine Learning Mastery

Unsloth and Llama 3: How to Teach a Model to Call APIs Reliably via JSON

Machine Learning Mastery walks through fine-tuning Llama 3 for strict JSON tool calling with Unsloth: a general-purpose model breaks API schemas, and LoRA helps fix that.

Oct 9, 2026·3 min
How to Build a Browser AI Agent in Python: A Step-by-Step Guide from Machine Learning Mastery
LLMMachine Learning Mastery

How to Build a Browser AI Agent in Python: A Step-by-Step Guide from Machine Learning Mastery

Machine Learning Mastery has published a guide to building Python agents that control a browser: they open sites, click and fill in forms without an official API.

Aug 29, 2026·3 min
Transformers.js and Embeddings: Semantic Search Without Server Infrastructure
LLMMachine Learning Mastery

Transformers.js and Embeddings: Semantic Search Without Server Infrastructure

Machine Learning Mastery shows how to replace keyword search with semantic search using Transformers.js, a browser library that builds vector embeddings on the client with no server API.

Aug 29, 2026·2 min
Agentic AI Pipeline: 7 Components That Separate Production from a Demo
AutonomousMachine Learning Mastery

Agentic AI Pipeline: 7 Components That Separate Production from a Demo

Machine Learning Mastery has published a guide to seven architectural components that set a production agentic AI system apart from an ordinary demo script.

Aug 1, 2026·2 min
How AI Agents Manage the Context Window on Long-Running Tasks: Five Strategies
AutonomousMachine Learning Mastery

How AI Agents Manage the Context Window on Long-Running Tasks: Five Strategies

Machine Learning Mastery breaks down five practical context-window strategies for AI agents that run for hours and hit a model's token limit.

Jul 19, 2026·2 min