Bits2Bricks
Technical tutorials bridging software and physical engineering by Yago Mendoza.
- Claude Code from zero to production: A guide to configuring Claude Code past the install. CLAUDE.md carries a project's conventions into every session, and skills turn the workflows you repeat into commands. Hooks and permission rules stop destructive actions before they run. The last sections cover parallel work with subagents and agent teams, and the tools growing around the terminal. - How LLMs learn: A ground-up explanation of how language models are trained after pretraining. It sorts the techniques by where their training signal comes from, and follows them into the published DeepSeek-R1 pipeline, which interleaves them. It closes with the open question of whether RL teaches models anything their base could not already do. - Running a 35B local LLM on a laptop's integrated GPU with 64 GB of shared memory: A 35-billion-parameter mixture-of-experts model and a 27-billion-parameter dense one are run on the integrated Radeon 860M of a ThinkPad with 64 GB of LPDDR5X, through Ollama and, on the same hard-linked weights, LM Studio. On an integrated GPU the capacity is the system RAM and the speed is that RAM's bandwidth, and both models are measured on the GPU against the CPU. A first conclusion, that the GPU was slower, had to be withdrawn after three measurement errors. The model ends up as a worker that Claude Code delegates to over MCP, and the piece closes on whether the 64 GB were worth their price while memory prices climb in 2026. - LSTMs from scratch: A patient, ground-up build of the LSTM, from a single neuron to a recurrent circuit with memory. It shows how the gates edit a memory line the gradient can cross, and why the recurrent core only learns a hidden state that a separate layer reads. - MCP before and after: The Model Context Protocol turned every external service into a tool call. This is what changed for AI tooling once it did, and the attacks it opened on the developer's own machine. - Predicted and measured costs of training a character-level transformer on a CPU: A 4.75-million-parameter transformer is trained from scratch with nanoGPT on 1,976 posts by a Spanish poet, on the CPU of a laptop. The corpus is measured first and turned into one integer per character, and the run's starting loss, length, price and final loss are predicted from rules of thumb and a ten-step benchmark before anything is trained. The predictions are then checked against the run. The one that failed did so because dropout inside attention pushes PyTorch's CPU attention onto a kernel eleven times slower. - Renting an A100 on RunPod from Claude Code to fine-tune Stable Diffusion: A walk through one real rental: an A100 80GB pod on RunPod, created and driven from Claude Code to fine-tune Stable Diffusion 1.5 on 6,413 kanji. The GPU is sized from the memory the job needs, and a short test measures the speed before the long run is paid for. Four things went wrong on the way, from a CPU quota PyTorch could not see to a warning that the physical machine was failing. - SSH into a home laptop from a phone over Tailscale: A Windows laptop at home is made reachable from an iPhone anywhere, with no open router port and no rented server. The piece rebuilds the connection from below, starting from why NAT leaves the laptop unreachable and ending with what an SSH public-key login proves, with Tailscale's coordination and the hole punching that lets its WireGuard tunnel cross two NATs in between. Most of the trouble was in Windows, and the piece closes on running the laptop always on, with an estimate of its yearly energy cost. - The complete OpenClaw playbook: A setup guide for OpenClaw, the open-source agent that acts on your machine with your user's permissions. It covers how the system is put together and how to deploy it on your own hardware or on a VPS. The second half ranks every containment technique by the effort it takes and the protection it buys. - Transformers and local inference: A course from zero on the transformer and on running one locally, built around a single request: a clinical question over a 6,000-token synthetic patient history, sent to Qwen3.6 35B-A3B on a laptop with a Radeon 860M and 64 GB of shared memory. It starts from one dot product and adds one idea at a time, until the two phases of inference and their bottlenecks follow from what came before. The second half sizes the KV cache with the real numbers of a hybrid model and works out when each trick for faster decoding stops paying. Eighteen small simulations, each with one control, sit between the steps, and a standalone simulator follows the whole request. - Model-based fault detection in a two-tank system: Model-based fault detection and isolation on a two-tank hydraulic plant under closed-loop control. Thirteen component relations are reduced by structural analysis to four analytical redundancy relations, and the pattern their residuals form on Simulink runs names the faulty component. Exact signature matching fails on the pump fault; the piece traces that failure and the noise cost of differentiating level measurements before it states what a physical installation would need.