All posts
LLM Hallucinations: Causes and Practical Countermeasures
A summary of hallucination, where LLMs confidently generate plausible falsehoods: why it follows inevitably from next-token probability prediction, the common types from factual errors to fabricated citations and code API hallucinations, the measures that actually reduce it in practice — RAG, enforced citations, tool use, structured output validation, evaluation pipelines — and the operational view of designing human review points on the premise that it can never be fully eliminated.
Python Packaging #6 Publishing: Building Wheels and Uploading to PyPI
Switching from the receiving side to the making side: the workflow that turns your code into an installable package. The src layout and the role of build backends, the difference between sdist and wheel, building with uv build and rehearsing on TestPyPI before the real upload, tokenless deployment with GitHub Actions Trusted Publishing as the modern standard, and internal-only distribution alternatives.
Embeddings and Vector Search: How Semantic Search Actually Works
A single-post summary of embeddings and vector search, the foundation of RAG and semantic search: the concept of turning text into numeric vectors, measuring semantic closeness with cosine similarity, the trade-off between exhaustive kNN and approximate ANN indexes, choosing storage between pgvector, dedicated vector databases, and search-engine extensions, where embeddings fall short on exact keyword matching and why hybrid search is the practical standard, plus operational costs like full re-indexing on model changes.
Python Packaging #5 Dependency Locking: Lock Files and Reproducibility
Starting from why declaration and lock are separate, we read the contents of uv.lock directly: the resolution result that pins every transitive dependency, the supply-chain risks hash verification blocks, reproducing the lock exactly in CI with --frozen, a strategy that turns upgrades into routine work, and pylock.toml (PEP 751), the standard that opens movement between tools.
Python Packaging #4 uv: The Standard Workflow of 2026
The daily uv workflow that folds virtual environments, dependency installation, locking, and Python version management into one tool: how init, add, sync, and run replace the manual work of earlier posts, uv installing Python interpreters themselves, isolated global tools via uvx and uv tool, and migrating existing requirements.txt projects.
Tokens and Context Windows: The Units That Decide LLM Cost and Limits
A single-post summary of tokens and context windows, the units behind every LLM price sheet and spec table: how text gets split into tokens, why non-English languages cost more tokens, the asymmetric input/output pricing and why long conversations get expensive fast, what the context window actually limits, the performance traps of very long context, and practical mitigations from prompt caching to history management.
Build a Desktop App with PySide6 #7: Packaging and Distribution — Building Executables with PyInstaller
Bundle the app with PyInstaller so it runs on computers without Python installed. The onedir vs onefile trade-off, including data files, platform-specific caveats, and pyside6-deploy — the final part of the series.
Python Packaging #3 pyproject.toml: The Standard for Project Configuration
How the era of setup.py and scattered config files converged into the single pyproject.toml: metadata and dependency declarations in the project table, separating optional features and dev tooling with extras and dependency-groups, the role of build-system, and the practical layout that gathers ruff and pytest settings under the tool table.
Build a Desktop App with PySide6 #6: Threads and Timers — Keeping the UI Responsive
See exactly why wiring a long task to a button freezes the whole window, then fix it with the QThread + Worker pattern — the canonical code that keeps the UI responsive. Also covers QTimer for periodic work.
Python Packaging #2 pip and requirements.txt: The Limits of the Traditional Workflow
How pip works and the requirements.txt workflow — and where the approach falls apart. Reading version specifiers, pip freeze's inability to distinguish direct from transitive dependencies, the reproducibility hole where unpinned installs differ by the day, and constraints files, building the case for why the next generation of tools exists.
Build a Desktop App with PySide6 #5: Model/View — Connecting Data to Lists and Tables
We hit the limits of stuffing data directly into widgets and move to Qt model/view. Subclassing QAbstractTableModel, change notification, a QSortFilterProxyModel search filter, and selection handling — all practiced on a todo table.
Python Packaging #1 Virtual Environments: Why Environments Break, and venv
Starting from the structural cause of broken Python environments: the path import searches and the conflicts born from having a single site-packages, why the system Python must be left alone and what the PEP 668 error means, isolating each project with venv, and the fact that activate is nothing more than PATH manipulation.