<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Serge Parel on Medium]]></title>
        <description><![CDATA[Stories by Serge Parel on Medium]]></description>
        <link>https://medium.com/@sparel?source=rss-16c2ce99df95------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ico97eA_bWmeyJPwexxl1A.png</url>
            <title>Stories by Serge Parel on Medium</title>
            <link>https://medium.com/@sparel?source=rss-16c2ce99df95------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:54:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sparel/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[I Remember the Scene, Not the Folder]]></title>
            <link>https://medium.com/@sparel/i-remember-the-scene-not-the-folder-ad3a645e91d0?source=rss-16c2ce99df95------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad3a645e91d0</guid>
            <category><![CDATA[self-hosted]]></category>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[photography]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Serge Parel]]></dc:creator>
            <pubDate>Sat, 05 Dec 2026 19:25:28 GMT</pubDate>
            <atom:updated>2026-12-05T19:34:46.654Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Local AI captions, labels and semantic search for a growing NAS photo library, built with PhotoPrism, a DGX Spark, a Raspberry Pi and a graphics card from 2017.</em></p><figure><img alt="Seven waterfalls from my photo archive, taken in Iceland, Ticino and Madeira, arranged as a mosaic beneath a search bar that reads “a waterfall surrounded by green mountains”." src="https://cdn-images-1.medium.com/max/1024/1*gWNHk58j3HKupCWnf3v6NQ.jpeg" /><figcaption><em>One sentence, no tags, no folder names: some of the waterfalls it found in my archive.</em></figcaption></figure><p>My photos live on a NAS. For a long time they were a loose pile: exports from my iPhone, memory cards, backup CDs and DVDs and the odd shared album. Over the past months I have started to put some order into it, one folder per holiday, named by place and year: <em>Iceland 2019</em>, <em>SouthAfrica 2015</em>, <em>Prag 2007</em>. Every few weeks I add another batch, sometimes recovered from an old archive and sometimes just offloaded from my phone. The library has now grown to around 9,000 photos.</p><p>Folders work well when I know which trip I am looking for. They work less well when what I remember is a scene. A waterfall with green mountains behind it: was that Iceland, or South Africa? One of those old European towns with cobblestones, pastel facades and a church tower above red roofs: which city trip was that? No filename says “narrow cobbled street with pastel houses”, and I had no intention of tagging thousands of photos by hand.</p><p>So I set myself a simple goal. I wanted to describe a photo in a sentence and get it back, without manual tagging and without sending my photos to a cloud service.</p><p>Today I can type <em>a waterfall surrounded by green mountains</em> into a search box and get a grid of waterfalls back. A local AI model has looked at every photo, described it and labelled it, and two embedding models have turned those photos and descriptions into something a vector database can search by meaning. All of it runs on hardware at home, and the folders on the NAS look exactly as they did before.</p><p>Below is how it is put together, including the parts that didn’t work the first time, and a repository if you want to build something similar.</p><h3>A photo manager that leaves my folders alone</h3><p>The two obvious choices for self-hosted photo management are Immich and PhotoPrism. Immich is polished, has excellent phone backup, and is what most people will recommend. My requirement was slightly different. I didn’t want a new photo library; I wanted a catalogue for the one I was building on the NAS. The folder tree is the archive. I organise it myself, my backup jobs know it, and my photo editing apps can still open it.</p><p>PhotoPrism is built around exactly that idea. You point it at an “originals” directory and it indexes the files in place, keeping every file and folder name. Its import function, which would reorganise files into its own structure, is optional, and I don’t use it. PhotoPrism also reads the metadata that is already there, from EXIF and XMP sidecars to Google Photos JSON, so capture dates, camera models and GPS positions were searchable from the very first index. I mount the NAS share into PhotoPrism read-only, so it could not move or rename anything even if it wanted to.</p><p>To be fair to Immich, it can also index existing folders as an “external library”. The difference that mattered to me is what happens to new photos. Immich’s phone backup always uploads into its own managed library, and its maintainers recommend keeping that separate from external libraries. I want new photos, whether they come from my phone or from an old hard disk, to land in the same curated tree as everything else, and the catalogue simply to follow along. PhotoPrism’s model fits that better.</p><p>There was also something I didn’t have to think about at all. Recent iPhone photos arrive as HEIC files, a format plenty of tools still stumble over. PhotoPrism indexes them alongside the JPEGs from older cameras and, because my share is read-only, writes a converted JPEG into its own sidecar folder instead of next to the original. That mattered later: every step I added afterwards, from the caption model to the visual embeddings, could assume a JPEG and never had to learn about HEIC.</p><p>The setup itself is unspectacular. PhotoPrism and its MariaDB database run as Docker containers in a virtual machine on my Proxmox server. The NAS share comes in over read-only NFS, while the database and thumbnails live on the VM’s local SSD. On the first evening I learned that an NFS share that failed to mount looks exactly like an empty folder. That is not something you want an indexer to discover on its own, and it is the first thing my automation checks today.</p><h3>“OpenAI” doesn’t have to mean OpenAI</h3><p>Out of the box, PhotoPrism tags photos with a small built-in image classifier. It is useful, but coarse; in my library, a large share of everything ended up as “landscape”. Then I came across PhotoPrism’s vision features. It can generate captions and labels with large language models, configured in a file called vision.yml.</p><p>What took me a moment to realise is how open that integration is. PhotoPrism’s openai engine simply speaks the OpenAI API. If you point the OPENAI_BASE_URL environment variable at <em>any</em> OpenAI-compatible server, PhotoPrism sends its photos there instead of to OpenAI. A feature that looks like a cloud service can run entirely at home.</p><p>And I already had such an endpoint. Earlier this year I set up a small AI lab. An NVIDIA DGX Spark serves models with vLLM, and a LiteLLM gateway running on a Raspberry Pi 5 gives every machine in the house a single OpenAI-compatible address, with model aliases and API keys. The model I use for photos is Ornith-1.5-35B-A3B, a vision-capable mixture-of-experts model with about 35 billion parameters, of which only around 3 billion are active for each token. That makes it fast for its size. I run its FP8 build (ornith-ai/Ornith-1.5-35B-A3B-FP8), whose 8-bit weights take roughly 35 GB and leave most of the Spark’s 128 GB of unified memory for the context cache.</p><p>Connecting the two took two small changes. The first goes into PhotoPrism’s Compose file:</p><pre>photoprism:<br>  environment:<br>    OPENAI_BASE_URL: &quot;http://&lt;litellm-host&gt;:4000/v1&quot;<br>    OPENAI_API_KEY: &quot;${PHOTO_LITELLM_KEY}&quot;</pre><p>Make sure those lines end up under the photoprism service. I first pasted them under mariadb, where the database ignored them politely and PhotoPrism never saw them.</p><p>The second change was a dedicated alias in LiteLLM. Ornith is a reasoning model, and my first test caption arrived after 691 tokens of careful deliberation. With thinking switched off, the same request produced a clean 34-token answer. A photo caption does not need an inner monologue, so PhotoPrism gets its own route with reasoning disabled, while every other client of the lab keeps the default:</p><pre>model_list:<br>  - model_name: photoprism-caption<br>    litellm_params:<br>      model: openai/served-model<br>      api_base: http://&lt;vllm-host&gt;:8000/v1<br>      api_key: none<br>      extra_body:<br>        chat_template_kwargs:<br>          enable_thinking: false</pre><p>PhotoPrism sends its requests to LiteLLM’s /v1/responses endpoint, and LiteLLM forwards them to vLLM on the Spark. Neither PhotoPrism nor vLLM needs to know about the other.</p><p>A word on hardware, because the Spark is not a requirement. PhotoPrism neither knows nor cares what sits behind the endpoint. Any vision-capable model will do, as long as three things hold: it accepts images through an OpenAI-compatible API, it follows a prompt closely enough to keep to a word budget, and it returns valid JSON reliably enough for the labels. vLLM, llama.cpp’s llama-server, Ollama and LM Studio can all serve such a model. One detail is worth checking: PhotoPrism talks to the newer /v1/responses endpoint, and not every local server implements it yet. A gateway like LiteLLM can translate those requests into ordinary chat completions, which is one more reason I keep one in front of everything.</p><p>The hardware question is mostly about memory, and quantization sets how much you need. As a rule of thumb, the weights need the number of parameters times the bytes stored per parameter. A 35-billion-parameter model takes around 70 GB at 16-bit precision, about 35 GB at 8-bit (the FP8 build on my Spark) and roughly 20 GB at 4-bit, plus some room for the image encoder and the context cache. A mixture-of-experts model must keep all of its experts in memory, even though only a few work on each token, so it is cheap in compute but not in memory. On a single consumer GPU, a smaller dense vision model in the 7 to 12 billion parameter range, quantized to 4 or 5 bits (a Q4_K_M GGUF for llama.cpp or Ollama, or an AWQ build for vLLM), fits into 8 to 12 GB of VRAM. A Mac with enough unified memory is another good option. With llama.cpp, remember that vision models ship with a separate projector file (mmproj) that has to be loaded alongside the weights.</p><p>Expect trade-offs. Smaller models write plainer captions, miss more small details and break the JSON format more often, and aggressive quantization makes all of that a little worse. The timings later in this post come from the Spark and won’t transfer to other hardware. The prompts will, though, and the best test is the one I used myself: run five of your own photos through it and read the results.</p><h3>Teaching the model to write for search</h3><p>With the plumbing in place, the real work was the prompts. A caption written for a human reader (“A beautiful day in the mountains!”) is useless for search. I wanted a description written for a future version of me who remembers a scene but not a folder. After a few rounds of testing on real photos, this is the caption prompt I kept:</p><pre>- Type: caption<br>  Model: photoprism-caption<br>  Engine: openai<br>  Run: manual<br>  Prompt: &gt;<br>    You are an expert visual archivist describing photographs<br>    for a searchable personal photo collection.<br>    Write a detailed, factual description in 2 to 4 sentences<br>    (approximately 50 to 100 words).<br>    Identify the main subjects and describe distinctive visual<br>    details such as architecture, materials, colors, objects,<br>    landscape features, clothing, activities, and composition.<br>    Transcribe clearly readable signs, inscriptions, or labels<br>    when they add useful context.<br>    Mention recognizable landmarks, architectural styles, or<br>    locations only when supported by clear visual evidence.<br>    Do not invent locations, dates, identities, or historical facts.<br>    Prioritize specific information that would help someone<br>    find this photograph through a semantic search.<br>    Output only the finished description, with no introductory<br>    phrases, reasoning, or commentary.<br>  Options:<br>    Detail: low<br>    Temperature: 0.2</pre><p>Two lines in there do most of the work. “Prioritize specific information that would help someone find this photograph” steers the model towards materials, colours and landscape features, which is exactly what I type when I search. “Do not invent locations” matters just as much. Vision models love to guess, and a confidently wrong “Lake Geneva” in a caption is worse than no location at all. The low temperature keeps the descriptions factual and consistent from one photo to the next.</p><p>Labels are a second, separate request to the same model. They don’t describe the scene; they give PhotoPrism short, structured terms for browsing and filtering, returned as JSON in the format PhotoPrism expects:</p><pre>- Type: labels<br>  Model: photoprism-caption<br>  Engine: openai<br>  Run: manual<br>  Resolution: 1280<br>  System: &gt;<br>    You are a visual tagging engine for a personal photography archive.<br>    Identify distinctive, clearly visible subjects and concepts.<br>    Return only structured label data matching the requested JSON schema.<br>    Use short, singular English nouns as label names.<br>    Do not include reasoning, explanations, or commentary.<br>  Prompt: &gt;<br>    Analyze this photograph and return up to 8 label objects<br>    with name, confidence (0-1), and topicality (0-1).<br>    Prioritize specific objects, architecture, animals, plants,<br>    landscapes, activities, and readable visual concepts.<br>    Avoid generic labels such as image, photo, travel, or outdoors.<br>    Do not invent places, identities, or objects.<br>  Options:<br>    Detail: high<br>    Temperature: 0.2</pre><p>For a waterfall photo, the answer looks something like this (illustrative, shortened):</p><pre>{&quot;labels&quot;: [<br>  {&quot;name&quot;: &quot;waterfall&quot;, &quot;confidence&quot;: 0.97, &quot;topicality&quot;: 0.95},<br>  {&quot;name&quot;: &quot;mountain&quot;,  &quot;confidence&quot;: 0.92, &quot;topicality&quot;: 0.70},<br>  {&quot;name&quot;: &quot;cliff&quot;,     &quot;confidence&quot;: 0.85, &quot;topicality&quot;: 0.55}<br>]}</pre><p>The “avoid generic labels” line matters. Without it, almost every holiday photo was labelled “travel”, which is true and tells you nothing.</p><p>The two outputs complement each other. A caption can express relationships, such as a waterfall <em>below</em> a ridge or houses <em>around</em> a square, while labels give me clean facets to click on in PhotoPrism. Both are stored as ordinary PhotoPrism metadata, so they are visible and editable in its interface like anything else.</p><figure><img alt="PhotoPrism’s detail view of a white monument on a stone base against a blue sky, with a tall cross between two blue shields, each pierced by five small squares. The sidebar shows the generated caption describing it and labels including Architecture, Cross, Crest, Monument, Church and Sky." src="https://cdn-images-1.medium.com/max/1024/1*H5JDmv9kGo1rEhHhvhhRHw.png" /><figcaption>The model describes what it sees, down to the five squares on each shield, and leaves the place unnamed.</figcaption></figure><h3>How fast is “local”, really?</h3><p>Running a 35-billion-parameter model at home proved quicker than I had expected. I benchmarked both requests through the real route, from PhotoPrism’s host through the Raspberry Pi gateway to vLLM on the Spark. I used the same five photos for each task, excluded a separate warm-up request, and disabled full-response caching. Reasoning was switched off throughout.</p><p>Then I got curious about the cloud alternative. I added a separate GPT-6.1-terra alias to LiteLLM and sent it the exact same prepared JPEGs, with the same prompts, image-detail settings and reasoning disabled. This was a one-off exception to keeping everything at home: six photos went to OpenAI, five for timing and one for warming up each task. The everyday pipeline still uses Ornith locally.</p><p>These are the mean request times per photo:</p><figure><img alt="Table of mean request times per photo. Caption: Ornith on the Spark 2.91 s, GPT-6.1-terra 2.25 s. Labels as JSON: 6.91 s and 2.59 s. Both together: 9.82 s and 4.83 s" src="https://cdn-images-1.medium.com/max/848/1*QOKnhZGRreIZvyJG5pomIg.png" /></figure><p>Ornith’s labels take more than twice as long as its captions, which surprised me at first. Eight label names sounded like a small amount of text. Every label comes wrapped in field names, numbers and JSON punctuation, so the label responses contained about 2.5 times as many output tokens as the captions. The model generated at roughly the same pace in both cases, around 35 tokens per second measured over the whole request. Longer structured output seemed to explain most of the gap. GPT was quicker overall. Its shorter captions and smaller label lists also meant less output to generate.</p><p>At the local rate, a thousand photos represent about two and three-quarter hours of caption and label requests. Captions alone for a library of roughly 9,000 photos would take a little over seven hours. That is one request at a time; I haven’t yet tried sending vLLM several photos in parallel. These timings include the gateway and, for GPT, the trip across the internet. They exclude preparing the images, updating PhotoPrism, generating embeddings and writing the index. The local and cloud runs were also on different dates. I use these timings as a rough guide for planning overnight batches.</p><p>The cloud price was small. All twelve GPT requests, warm-ups included, came to an estimated two US cents. Using the returned token counts and <a href="https://developers.openai.com/api/docs/pricing">OpenAI’s published rates</a> on 5 December 2026, the five timed photos worked out to about <strong>$3.41</strong> per thousand photos for captions and labels together: roughly <strong>$31</strong> for a 9,000-photo library, or <strong>$34</strong> for 10,000 photos. These US-dollar estimates scale up the token usage from the five-photo sample. Embeddings would still run locally, and taxes and retries are outside that estimate.</p><p>There was a small accounting wrinkle. LiteLLM supplied a cost estimate alongside OpenAI’s token counts, and it appeared to miss the extra charge for writing part of the label prompt into OpenAI’s cache. I included that in the figures above, without assuming any cache-read savings for new photos. The local running costs are electricity and hardware. I already own the machines, and keeping the daily processing at home remains the point of the setup for me.</p><h3>And are the shorter captions any good?</h3><p>I also read both sets of captions and labels beside the five photos. GPT averaged 55 words per caption and 6.6 labels, against Ornith’s 76 words and eight labels. Both usually kept the main subject and setting: the people at a coastal overlook, the small mammal beside a stone path, the plate of green peppers. The clearest loss was a museum display with a readable German sign. Ornith kept the collector’s name, the Elbe, Dresden and the connection to Stolpen; GPT mostly kept the visual description of the basalt stone. Those names are exactly the sort of thing I might remember later and type into a search box.</p><figure><img alt="A dark basalt stone with a net-like surface pattern on a steel stand, below a German museum sign. Underneath, the two captions side by side: Ornith’s 85 words name the collector, the Elbe, Dresden and Stolpen; GPT-6.1-terra’s 50 words describe the stone and quote the sign’s phrase about its surface." src="https://cdn-images-1.medium.com/max/1024/1*vSW0nOIrBsqkad7ZtZu9XA.png" /><figcaption>The same museum photo, captioned by each model. Only Ornith kept the collector’s name and the places named on the sign.</figcaption></figure><p>GPT was more careful elsewhere. On a photo with a faint plume over rough water, it suggested a whale blow while acknowledging that no animal was clearly visible. Ornith confidently described a whale surfacing. GPT’s label request also gave the water photo a confident whale tag. In the animal photo, GPT described tiny white flowers where the white patches were difficult to identify. The usefulness of the extra labels varied. Some of Ornith’s terms overlapped, such as rock and stone; others offered useful alternative wording for a search. I reviewed the outputs with the model names visible. Each model had examples where its choices helped, and others where I would want to edit the result.</p><h3>A small surprise in the labels</h3><p>After the first caption run, my label list exploded. PhotoPrism, it turns out, also derives labels from the <em>words</em> of a caption, independently of the vision model’s own labels. A caption mentioning “a wooden bench beside the path” produced labels for both. At the time, that came to 16,289 caption-derived label assignments on 4,339 photos, most of them noise.</p><p>There was a second, subtler trap. PhotoPrism’s normal labelling command skips photos that already have labels, and nearly every photo already had some from the built-in classifier. So whether a photo had labels told me nothing; I needed to know whether <em>the local model</em> had labelled it. My pipeline now tracks that per photo, and a cleanup step after each run removes caption-only labels while keeping manual labels and anything the vision model confirmed. There is an open upstream request for a proper switch (<a href="https://github.com/photoprism/photoprism/issues/5513">PhotoPrism issue 5513</a>). Until then, the cleanup does the job.</p><h3>From words to meaning: two kinds of embeddings</h3><p>Captions and labels made PhotoPrism’s own search much better, but it is still matching words. I wanted to search by <em>meaning</em>, so that “green mountains” also finds “lush, forested slopes”. That calls for embeddings: numerical fingerprints of content that place similar things close together.</p><p>I ended up with two per photo, because a caption is only ever a model’s choice of what to mention. If the waterfall is a small detail in a wide landscape, the caption may never say “waterfall” at all.</p><p><strong>SigLIP</strong> (google/siglip-base-patch16-512) looks at the image itself. It maps photos and text into one shared space, so the query <em>a waterfall surrounded by green mountains</em> can be compared directly with the pixels, whatever the caption happens to say. Each photo gets a 768-dimensional visual vector. The pipeline always sends it a JPEG; for an iPhone HEIC that is simply PhotoPrism’s sidecar copy.</p><p><strong>BGE-M3</strong> embeds the caption text. It catches what is easier to read than to see: signs and inscriptions the model transcribed, or architectural styles it named. It runs behind the embeddings alias of the same LiteLLM gateway that my AI lab already used for documents, and produces a 1,024-dimensional caption vector. Labels stay metadata; they are not mixed into either vector.</p><p>Both models are small by today’s standards, a few hundred million parameters each. They don’t need a DGX Spark; an old graphics card is enough.</p><h3>A second career for a graphics card from 2017</h3><p>My Windows PC still has a GeForce GTX 1080 Ti in it. When it came out in 2017 it was the card you bought to run games at the highest settings; today, in a world of AI accelerators, it is close to a museum piece. It has 11 GB of memory, which is plenty for two embedding models, and it would otherwise sit idle most of the day.</p><p>So the embeddings run there, in Docker under WSL2. SigLIP lives in a small FastAPI service with two routes, one for images and one for text queries. BGE-M3 runs in llama.cpp’s CUDA server, using a Q8_0 GGUF build of the model:</p><pre>llama-server -hf gpustack/bge-m3-GGUF:Q8_0 --alias BAAI/bge-m3 \<br>  --embedding --pooling cls --n-gpu-layers 99</pre><p>Getting an eight-year-old card to cooperate with a modern AI stack is where the real fiddling happened. The 1080 Ti is based on the Pascal architecture, with CUDA compute capability 6.1, and the ecosystem is slowly leaving it behind. Three layers have to agree.</p><p>First, the driver lives on Windows, not in Linux. WSL2 passes the GPU through from the Windows NVIDIA driver, and you should not install a Linux GPU driver inside WSL. Second, the CUDA version inside a container is independent of what the driver advertises; my driver reports CUDA 13, and the containers happily run CUDA 12. Third, and most treacherous, the framework build must still contain code for your GPU’s architecture. PyTorch 2.7.1 built for CUDA 12.6 still includes Pascal; PyTorch’s CUDA 12.8 builds dropped it, and CUDA 13 no longer compiles for these older architectures at all. The CUDA 12 toolkit itself still supports the card: llama.cpp’s CUDA 12 image is built on 12.8 and runs fine on it. An image that installs and starts without complaint can still fail the moment it tries to run a kernel on the card.</p><p>My SigLIP image is therefore pinned to pytorch/pytorch:2.7.1-cuda12.6-cudnn9-runtime with Transformers 4.51.3, and the llama.cpp server runs its server-cuda12 image. That tag is rebuilt regularly, so once a container works on old hardware, pin the exact digest you tested and never let “latest” anywhere near it.</p><p>Both services together use about 4.4 GB of the card’s 11 GB. A batch of 100 photos got both embeddings in 93 seconds end to end, including reading the files from the NAS and writing to the index. That is about a second per photo, and it is not the bottleneck of anything.</p><p>So the DGX Spark, a petaflop-class machine the size of a lunchbox, runs the only model that needs 35 billion parameters, the 2017 gaming card handles the embeddings, and a Raspberry Pi routes the traffic between them. The Spark stays free for other work, and the old card has a reason to stay switched on.</p><h3>One point per photo in Qdrant</h3><p>The vectors live in Qdrant, an open-source vector database running as another container next to PhotoPrism. Each photo is one point carrying two <em>named</em> vectors, visual and caption, both compared by cosine similarity, plus a payload with the caption, labels, file name and folder.</p><p>The point ID is derived deterministically from PhotoPrism’s own photo ID:</p><pre>point_id = str(uuid.uuid5(uuid.NAMESPACE_URL, f&quot;photoprism:{uid}&quot;))</pre><p>A re-run therefore always lands on the same point, so the pipeline can add a missing visual vector without touching the caption vector, or update labels without re-running either model. Interrupted jobs can be resumed rather than repeated, and the same photo never shows up twice in the results.</p><p>At search time, the query is embedded with the matching model. In hybrid mode both searches run at once, and their rankings are merged with reciprocal rank fusion: each list contributes 1 / (60 + rank) for every photo it returns. Ranks fuse cleanly, whereas the raw similarity scores of two unrelated models do not live on the same scale and would be misleading to average.</p><h3>The whole picture</h3><p>Here is how the pieces fit together across the NAS and the four machines involved.</p><figure><img alt="Diagram of the setup. PhotoPrism in a Docker VM indexes the photo archive on the NAS. A nightly pipeline sends photos through a LiteLLM gateway on a Raspberry Pi 5 to vLLM on a DGX Spark for captions and labels, gets embeddings from SigLIP and BGE-M3 on a GTX 1080 Ti, and writes them to Qdrant. The search app embeds each query on the same GPU and ranks the results from Qdrant." src="https://cdn-images-1.medium.com/max/1024/1*GPf9GmG9JxSppElQPZ0wEw.png" /><figcaption><em>Blue: indexing. Orange: overnight enrichment. Green: a search. The everyday pipeline keeps the photos at home.</em></figcaption></figure><h3>The night shift</h3><p>Because I keep adding photos, a search index that only knows last month’s library would slowly become useless. So the whole chain runs on its own every night at 02:00.</p><p>The first thing the job does is check that the NAS is really mounted, comparing the actual NFS source rather than trusting that the folder exists. It then backs up PhotoPrism’s database and the pipeline’s own state, and asks PhotoPrism to index, which picks up anything new on the NAS. For each new or unfinished photo it requests a caption and local-model labels from Ornith, computes both embeddings on the 1080 Ti, writes them to Qdrant, and finally runs the label cleanup.</p><p>A small SQLite manifest records which stage has completed for which photo, and with which model and input, so a crashed run resumes where it stopped and an unchanged photo costs nothing on the next night. A shared lock stops a manual run from colliding with the scheduled one. An empty label response is recorded as an outcome to review, not silently counted as success.</p><p>The first full pass, in late October, ran for 4 hours 36 minutes. It was a mixed workload, because most photos already had captions from earlier runs while labels and both embeddings were added throughout. Verification the next morning showed every one of the 6,472 photos then in the library with a valid visual vector and a valid caption vector, and not a single duplicate. Since then the library has grown to around 9,000 photos. I copy a new batch onto the NAS in the evening, and the next morning it is searchable.</p><h3>The search page</h3><p>The front end is simple: a FastAPI app with a text box, a choice of visual, caption or hybrid search, and a grid of ranked thumbnails. Each card links straight to the photo in PhotoPrism, where the full image, map and metadata are one click away. Thumbnails are generated on the server from the read-only photo share and requested by point ID, so the browser never sees server paths or model keys.</p><figure><img alt="The search app in hybrid mode for “A waterfall surrounded by green mountains”, showing ten waterfall results from Ticino, Iceland and Madeira, each with its folder, file name, and fusion, visual and caption scores." src="https://cdn-images-1.medium.com/max/1024/1*uWxUBbqgseJFNcHFuV8sWg.png" /><figcaption><em>The search page in hybrid mode, with each result’s folder and its visual and caption scores.</em></figcaption></figure><p>This is also how I find the old towns now. I describe what I remember, say <em>A historic European city with ornate buildings and cobblestone streets</em>, and Prague turns up next to places I had half forgotten.</p><figure><img alt="Search results for “a historic European city with ornate buildings and cobblestone streets”: old-town streets and squares in Prague, Pirna, Dresden, Pedraza, Locarno and Terceira." src="https://cdn-images-1.medium.com/max/1024/1*Zt68n8tFdH2ufH-jw_ex9g.png" /><figcaption><em>Found from a half-remembered street scene.</em></figcaption></figure><p>The three modes behave differently enough that I use all of them. Visual search is best when I remember what a photo looked like. Caption search is better for things the model wrote down, such as a sign or a named building style. Hybrid is my default, because it usually puts the right photo near the top even when one of the two routes misses it.</p><p>The app runs on my home network only. It has its own simple access boundary and does not inherit PhotoPrism’s user permissions, so it is not something to expose to the internet as is.</p><h3>What I would tell someone starting out</h3><p>A few lessons apply whatever hardware you have.</p><p><strong>Start with five photos</strong>. Every change, whether a new prompt, a new label setting or a new embedding model, went through a five-photo test that I inspected in PhotoPrism before touching the rest of the library. It is the cheapest way to catch a prompt that produces generic captions or a label run that silently does nothing.</p><p><strong>Decide on a stable identity first</strong>. Deriving the vector ID from PhotoPrism’s photo ID meant I could rebuild, repair and extend the index without ever ending up with duplicates.</p><p><strong>Keep the search app and the pipeline separate</strong>. The search page only reads the index. The pipeline does the slow, risky work in the background. I could rebuild half the index without the search page noticing.</p><p><strong>Check your assumptions about the storage</strong>. An unmounted share, an oversized image or a PNG where you expected a JPEG will all turn up eventually. It is better to have the pipeline stop and report than guess.</p><h3>Try it yourself</h3><p>The pipeline and the search app started life in two private repositories full of my host names and household quirks. For this article I have extracted a minimal, self-contained version into a single repository:</p><p><a href="https://github.com/sparel/photoprism-semantic-search">GitHub - sparel/photoprism-semantic-search: Local semantic search for a PhotoPrism library: SigLIP + BGE-M3 vectors in Qdrant, hybrid RRF search app</a></p><p>It contains:</p><ul><li>the vision.yml caption and labels prompts from this article, and a LiteLLM configuration with reasoning disabled plus an embeddings alias;</li><li>the SigLIP service, with a Dockerfile pinned for Pascal-era GPUs;</li><li>a Compose file for Qdrant, the search app and, optionally, SigLIP and BGE-M3 on llama.cpp;</li><li>the resumable enrichment worker with its nightly script and a crontab example;</li><li>the search web app with visual, caption and hybrid modes;</li><li>notes on the Qdrant schema, Pascal compatibility and the label cleanup.</li></ul><p>Everything talks to plain OpenAI-compatible endpoints, so you can swap my DGX Spark for Ollama on a desktop GPU, or the 1080 Ti for whatever card you have lying around. It does not include my full configuration. The label cleanup touches PhotoPrism’s database directly and depends on its version, so it is documented rather than shipped as a script you might run blindly.</p><h3>Back to the waterfall</h3><p>The waterfall turned up at the top of the results. It was in <em>Ticino 2023</em>.</p><p>Very little of this required new habits. I still sort photos into folders by holiday and year, and I still add a batch whenever I find an old archive or clear my phone. What changed is the starting point for finding something: I no longer have to remember <em>where</em> a photo is, only <em>what</em> was in it.</p><p>There is more to do. I want a small, honest test set of queries with hand-judged results, so that I can compare visual, caption and hybrid search on evidence rather than impressions. And since I live in Switzerland, I am curious how well the setup copes with a <em>Wasserfall mit grünen Bergen</em> or a <em>vieille ville avec des maisons colorées</em>. BGE-M3 is multilingual; the SigLIP model I use mostly speaks English.</p><p>Until then, if you have a NAS full of photos and a graphics card gathering dust, you already have most of what you need.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad3a645e91d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extraction is not enforcement: fine-tuning a local LLM for hERG assay curation]]></title>
            <link>https://medium.com/@sparel/extraction-is-not-enforcement-fine-tuning-a-local-llm-for-herg-assay-curation-eb83aaab01b3?source=rss-16c2ce99df95------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb83aaab01b3</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[fine-tuning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[drug-discovery]]></category>
            <dc:creator><![CDATA[Serge Parel]]></dc:creator>
            <pubDate>Sun, 06 Sep 2026 13:44:17 GMT</pubDate>
            <atom:updated>2026-09-06T13:49:57.775Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is the first post in a series on applying QLoRA fine-tuning of local language models to pharmaceutical and agrochemical R&amp;D workflows.</em></p><p>A language model that curates scientific data faces a temptation that has nothing to do with its accuracy: it can answer the eligibility question itself. Given a messy assay record, it can normalize the fields <em>and</em> decide whether the record belongs in a training set. That second step is the dangerous one. A model that is 99.8% correct on eligibility still contaminates a QSAR dataset if the eligibility check is exactly the part where being wrong is expensive.</p><p>This post describes an experiment that tests a narrower, more defensible split of labour: use a fine-tuned local model to extract and normalize, and use deterministic code to decide. The domain is hERG assay curation from ChEMBL. The method is QLoRA fine-tuning of a 7B model. Neither of those two things is new on its own. What the experiment adds is a direct measurement of where the model earns its keep and where it doesn’t, on a task where the failure mode (a bad label entering a QSAR dataset) is concrete and easy to state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nmiN2q146uU2Yg16TyIWGg.jpeg" /><figcaption><em>The model extracts and normalizes. A deterministic rules engine recomputes the admission decision independently. The model’s own </em><em>qsar_usable and </em><em>exclude_reason fields are candidates, not verdicts.</em></figcaption></figure><h3>Where this sits relative to existing work</h3><p>Using LLMs to clean up bioactivity and ADMET data is an active but still small area. PharmaBench (Zhang et al., <em>Scientific Data</em>, 2024) uses a multi-agent prompted LLM pipeline to extract experimental conditions for ADMET benchmark curation. A 2026 review in the <em>Journal of Cheminformatics</em> treats LLM-assisted curation as an open direction rather than a solved problem. Assay2Mol uses BioAssay context and an LLM for molecule design, not curation.</p><p>This experiment differs from that prior work in two ways. First, it fine-tunes a small open model with QLoRA instead of prompting a larger model through an agent pipeline. That trade favors cost and data locality over prompting flexibility, and the post is explicit about what that trade does not test (see below). Second, it narrows to one endpoint (hERG, strict IC50 eligibility) instead of ADMET broadly, which makes it possible to state a precise eligibility policy and measure violations of it exactly, rather than approximately.</p><p>Neither difference makes this experiment more important than the prior work. It makes it a different, complementary data point: what happens when the curation gate is narrow, explicit, and testable, and the model doing the extraction is small enough to run on a single local GPU.</p><h3>Why hERG data need this much care</h3><p>The hERG channel, encoded by <em>KCNH2</em>, is a standard part of non-clinical cardiac safety work. Inhibition of the channel can affect cardiac repolarization, and hERG assays are widely used early in discovery as one component of a broader cardiac-safety assessment. But an in vitro hERG result is not a clinical outcome, and an IC50 is not automatically a universally comparable label. Assay conditions, endpoint definitions, units, cell systems, relation qualifiers, and data-quality flags all matter.</p><p>ChEMBL is a large, curated, FAIR bioactivity resource, and an excellent source for this kind of work for exactly that reason. This experiment pulled activities from <strong>ChEMBL_37</strong>. ChEMBL is a living, versioned database, so the raw and filtered record counts throughout this post are tied to that specific release, not to ChEMBL in general; a re-run against a later version would turn up different totals even with an unchanged policy. It also reflects the reality of public bioactivity data: records span different assay designs, publication practices, endpoint conventions, and levels of annotation. That heterogeneity is a feature for scientific reuse, but it means downstream users need an explicit curation policy rather than optimistic parsing.</p><p>For this experiment, numerical QSAR admission was deliberately strict. A record had to satisfy all of the following:</p><ol><li>standard_type == IC50</li><li>an exact relation, =</li><li>a positive, finite value in nM or uM</li><li>no data_validity_comment</li><li>a non-empty canonical SMILES</li></ol><p>Everything else could remain in the broader curation corpus, but could not enter the numerical QSAR dataset. Censored values, non-IC50 endpoints, kinetic measurements, text results, unsupported units, flagged values, and records without structures were excluded from that narrower use case.</p><p>That policy is intentionally boring. Boring is good here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VJfVX_AmdKScdHE-8duzyA.jpeg" /><figcaption><em>Each record is counted at the first rule it fails, so these are sequential first-failure counts, not overlapping category totals. Two checks in the pipeline, non-finite/missing values and non-positive IC50 values, found zero violations in this run and are omitted from the chart for that reason.</em></figcaption></figure><h3>The task: structured curation, not free-form summarisation</h3><p>The model was asked to emit a single flat JSON object, not prose. The schema covers assay type, normalized target name and ChEMBL target ID, target confidence and organism, cell line, normalized endpoint, relation, value and units, qsar_usable, exclude_reason, and curation_notes.</p><p>The prompt explicitly defined the allowed keys, null handling, and the QSAR admission policy. A rigid output format solves only the syntax problem. A model can produce perfectly valid JSON and still be scientifically useless: the harder problem is semantic normalization.</p><p>For example, an assay description may say “inhibition of human hERG,” “displacement of [35S]MK-499,” “activity,” or “effect on QT interval.” None of those should be blindly treated as interchangeable with IC50, and the exclusion reason attached to a rejected record should say which one it was.</p><h4>The shape of the schema</h4><p>The production schema, prompt wording, and enum lists live in the repository (see the reproducibility note near the end of this post). Reconstructed from the fields discussed above and in the results table, one target record looks roughly like this:</p><pre>{<br>  &quot;assay_type&quot;: &quot;binding&quot;,<br>  &quot;target_name&quot;: &quot;Voltage-gated inwardly rectifying potassium channel KCNH2&quot;,<br>  &quot;target_id&quot;: &quot;CHEMBL240&quot;,<br>  &quot;target_confidence&quot;: &quot;high&quot;,<br>  &quot;organism&quot;: &quot;Homo sapiens&quot;,<br>  &quot;cell_line&quot;: &quot;HEK293&quot;,<br>  &quot;endpoint&quot;: &quot;IC50&quot;,<br>  &quot;relation&quot;: &quot;=&quot;,<br>  &quot;value&quot;: 25100.0,<br>  &quot;units&quot;: &quot;nM&quot;,<br>  &quot;qsar_usable&quot;: true,<br>  &quot;exclude_reason&quot;: [],<br>  &quot;curation_notes&quot;: &quot;Patch-clamp IC50, high target confidence, structure present.&quot;<br>}</pre><p>Treat the exact field values here as illustrative rather than a literal system dump; the point is the shape of the object, not this specific instance.</p><h3>Dataset design</h3><p>The supervised fine-tuning corpus contained:</p><ul><li><strong>34,045 training records</strong></li><li><strong>3,908 validation records</strong></li><li><strong>3,125 held-out test records</strong></li></ul><p>The split was deterministic and grouped by assay_chembl_id, so records from the same assay group never appear across train and test. That is a meaningful control against an obvious leakage route, though it is not the same as a scaffold split, a publication split, or a temporal split. Those would answer different generalization questions and deserve separate evaluation before making broad claims from this one.</p><p>The strict numerical-QSAR dataset was a different artifact: <strong>11,707 IC50-only records</strong>, split into 9,348 training, 1,356 validation, and 1,003 test records. Keeping the broad curation corpus separate from the stricter QSAR subset was a deliberate design choice. The model should understand why a record is excluded, not simply never see excluded records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X5GREBTw9x7n4esj1itqwg.jpeg" /><figcaption>The strict subset is not a random sample of the broad corpus. It is the fraction that survives all five eligibility rules, kept as a separate artifact rather than filtered out of the model’s view.</figcaption></figure><h3>Why QLoRA and a local 7B model</h3><p>The base model was Qwen2.5–7B-Instruct, fine-tuned locally with QLoRA.</p><p>QLoRA keeps the original model weights frozen and trains low-rank adapters while the base model is quantized. The practical point is that it makes task-specific adaptation feasible on hardware that would not comfortably support full fine-tuning of the same model. That matters for scientific and enterprise workflows where the data, the model, and the serving environment need to stay local.</p><p>The final adapter was served through vLLM with LoRA enabled:</p><pre>vllm serve /models/hf/Qwen/Qwen2.5-7B-Instruct \<br>  --served-model-name Qwen2.5-7B-Instruct \<br>  --enable-lora \<br>  --lora-modules herg-curation-v2=/adapters/exp01_assay_curation/herg_curation_v2 \<br>  --max-lora-rank 16 \<br>  --dtype auto \<br>  --max-model-len 4096 \<br>  --max-num-seqs 4 \<br>  --gpu-memory-utilization 0.60 \<br>  --host 127.0.0.1 \<br>  --port 8000<br></pre><p>The base model and adapter were evaluated under the same inference conditions: temperature 0, JSON-object response format, four workers, a 512-token maximum response length, and the identical 3,125-record held-out test set.</p><h4>What this comparison does not include</h4><p>The comparison in this post is base Qwen2.5–7B versus the fine-tuned adapter, both run locally. It does not include a prompted frontier model (something like a current GPT or Claude tier model, given a strong few-shot prompt and the same schema) as a third baseline. That comparison matters, because the practical question a reader will ask is not just “does fine-tuning help this 7B model,” it’s “would a larger model, prompted well, get most of the way there without any fine-tuning at all.” This experiment cannot answer that question, and the post does not claim to. It is a clear candidate for a follow-up.</p><h4>This was QLoRA, not ordinary LoRA</h4><p>The distinction is worth stating precisely. <strong>LoRA</strong> freezes the pretrained model and trains only small, low-rank update matrices in selected linear layers. <strong>QLoRA</strong> does that while loading the frozen base model in low-bit quantized form for training. This run used QLoRA: 4-bit NF4 quantization, double quantization of the quantization constants, and bfloat16 computation. The model was prepared for k-bit training before the LoRA adapters were attached.</p><pre>bnb = BitsAndBytesConfig(<br>    load_in_4bit=True,<br>    bnb_4bit_quant_type=&quot;nf4&quot;,<br>    bnb_4bit_use_double_quant=True,<br>    bnb_4bit_compute_dtype=torch.bfloat16,<br>)<br><br>model = AutoModelForCausalLM.from_pretrained(<br>    cfg[&quot;model_name&quot;],<br>    quantization_config=bnb,<br>    torch_dtype=torch.bfloat16,<br>    device_map=&quot;auto&quot;,<br>)<br>model = prepare_model_for_kbit_training(model)<br><br>peft = LoraConfig(<br>    r=16,<br>    lora_alpha=32,<br>    lora_dropout=0.05,<br>    target_modules=[<br>        &quot;q_proj&quot;, &quot;k_proj&quot;, &quot;v_proj&quot;, &quot;o_proj&quot;,<br>        &quot;gate_proj&quot;, &quot;up_proj&quot;, &quot;down_proj&quot;,<br>    ],<br>    bias=&quot;none&quot;,<br>    task_type=&quot;CAUSAL_LM&quot;,<br>)</pre><p>QLoRA made the experiment practical on a single local GPU while retaining a standard Qwen2.5–7B base model. Full parameter fine-tuning would train billions of parameters and require substantially more optimizer and gradient memory. Here, the frozen quantized base carried general language and instruction-following behaviour, while the rank-16 adapters learned the task-specific transformation from messy assay context to the controlled evidence-card schema.</p><h4>Training configuration and loop</h4><p>The production configuration trained for two epochs on 34,045 examples, used 2,048-token sequences, a micro-batch size of one, and accumulated gradients over 16 steps. The effective per-device batch was therefore 16 examples before any distributed-training consideration. Gradient checkpointing reduced activation-memory pressure. Evaluation and checkpointing ran every 100 optimizer steps, and only the two latest checkpoints were retained.</p><pre>sequence_length: 2048<br>micro_batch_size: 1<br>gradient_accumulation_steps: 16<br>learning_rate: 0.0002<br>epochs: 2<br>warmup_ratio: 0.03<br>eval_steps: 100<br>save_steps: 100<br>lora_r: 16<br>lora_alpha: 32<br>lora_dropout: 0.05</pre><p>The actual training path was deliberately unglamorous: render the chat-format JSONL with the model tokenizer’s chat template, build train and validation datasets, instantiate SFTTrainer, train, and save only the adapter artifact.</p><pre>train_args = SFTConfig(<br>    output_dir=cfg[&quot;output_dir&quot;],<br>    dataset_text_field=&quot;text&quot;,<br>    max_length=2048,<br>    per_device_train_batch_size=1,<br>    gradient_accumulation_steps=16,<br>    learning_rate=2e-4,<br>    num_train_epochs=2,<br>    warmup_ratio=0.03,<br>    bf16=True,<br>    gradient_checkpointing=True,<br>    eval_strategy=&quot;steps&quot;,<br>    eval_steps=100,<br>    save_steps=100,<br>    save_total_limit=2,<br>    report_to=&quot;none&quot;,<br>)<br>trainer = SFTTrainer(<br>    model=model,<br>    args=train_args,<br>    train_dataset=train_ds,<br>    eval_dataset=valid_ds,<br>    processing_class=tokenizer,<br>    peft_config=peft,<br>)<br>trainer.train()<br>trainer.save_model(cfg[&quot;output_dir&quot;])</pre><p>The training code and exact configuration are versioned in common/scripts/train_qlora.py and exp01_assay_curation/configs/train.yaml. The final adapter SHA-256 was 4caf4813197c7c18c86079cadfabdbc88644395c7fc6ab8c1cb019befb8da04a.</p><h4>Hardware, wall-clock time, and cost</h4><p>The completed training run executed on an NVIDIA <strong>DGX Spark with a GB10</strong> CPU/GPU chip, running Ubuntu 24.04.4 LTS on ARM64. It completed 4,256 optimizer steps over two epochs in <strong>52 h 19 min 02 s</strong> (train_runtime = 188,300 s; 0.362 examples/s; 0.023 steps/s). The final validation pass took 1,824 s and is included in the trainer-reported elapsed time.</p><p>This machine was used because it was on hand, not because this task demands it. Nothing about a rank-16 QLoRA adapter on a 4-bit-quantized 7B model at a 2,048-token sequence length needs DGX-class hardware. The quantized base, adapter weights, optimizer state, and activation memory at micro-batch size 1 fit comfortably within a single consumer GPU in the 16 to 24 GB class, an RTX 3090 or 4090 being the obvious candidates, and the same recipe would also be a reasonable fit for a machine with enough unified memory, such as a Mac mini or Mac Studio on Apple Silicon. The specific CUDA and bitsandbytes-based stack used here doesn’t carry over to Apple Silicon directly, so that path would mean swapping in an MLX-based LoRA fine-tuning stack rather than reusing this code as-is, but the underlying method and data pipeline transfer without modification. What DGX Spark’s unified memory did make convenient was running data preparation, training, and vLLM-served evaluation on one machine without juggling separate GPU allocations. That’s a workflow convenience, not a hardware requirement of the method itself, and total wall-clock time would shift with a smaller card, though not by an order of magnitude for a task this size.</p><h3>The results</h3><p>Both the base model and the fine-tuned adapter produced valid JSON for every test record. That’s good, but it’s also the least interesting result: the explicit output contract did most of that work.</p><p>The meaningful differences appeared in the semantic fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*72_HLumi7qag1utmzCWrWA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fsMsjJDVeZVzhY_E6SmNeg.jpeg" /><figcaption><em>Fields already near 100% for both models (valid JSON, assay type, target ID) are omitted here for readability; the full table above has all fourteen.</em></figcaption></figure><p>The base model was already competent at preserving obvious numerical fields: assay type, target ID, relation, value. It struggled with the work that makes data reusable: controlled vocabulary, target normalization, organism attribution, endpoint classification, and policy-aware rationale.</p><p>The fine-tuned model fixed most of that.</p><p>For a clean IC50 record, the base model might emit an endpoint such as “Inhibition of human hERG,” mark target confidence as unknown, omit the organism, and reject the record from QSAR because it claimed the confidence metadata was missing. The adapter converted the same record into the normalized target, IC50 endpoint, high confidence, Homo sapiens, and the correct QSAR admission decision.</p><p>For a non-IC50 result, the adapter did more than reject it: it identified the reason, endpoint_not_ic50. That distinction matters for auditability. &quot;Rejected because organism is absent&quot; and &quot;rejected because this is EC10 rather than IC50&quot; are not interchangeable explanations, even when both point to the same final decision.</p><h4>Three held-out records, side by side</h4><p>Aggregate metrics can hide what changed. These are predictions from the 3,125-record held-out split, compared against the reference curation output. The values are not cherry-picked to show only wins: the third example is one of the adapter’s known failure modes.</p><p><strong>Example 1: a valid IC50 that the base model wrongly rejects</strong></p><p>chembl_activity_8059895</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d0hMOOzQ-YO69Geac99Hzg.jpeg" /></figure><p>The base model preserved the numerical value but converted the endpoint into prose, lost the target metadata, and invented a reason to reject the record. The adapter mapped the record into the controlled schema and reached the intended admission decision.</p><p><strong>Example 2: correctly excluding a non-IC50 endpoint for the right reason</strong></p><p>chembl_activity_120053</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CK_W1LQxL6_IqdgUB46xUg.jpeg" /></figure><p>Both models rejected this record. Only the adapter gave the policy-relevant explanation: EC10 is not an IC50 label, so it cannot enter the strict numerical-QSAR subset.</p><p><strong>Example 3: the adapter failure that keeps the rule engine in charge</strong></p><p>chembl_activity_1814430</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qYb2TORwK4SLb6fYxkoQjg.jpeg" /></figure><p>The adapter correctly normalized the endpoint to Activity, then still contradicted the admission policy by accepting it. This is exactly why the final QSAR decision should be recalculated by deterministic code, not trusted from the model&#39;s qsar_usable field.</p><h4>The result that prevents premature victory laps</h4><p>The adapter was not perfect.</p><p>Seven records with normalized endpoint Activity, otherwise valid numeric nM values, were incorrectly marked qsar_usable: true. The reference policy correctly excluded them as endpoint_not_ic50.</p><p>That is a false-admission rate of 0.224% on the held-out set.</p><p>For a chatbot benchmark, that number would look excellent. For automated dataset admission, it is not good enough. If the model is allowed to decide which labels enter a QSAR training set, a small false-positive rate can introduce exactly the kind of contamination the curation system exists to prevent.</p><p>This is the central engineering lesson from the experiment:</p><blockquote>Use the model to extract, normalize, and explain. Use deterministic code to enforce hard scientific eligibility rules.</blockquote><p>The model should return structured fields, and a rules engine should independently calculate the final QSAR admission decision from those fields and source-level checks. The model can assist the scientist; it should not quietly rewrite the policy.</p><p>The same principle applies to the exclusion rationale. The adapter’s 66.71% set-F1 was a large improvement over the base model’s 0%, but it still produced 56 mismatch cases. Most were alternate or overly specific exclusion reasons for records that were already correctly excluded, which is far less dangerous than false admission, but it still means the rationale layer needs monitoring and possibly controlled post-processing.</p><h4>The missing counterpart: false rejection / over-exclusion</h4><p>The complete held-out decision confusion matrix is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*VXpjQB4bt7iPg3XbEUtJ5Q.jpeg" /></figure><p>The model therefore made <strong>zero false rejections</strong> (“false negatives”): none of the 1,003 reference-admissible records were incorrectly excluded. That is <strong>0.0% of the complete 3,125-record test set</strong> and <strong>0.0% among reference-admissible records</strong>. Admission recall was 100% in this assay-group holdout.</p><p>This is the mirror image of false admission, and it matters for a different reason. False admission contaminates a QSAR label set; false rejection shrinks the usable data and may bias it. The observed zero is encouraging but deliberately narrow: this is a deterministic assay_chembl_id split evaluated against labels generated by the same explicit policy, not a temporal, source, scaffold, or independently adjudicated holdout.</p><p>The proposed architecture still fixes both directions for the final QSAR dataset: after inference, deterministic eligibility code recomputes admission from the source-level fields. For that final hard decision, false admissions and false rejections are zero by construction. The adapter remains responsible for extraction, normalization, and explanations, not gatekeeping.</p><h3>What these numbers do and do not show</h3><p>This experiment shows that task-specific QLoRA training can substantially improve structured scientific-data curation for a constrained local workflow.</p><p>It does <strong>not</strong> show that the model has independently discovered biological truth, that it can replace expert review, or that it can validate a hERG safety conclusion. It also does not establish generalization to new assay families, new targets, unpublished data, new data sources, or chemically dissimilar compounds. And, as noted above, it does not establish that fine-tuning was necessary at all relative to a well-prompted larger model.</p><p>The evaluation measured agreement with reference curation outputs under a defined policy. That is the right first question for this system: can the model reliably reproduce a specified curation procedure? It is not the final question.</p><p>The next phase should include independent expert review of a stratified sample, deterministic post-inference enforcement of the QSAR policy, error analysis by endpoint class, source, assay format, unit type, and cell system, a more demanding split strategy, calibration and abstention rules for ambiguous records, and regression tests built around known failure modes.</p><h3>The practical takeaway</h3><p>The interesting part of this experiment is not that a 7B model can emit valid JSON. Plenty of models can do that.</p><p>The useful result is that a local, fine-tuned model can turn messy assay descriptions into much more consistent scientific evidence cards, while staying cheap enough to run and serve locally. The base model preserved numbers but did not reliably understand the curation ontology. Fine-tuning changed that sharply.</p><p>The catch is equally useful: performance near 100% is not a safety guarantee. A model that gets seven policy decisions wrong out of 3,125 should not be put in charge of data admission. It should be put in charge of the work it is good at, with code enforcing the parts where being wrong is expensive.</p><p>That is a more defensible architecture than trying to make the language model the whole system.</p><h3>What’s next in this series</h3><p>This post is the first in a series looking at where QLoRA fine-tuning of small local models is and isn’t useful across pharmaceutical and agrochemical R&amp;D workflows. hERG assay curation was a deliberately narrow starting point: one endpoint, one strict eligibility policy, one clear failure mode to measure against.</p><p>Candidates for follow-up posts, in roughly increasing order of evaluation difficulty, include SAR-table summarization for project-team chemistry notes, ADMET and ecotoxicology evidence triage (including a Daphnia magna acute-toxicity dataset already being prepared from EPA ECOTOX data), reaction-record cleanup from messy synthesis notes, and a mode-of-action hypothesis assistant built on compact evidence cards. None of these are commitments with fixed dates. The common thread, if the pattern from this post holds, is likely to be the same one: fine-tuning helps the model get better at extraction, normalization, and explanation, and the decisions that are expensive to get wrong stay in deterministic code.</p><h3>Repositories</h3><p>The scripts and configs referenced throughout this post (ChEMBL extraction, the assay-grouped train/valid/test split, the training script, and the evaluation script) exist as working code on GitHub. The PEFT LoRA adapter is made available on Hugging Face.</p><ul><li><a href="https://github.com/sparel/spark-chemlora">GitHub - sparel/spark-chemlora: Bounded LoRA/QLoRA workflows for scientific-data curation and evidence triage</a></li><li><a href="https://huggingface.co/sparel/herg-curation-v2">sparel/herg-curation-v2 · Hugging Face</a></li></ul><h3>Sources and related work</h3><h4>Positioning</h4><ol><li>Zhang et al. <em>PharmaBench: Enhancing ADMET benchmarks with large language models.</em> <em>Scientific Data</em> 2024. <a href="https://www.nature.com/articles/s41597-024-03793-0">https://www.nature.com/articles/s41597-024-03793-0</a></li><li><em>Data curation in cheminformatics: importance and implementation.</em> <em>Journal of Cheminformatics</em> 2026. <a href="https://link.springer.com/article/10.1186/s13321-026-01174-w">https://link.springer.com/article/10.1186/s13321-026-01174-w</a></li><li><em>Assay2Mol: Large Language Model-based Drug Design Using BioAssay Context.</em> <a href="https://arxiv.org/abs/2507.12574">https://arxiv.org/abs/2507.12574</a></li></ol><h4>External background</h4><ol><li>Dettmers et al. <em>QLoRA: Efficient Finetuning of Quantized LLMs.</em> NeurIPS 2023. <a href="https://arxiv.org/abs/2305.14314">https://arxiv.org/abs/2305.14314</a></li><li>Kwon et al. <em>Efficient Memory Management for Large Language Model Serving with PagedAttention.</em> SOSP 2023. <a href="https://arxiv.org/abs/2309.06180">https://arxiv.org/abs/2309.06180</a></li><li>Zdrazil et al. <em>The ChEMBL Database in 2023: a drug discovery platform spanning multiple bioactivity data types and time periods.</em> <em>Nucleic Acids Research</em> 2024. <a href="https://doi.org/10.1093/nar/gkad1004">https://doi.org/10.1093/nar/gkad1004</a></li><li>Gintant et al. <em>The Challenges of Predicting Drug-Induced QTc Prolongation in Humans Using Nonclinical Data.</em> <a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC9041548/">https://pmc.ncbi.nlm.nih.gov/articles/PMC9041548/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb83aaab01b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Year Local AI Stopped Being a Compromise]]></title>
            <link>https://medium.com/@sparel/the-year-local-ai-stopped-being-a-compromise-314d5482f28b?source=rss-16c2ce99df95------2</link>
            <guid isPermaLink="false">https://medium.com/p/314d5482f28b</guid>
            <category><![CDATA[self-hosting]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[homelab]]></category>
            <dc:creator><![CDATA[Serge Parel]]></dc:creator>
            <pubDate>Sun, 19 Jul 2026 12:19:32 GMT</pubDate>
            <atom:updated>2026-07-19T12:19:32.895Z</atom:updated>
            <content:encoded><![CDATA[<p>Models, hardware, and the money math of running your own LLMs (Part 2 of 2)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dSIakK0d5JoeCmv9yE2_sA.png" /><figcaption>AI generated</figcaption></figure><p>Consider three local-AI setups reported in the past ninety days.</p><p>One is a garage server built around a used X99 motherboard, a roughly ten-dollar Xeon, 64 GB of secondhand ECC memory, and two RTX 5060 Ti cards mounted on an open mining frame. It cost about $1,740 and serves a 30B-class coding model to a laptop over SSH.</p><p>Another is a MacBook with 48 GB of RAM running a 397-billion-parameter model at 4.36 tokens per second. The weights do not fit in memory. They are pulled from SSD as needed by a 7,000-line C inference engine developed over more than ninety experiments.</p><p>The third setup is in a different category: eight H200 GPUs running GLM 5.2. This is a 753-billion-parameter model with downloadable, MIT-licensed weights. It beats Claude Opus 4.8 on Terminal-Bench and, at the time of writing, ranks first on a blind-preference leaderboard for web development.</p><p>These machines have little in common, which is the point. Local inference now covers everything from improvised consumer builds to frontier-scale racks. In <a href="https://medium.com/@sparel/your-gpu-is-mostly-waiting-5aee4dcb67d9?sharedUserId=sparel">Part 1</a> I looked at the software techniques that made this possible: quantization, speculative decoding, and better cache management. Here I want to look at the practical consequence. Which workloads should run on hardware you own, and where does an API still make more sense?</p><p>My reading of this year’s benchmarks and practitioner reports is that the answer changed during the spring. Local models are now the sensible default for a meaningful set of production tasks. That set still has a boundary, and crossing it without noticing is where most disappointments begin.</p><h3>Why sparse models changed local inference</h3><p>The largest shift came from sparse mixture-of-experts models. The reason is mostly physical.</p><p>During decoding, performance is constrained by the amount of model data that must move through memory for every generated token. A dense 27B model uses all 27 billion parameters on every token. A MoE model may contain 35B parameters while activating only 3B of them at a time. The inactive experts still have to fit somewhere, but they do not all have to cross the memory bus for every token. On an M4 Max, the dense model runs at about 15 to 18 tokens per second. Comparable MoE models reach 75 to 85.</p><p>In 2025, that speed often came with a noticeable loss in capability. The current Qwen generation has narrowed the gap, especially for agent work. MCPMark tests tool use across multi-turn loops rather than isolated question answering. Qwen3.6’s 35B MoE scored 37.0; Gemma 4, the strongest dense competitor in the same class, scored 18.1.</p><p>The error reports behind those scores are more useful than the ranking. Practitioners saw Gemma repeat tool calls, echo parts of its prompt, and leave code blocks unfinished. It could answer individual questions but struggled to maintain state and recover from errors over twenty turns. Those are exactly the behaviours that one-shot benchmarks tend to hide.</p><p>A small coding comparison reached a similar result. Three local models were given the same prompt for a PyGame shooter. Qwen3-Coder’s 30B MoE produced a working game on its first attempt and included a guard against a double-scoring bug that the prompt did not mention. Gemma 4 produced better-looking graphics but introduced two logic errors. Llama 4 Scout at 17B crashed on launch. In this test, the most reliable model also had the lowest active-parameter count.</p><p>Model architecture is only part of the result. Ornith-1.0 applies self-scaffolding reinforcement learning to Qwen weights. It keeps the same 35B MoE shape and runtime cost as the base model, yet improves every benchmark category and beats the dense 27B model on tool use. At a fixed inference budget, post-training is becoming a larger source of differentiation than parameter layout.</p><p>Flash-MoE shows what happens when sparsity is pushed much further. Its 397B model runs on a MacBook with 48 GB of unified memory by paging inactive experts from SSD. That is slow compared with an in-memory model, but 4.36 tokens per second is usable for some interactive tasks. The implementation history also contains a good systems lesson. After 58 attempts at a custom cache, the author returned to the operating system’s page cache and measured a 71 percent hit rate. The general-purpose cache won.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Ey08pMM2ghweJmNxnTaDw.png" /><figcaption>How Flash-MoE works (AI generated based on the technical description)</figcaption></figure><h3>Hardware in a memory shortage</h3><p>As described in <a href="https://medium.com/@sparel/your-gpu-is-mostly-waiting-5aee4dcb67d9?sharedUserId=sparel">Part 1</a>, AI datacenters are consuming most of the world’s memory output, DRAM prices have risen severalfold from their 2024 lows, and many GPUs sell for 50 to 100 percent above list price. Analysts do not expect the GDDR shortage to ease before late 2027. <a href="https://medium.com/@sparel/the-mac-studio-quietly-lost-416gb-of-memory-d7c2989db10f?sharedUserId=sparel">Apple raised Mac prices in June and removed its largest Mac Studio memory configurations</a>.</p><p>Under those conditions, buying the fastest processor is often the wrong way to plan a local inference machine. Capacity comes first. Interconnect bandwidth matters too, but how much it matters depends on the way the model is split.</p><p>The $1,740 X99 build is useful because none of its platform components are impressive. Old server boards are cheap, provide many PCIe lanes, and accept large amounts of inexpensive memory. With layer-split inference, each GPU owns a contiguous group of model layers. Only the intermediate activations have to move between cards, so PCIe 3.0 with eight lanes per slot is adequate for this size of model.</p><p>Tensor parallelism behaves very differently. It divides each matrix operation across the GPUs and requires frequent synchronization. On the same pair of consumer GPUs connected through ordinary PCIe, vLLM tensor parallelism delivered 8 to 15 tokens per second. llama.cpp with a layer split delivered 166 to 180. Tensor parallelism was designed for NVLink-class interconnects; it is a poor default for a salvage build.</p><p>For a new single-card system, AMD’s Radeon AI Pro R9700 is an interesting capacity-first option. It has 32 GB of memory and sells for $1,349 with a warranty. A detailed comparison with a used RTX 3090 found that the AMD card has 46 percent less memory bandwidth. It generated tokens about 30 percent more slowly and processed prompts at roughly half the speed.</p><p>The extra 8 GB changes the comparison at long context lengths. The R9700 held a 144K-token context entirely on the GPU, while 24 GB cards began swapping at roughly 80K to 100K. If the target model and context already fit in 24 GB, the 3090 remains faster. If they do not fit, memory capacity matters more than peak bandwidth. The same review also found that ROCm setup on Linux took about thirty minutes, a substantial improvement over its old reputation.</p><p>Apple Silicon and NVIDIA’s DGX Spark occupy the next tier. Their unified-memory designs remove the PCIe transfer between CPU and GPU and provide enough capacity for models in the 100B to 130B range. The Spark has 128 GB. Its software ecosystem has matured quickly: early guides concentrated on getting a container to run, while recent material covers LoRA fine-tuning, rootless containers, security, and maintained base images. That documentation is mundane, but it is also what makes a platform usable beyond experiments.</p><p>GLM 5.2 sits at the far end. The weights cost nothing to download, but FP8 inference needs about 750 GB of GPU memory across eight H200s. A quantized build fits on four H100s. A 256 GB Mac Studio can run a 2-bit version at approximately 3 to 9 tokens per second, although that is more demonstration than practical deployment. For a mid-sized research lab, a frontier-class coding model is now within procurement range. Most individuals and small teams will still be better served by an API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A06ogL05OQMe0jgQtOq-KA.jpeg" /><figcaption>The local-inference hardware ladder in mid-2026: representative builds, what each tier enables, and its main limitation. Prices are approximate as of July 2026</figcaption></figure><h3>When owning the hardware pays</h3><p>Privacy has always been the straightforward reason to run models locally. In 2026, cost can make the same case, although only for the right workload.</p><p>Flat-rate AI subscriptions are widely assumed to subsidize heavy users. One frequently cited analysis estimated that OpenAI loses $1.22 for every dollar of revenue. When providers switch products or customers to usage-based pricing, reported bills have risen by factors of ten to fifty. Several practitioner accounts follow the same sequence: an unexpected overage of a few hundred dollars prompted the purchase of a GPU. Local hardware makes the cost predictable and removes exposure to later API price changes.</p><p>Cheap hosted inference complicates this calculation. Z.ai prices GLM 5.2 at about $1.40 per million input tokens and $4.40 per million output tokens. At those rates, a self-hosted frontier deployment does not break even until it handles roughly 3,000 or more prompts per day at sustained utilization. Staffing and maintenance move the break-even point higher.</p><p>There is therefore no useful single answer to the local-versus-cloud question. A common arrangement is to use a smaller local model for drafting and routine work, send the high-volume coding or revision loop to a stronger local model, and reserve a paid frontier API for final review and unusually difficult cases. The repeated iteration is usually the largest token expense, so that is the part worth moving first.</p><p>Availability adds a separate consideration. In mid-June, US export-control action suspended access to one frontier model family for foreign nationals, and the provider temporarily disabled access worldwide while it addressed compliance. Data-residency rules create a more routine version of the same constraint: some prompts cannot legally or sensibly leave an organisation’s network. Downloaded weights avoid both dependencies, at the cost of making the owner responsible for operating them.</p><h3>The boundary local models still cross badly</h3><p>The most useful boundary reports come from people who have capable local hardware and still choose not to use it for everything.</p><p>Alex Ellis runs Qwen3.6 on a 96 GB RTX 6000 Pro. He reports sustained speeds of 130 to 200 tokens per second and 93 percent speculative acceptance, and uses the model in production for bounded jobs such as diagnostic analysis, revenue telemetry, and structured JSON extraction. For longer agent runs, he still sees loops, weaker Go code than frontier models produce, and hallucinations when the task is ambiguous. His useful shorthand is that local Qwen is a different tool, not a worse Opus.</p><p>Vicki Boykis applies a practical test: does she have to check the result against an API model? Current local models now pass that test for refactoring, linting, unit tests, and bootstrapping projects. They do not yet pass it for production software development as a whole.</p><p>Taken together, the reports suggest a workable division. Local models do well when the scope is bounded, the output has a schema or an easy test, the data must stay private, or the task runs often enough for API charges to accumulate. Frontier APIs still have a clear advantage when an agent must plan, act, diagnose its mistakes, and continue unsupervised for a long time.</p><p>One independent benchmark also found that extended thinking modes reduced instruction-following quality for every local model it tested on practical coding tasks. Reasoning tokens can help with puzzles or difficult planning, but they are not automatically useful when the main requirement is adherence to a detailed specification. Before buying a larger model, test the current one with thinking disabled.</p><h3>A deployment pattern that keeps the tools unchanged</h3><p>Most working local deployments expose an OpenAI- or Anthropic-compatible API from a dedicated inference machine. Existing editors, agents, and scripts point to that endpoint through a small routing layer. The clients do not need to know whether a request went to a laptop, a server in the next room, or a hosted provider.</p><p>This pattern appears at very different scales. Hobbyists connect Claude Code to a model running on a MacBook through a lightweight router. A self-hosted agent framework uses the same arrangement for a 35B MoE on a DGX Spark, with a Telegram bot as the client. Windows now includes a small on-device model and an agent CLI that can route subtasks between the device and the cloud.</p><p>The benefit is not a new workflow. It is the ability to choose the inference backend for each workload without replacing the tools around it. Cost, privacy requirements, and the amount of unsupervised judgment needed provide a reasonable basis for that routing decision.</p><p>There is still operational friction. Local inference stacks need version pinning, performance regressions can survive ordinary smoke tests, and benchmark results rarely transfer cleanly between engines or context lengths. The lesson from <a href="https://medium.com/@sparel/your-gpu-is-mostly-waiting-5aee4dcb67d9?sharedUserId=sparel">Part 1</a> applies here too: record the exact software environment, test with the context sizes you actually use, and distinguish prompt processing from token generation.</p><p>The question I would ask before routing a task locally is simple: can the result be constrained or checked cheaply? If it can, current local models are often fast enough, capable enough, and inexpensive enough to be the better choice. If the task is open-ended and mistakes can compound for an hour, the frontier API is still earning its fee.</p><p>That boundary has moved a long way in one year. It has not disappeared.</p><p><em>This is Part 2 of a two-part series. Part 1, “</em><a href="https://medium.com/@sparel/your-gpu-is-mostly-waiting-5aee4dcb67d9?sharedUserId=sparel"><em>Your GPU Is Mostly Waiting</em></a><em>,” covers the inference optimization techniques (quantization, speculative decoding, and cache-aware serving) that made this shift possible.</em></p><h4>Sources and further reading</h4><ul><li><a href="https://ofox.ai/blog/glm-5-2-self-host-vllm-hardware-cost-2026/">GLM 5.2 self-hosting guide (ofox.ai)</a></li><li><a href="https://www.techtimes.com/articles/318543/20260617/glm-52-open-weights-live-top-coding-benchmark-api-use-carries-china-data-risk.htm">GLM 5.2 open-weights release (TechTimes)</a></li><li><a href="https://www.digitalapplied.com/blog/self-host-glm-5-2-hardware-reality-alternatives">Self-hosting GLM 5.2: the hardware reality (digitalapplied)</a></li><li><a href="https://llm-stats.com/models/glm-5.2">GLM 5.2 benchmark page (llm-stats)</a></li><li><a href="https://www.modemguides.com/blogs/tech-news/ai-memory-shortage-hardware-prices-2026">The AI memory shortage (ModemGuides)</a></li><li><a href="https://www.digitalapplied.com/blog/best-hardware-run-local-ai-models-2026-price-brackets-guide">Local AI hardware guide 2026 (digitalapplied)</a></li><li><a href="https://www.compute-market.com/blog/gpu-prices-2026-what-to-buy-local-ai">GPU prices 2026: what to buy (Compute Market)</a></li><li><a href="https://medium.com/@sparel/the-mac-studio-quietly-lost-416gb-of-memory-d7c2989db10f?sharedUserId=sparel">The Mac Studio Quietly Lost 416GB of Memory</a></li><li><a href="https://www.xda-developers.com/i-used-meta-llama-4-qwen-3-and-gemma-4-to-develop-a-python-app-and-only-one-model-is-worth-keeping-for-developers/">I used Meta Llama 4, Qwen 3-Coder and Gemma 4 to develop a Python app</a></li><li><a href="https://xhinker.medium.com/build-your-own-local-ai-rig-in-2026-a-practical-guide-for-the-post-memory-spike-era-2399ee2f8eef">Build Your Own Local AI Rig 2026</a></li><li><a href="https://xhinker.medium.com/i-bought-an-amd-ai-pro-r9700-32gb-to-test-it-for-you-d1db25c91a04">I Bought an AMD AI Pro R9700 32GB to Test It for You</a></li><li><a href="https://medium.com/codetodeploy/why-i-ditched-gemma-4-for-qwen-3-and-why-open-source-ai-finally-feels-real-acb02606e34c">Why I Ditched Gemma 4 for Qwen 3</a></li><li><a href="https://towardsai.net/p/machine-learning/how-flash-moe-runs-a-397b-model-on-a-macbook-with-48-gb-of-ram">How Flash-MoE Runs a 397B Model on a MacBook With 48 GB of RAM</a></li><li><a href="https://blog.alexellis.io/local-ai-is-not-opus/">Local Qwen isn’t a worse Opus, it’s a different tool</a></li><li><a href="https://vickiboykis.com/2026/06/15/running-local-models-is-good-now/">Running local models is good now</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=314d5482f28b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your GPU Is Mostly Waiting]]></title>
            <link>https://medium.com/@sparel/your-gpu-is-mostly-waiting-5aee4dcb67d9?source=rss-16c2ce99df95------2</link>
            <guid isPermaLink="false">https://medium.com/p/5aee4dcb67d9</guid>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Serge Parel]]></dc:creator>
            <pubDate>Sun, 12 Jul 2026 13:49:05 GMT</pubDate>
            <atom:updated>2026-07-12T13:49:05.554Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A field guide to LLM throughput in 2026: compression, speculation, and the art of never reading the same byte twice (Part 1 of 2)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhNJbPi6xWblhDn0rzysNA.png" /><figcaption>Generated with GPT-Image-2</figcaption></figure><p>Here is an uncomfortable piece of arithmetic. Take a 70B parameter model quantized to 4 bits. That is roughly 35 GB of weights. To generate one token, the GPU has to read essentially all of them. If your memory bus moves 128 GB per second, you get a hard ceiling of about 3.5 tokens per second, and it does not matter how many teraflops your compute units can theoretically deliver. They spend most of their time idle, waiting for bytes.</p><p>This is the memory wall, and it is the single organizing fact behind every inference speedup you have read about this year. DRAM bandwidth has improved roughly 4x per decade. Compute has improved closer to 1000x per decade. The gap keeps widening, and large language model decoding sits exactly in the worst spot: a workload that must stream tens of gigabytes of weights past the compute units for every single output token.</p><p>In 2026 the wall acquired a price tag. AI datacenters are on track to consume around 70 percent of the world’s memory output this year, consumer DRAM has risen 300 to 600 percent from its 2024 lows, and an RTX 5090 that lists at $1,999 trades on the street for $3,500 or more. Bytes of fast memory are now the scarce resource in the most literal sense. Every technique in this article is a way of doing more with fewer of them.</p><p>I have spent the past few months tracking this field closely, reading papers, release notes, and the kind of obsessive practitioner benchmarks that only show up on personal blogs. What emerged is that the dozens of named techniques sort cleanly into three families. You can move fewer bytes. You can amortize the bytes you move. Or you can make sure you never move the same bytes twice.</p><h3>Family one: move fewer bytes</h3><p>Quantization is the obvious answer, and it is much older than this article. What changed recently is that one specific algorithmic idea started winning everywhere at once, and it is worth understanding because it explains results that otherwise look like magic.</p><p>The enemy of low-bit quantization is outliers. Weights, activations, and embeddings all contain rare extreme values, and a quantizer forced to cover them wastes its narrow numeric range on cases that almost never occur, degrading precision for everything else. The fix that took over in 2026, popularized under the name TurboQuant, is disarmingly simple: apply a Hadamard rotation to the data before quantizing it. The rotation redistributes energy evenly across dimensions, so whatever spiky distribution you started with comes out looking approximately Gaussian. A Gaussian is exactly what a well-fitted codebook quantizes best.</p><p>One trick, three deployments, all within about two months of the paper:</p><p><strong>KV cache.</strong> The cache of attention keys and values grows linearly with context length, and at 128K context on a 31B model it reaches 13.3 GB, which is most of the reason long context does not fit consumer hardware. Rotated quantization at 3.5 bits per element brings that to 4.9 GB with quality close to FP16, and the paper argues the encoding sits near information-theoretic lower bounds. Long context on a laptop stopped being a fantasy at that point.</p><p><strong>MoE weights.</strong> The same rotation applied to weight matrices put a 120B mixture-of-experts model into 48 GB (it previously needed 63.5 GB in MXFP4) and compressed a 122B model from 240 GB of BF16 down to 50. My favorite detail from this work is what I think of as the MXFP4 paradox: if you take a model already quantized to MXFP4, dequantize it, and requantize with the rotation approach, quality goes up. The shared-exponent format was simply leaving accuracy on the table compared to codebooks fitted to the real distribution.</p><p><strong>Vector search.</strong> Qdrant shipped the same math for embedding indexes: 8x compression at 0.965 recall, recovering to 0.996 if you rescore the top candidates in float32. The differentiator against binary quantization is stability. Binary recall collapses as the corpus grows (0.916 down to 0.780 when doubling from 50K to 100K vectors); the rotated encoding holds steady. And because less data moves from storage to compute, the compressed index is actually faster to query than the float32 original. The memory wall, for once, working in your favor.</p><p>Two hard-won warnings ride along with the good news. First, 3 bits is the floor for model weights. The 2-bit variants pass perplexity evaluations and then fall apart in real autoregressive generation, because tiny errors compound through attention step after step. Treat any quantization claim backed only by perplexity with suspicion. Second, kernels decide whether the algorithm’s win reaches your hardware. One MoE implementation was materializing 12.7 GB of float16 per generated token before a fused kernel that reads packed weights only for the selected experts delivered a 43x speedup. Same math, wildly different product.</p><p>The rotation idea is also migrating upstream. NVIDIA’s NVFP4 recipe applies random Hadamard transforms inside 4-bit pretraining itself, and the ablation is striking: the otherwise similar MXFP4 format needs 36 percent more training tokens to reach the same loss. Models are beginning to be trained in the same representation they will be served in.</p><p>There is a second way to move fewer bytes that deserves a mention: do not read the whole KV cache at all. MiniMax’s M3 attaches a small index branch that selects the top-k cache blocks per query, and attention reads only those. At a million tokens of context, that is about a twentieth of the compute, with prefill around 9x faster and decode more than 15x. Block selection and cache compression stack, since one decides which blocks to read and the other shrinks every block.</p><h3>Family two: read once, emit many</h3><p>If a decode step is one full read of the active weights, the obvious question is whether one read can produce more than one token. That is speculative decoding, and watching it evolve through 2026 has been like watching four generations of an idea grow up in fast forward.</p><p><strong>Generation one: draft models.</strong> A small model proposes a run of tokens, the big model verifies the whole run in a single parallel pass, and rejected tokens get corrected. Output is mathematically identical to running the big model alone, which people still find surprising. The classic result: Llama 70B with a 1B drafter went from 30 to over 160 tokens per second on a single RTX 3090. The pain is coupling: Both models must share a tokenizer, both must fit in memory, and the configuration is fragile in ways that fail silently. A mismatched BOS-token flag in a GGUF file will quietly reduce your speedup to zero while everything appears to work.</p><p><strong>Generation two: multi-token prediction.</strong> Build small prediction heads into the model itself and let it draft its own future tokens, at under one percent memory overhead. No coupling problem. Instead, MTP revealed that the gain depends on architecture in two separate ways. Dense models gain a lot (a 27B dense model on a cloud GPU went from 45.8 to 79.4 tokens per second, a 1.73x speedup) while sparse MoE models gain little (1.17x on a 35B model with 3B active parameters), for a reason that is obvious in hindsight: MoE decode is already cheap, so there is less waste to recover. And models built on linear-attention layers verify drafts nearly sequentially rather than in parallel, eating the profit margin. Out of a season of benchmarks came an empirical rule: MTP wins when concurrency is at least 4, the draft length is at least 3, and acceptance is at least 80 percent. A draft length of exactly one loses in every configuration anyone tested. Acceptance itself tracks content, with code and math drafting at 60 to 80 percent while creative prose drops near 40. Structured workloads get this speedup nearly free.</p><p><strong>Generation three: parallel drafters.</strong> DFlash replaced the little autoregressive drafter with a compact transformer that predicts an entire block of 15 or so tokens in one shot. Results were dramatic: 2.3x to 2.5x on a 35B MoE in vLLM, with 5 to 8 tokens accepted per draft, and hobbyists reproduced the pattern on Apple Silicon. But two structural flaws remained. Since every position in the block is predicted independently, later positions cannot condition on what earlier ones actually sampled, so coherence decays toward the end of the block. And the verification length is fixed regardless of how loaded the server is, which wastes capacity under pressure and leaves latency on the table when idle.</p><p><strong>Generation four: DSpark.</strong> DeepSeek’s answer, shipped in production on their V4 models in late June and open-sourced under MIT as DeepSpec, fixes both flaws by name:</p><ul><li>Against the coherence decay: keep the parallel backbone but add a tiny sequential correction (a rank-256 Markov head costing under 1.5 percent latency) so each drafted position conditions on its sampled predecessor. A 2-layer DSpark drafter beats a 5-layer DFlash on accepted length.</li><li>Against fixed verification: a calibrated per-position confidence score feeds a scheduler that knows the GPU’s actual measured throughput curve and greedily picks which draft tokens, across all concurrent requests, are worth verifying right now. Under light load it verifies speculatively to cut latency. Under heavy load it prunes low-confidence tokens to protect aggregate throughput.</li></ul><p>The production numbers deserve a careful reading, because the headline versions are doing a lot of marketing work. The honest figures are 51 to 52 percent aggregate throughput improvement at standard latency targets, with per-user generation 57 to 85 percent faster than the previous baseline. You will also see 400 and even 660 percent quoted; those apply only at strict latency tiers where the old system was hitting its operational ceiling and could barely batch at all. Extending the feasible frontier is genuinely valuable, but it is a different claim from a 6x speedup for everyone. Worth noting too that as of this writing no independent third party has verified the acceptance-length numbers; they are vendor measurements published with the release.</p><p>Compressed into one view, the arc looks like this:</p><figure><img alt="Comparison of speculative decoding methods" src="https://cdn-images-1.medium.com/max/1024/1*ahZ9AXRC125EyceQyARCyw.jpeg" /></figure><p>The meta-lesson of the four generations is what I find most interesting. The field stopped optimizing the drafter and started optimizing the decision system around the drafter. DSpark’s real contribution is reframing speculative decoding as dynamic resource allocation, a scheduling problem that couples model confidence to hardware behavior. The wrapper overtook the core, which seems to be the shape of progress in this field generally.</p><h3>Family three: never pay twice</h3><p>The serving layer’s contribution is memory hygiene, and its founding trick is stolen directly from operating systems. vLLM’s PagedAttention manages the KV cache in small non-contiguous pages exactly the way an OS manages virtual memory, which eliminates the fragmentation that used to waste 60 to 80 percent of cache space, and lets identical prefixes physically share pages across requests. Add continuous batching, where finished sequences leave the batch immediately and new ones join mid-flight, and you get the famous 14x to 24x improvement over naive serving. SGLang’s RadixAttention generalizes prefix sharing into a tree over every cached prefix, worth about 3x in request throughput on workloads where many requests share a long common prefix. Coding agents with stable system prompts are precisely that workload.</p><p>What I did not expect was how far up the stack this principle reaches. A recent paper called TokenPilot measured what long agent sessions actually cost when context management is naive: $81.52 per continuous task stream on cloud API pricing. Their system got that to $10.58, an 87 percent reduction, and the mechanism is almost embarrassing. Pruning old context, the obvious mitigation for growing sessions, shifts the prompt’s byte boundaries and thereby invalidates the provider’s prefix cache, silently replacing cheap cached reads with full-price prefill. The fixes are prefix stabilization (replace timestamps, session IDs, and other volatile fields with static placeholders so the prefix stays byte-identical across turns) and batched eviction that respects cache boundaries.</p><p>One practical rule from that work pays for itself: pin your tool schemas to a fixed position in the system prompt. Tool definitions are the most common source of prefix churn in agent harnesses, and freezing them converts every turn’s prefill into a cache hit. Cache continuity turns out to be a contract that spans the entire stack, from GPU page tables to the literal wording of your prompt, and any layer can break it for all the others.</p><h3>The axis nobody prints on the box</h3><p>Almost everything above accelerates decode, the token-by-token generation phase. But the workload that increasingly dominates real usage, agentic coding, is bounded by prefill: the initial processing of the prompt. An agent session accumulates a system prompt of 8 to 12K tokens, file contents of 5 to 20K, and a growing history of tool calls. By 24K tokens of context, time-to-first-token is most of what you feel.</p><p>The benchmark that made this concrete compared a sparse MoE (3B active parameters) against a dense 27B accelerated by DFlash, both on Apple Silicon at 24K context. The MoE reached its first token in 31 seconds. The DFlash setup took 141 seconds, then decoded at more than double the MoE’s speed. It never came close to catching up. Prefill compute scales with context length times active parameters, so the same sparsity that makes MoE a poor speculative-decoding target makes it a prefill monster. These are two views of one fact.</p><p>The trap is that short-prompt benchmarks measure decode, feel like DFlash territory, and predict nothing about agentic performance. Whenever you see a throughput claim, ask three questions: at what context length, in which phase, and at what concurrency. Numbers without those qualifiers are marketing.</p><p>And the cheapest optimization in this entire article costs nothing: <strong>clear your agent’s context between unrelated tasks</strong>. Dropping accumulated context from 24K back to 2K takes that 31-second first token down to about 2.5 seconds. No kernel required.</p><h3>Where the floor drops out</h3><p>Averages mislead in this field because the important effects are cliffs.</p><p>The offload cliff: llama.cpp can keep some MoE expert weights in CPU RAM to fit a big model on a small GPU, and the resulting speed curve is violently nonlinear. One documented case ran 28 tokens per second with 6 GB of weights on GPU, 45 at 16 GB, and roughly 200 once everything fit. A 4x jump at the point where PCIe transfers vanish. Partial offload makes models fit; do not mistake its throughput for the on-GPU regime.</p><p>The version cliff: a default dependency pin in one vLLM release (a flashinfer point version) silently cost 32 percent of throughput at moderate concurrency and made time-to-first-token 55x worse, while passing every smoke test. The fix was pinning one version back. A depressing share of throughput engineering in 2026 is version archaeology, which means a reproducible environment spec is itself a performance optimization.</p><p>Here’s a condensed practitioner’s list:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qOaS3jVp2s_Z7lIgFKdQ8Q.jpeg" /></figure><h3>What this adds up to</h3><p>Stack the three families on one machine and they compound: quantized weights shrink what each decode step reads, compressed or block-selected cache shrinks attention traffic, speculation amortizes five-plus tokens per weight read, paged and prefix-shared serving ensures common bytes are read once, and stable prompts keep the caches valid. None of it required a better GPU. That is the real story of 2026 inference: the hardware wall barely moved, and software found three separate ways around it.</p><p>The same wall, it turns out, is also rewriting the economics of where models run at all. When a pair of mid-range consumer GPUs can decode a strong 30B-class model at 180 tokens per second, the question shifts from whether local inference works to when it is the rational choice. That question has hardware, model, and money dimensions, and it is the subject of Part 2.</p><h4>Sources and further reading</h4><ul><li><a href="https://www.marktechpost.com/2026/06/27/deepseek-releases-dspark-a-speculative-decoding-framework-that-accelerates-deepseek-v4-per-user-generation-60-85-over-mtp-1/">DeepSeek releases DSpark (MarkTechPost)</a></li><li><a href="https://venturebeat.com/orchestration/deepseek-open-sources-dspark-a-new-framework-to-speed-up-llm-inference-by-up-to-85">DeepSeek open-sources DSpark (VentureBeat)</a></li><li><a href="https://kingy.ai/blog/deepseek-dspark-speculative-decoding/">DSpark explained (Kingy AI)</a></li><li><a href="https://www.techtimes.com/articles/319236/20260628/deepseek-releases-dspark-speculative-decoding-makes-v4-85-percent-faster.htm">DSpark verification caveats (TechTimes)</a></li><li>TurboQuant KV-cache quantization: <a href="https://arxiv.org/abs/2504.19874">arXiv:2504.19874</a> (ICLR 2026)</li><li><a href="https://qdrant.tech/articles/turboquant-quantization/">TurboQuant in Qdrant</a></li><li>NVFP4 4-bit pretraining (NVIDIA): <a href="https://arxiv.org/abs/2509.25149">arXiv:2509.25149</a></li><li>TokenPilot cache-efficient context management: <a href="https://arxiv.org/abs/2606.17016">arXiv:2606.17016</a></li><li><a href="https://www.modemguides.com/blogs/tech-news/ai-memory-shortage-hardware-prices-2026">The AI memory shortage (ModemGuides)</a></li><li><a href="https://www.buysellram.com/blog/why-gpu-prices-are-rising-in-2026-how-memory-economics-and-ai-are-reshaping-the-graphics-market/">Why GPU prices are rising in 2026 (BuySellRam)</a></li><li><a href="https://medium.com/data-science-collective/how-i-run-122b-parameter-llms-on-a-macbook-outperforming-mxfp4-and-standard-quantization-on-apple-0552ee3da1f7">How I run 122B-parameter LLMs on a MacBook — outperforming MXFP4 and standard quantization on Apple Silicon</a></li><li><a href="https://allenkuo.medium.com/when-speculative-decoding-helps-local-llms-and-when-it-doesnt-5c41dd804e4b">Speculative Decoding for Local LLMs Was a Mixed Bag. Then DFlash Landed in vLLM</a></li><li><a href="https://jarvislabs.ai/blog/qwen36-mtp-llamacpp-rtxpro6000">Run Qwen3.6 MTP with llama.cpp on RTX PRO 6000</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5aee4dcb67d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DSpark: the DeepSeek inference upgrade that matters more than most model launches]]></title>
            <link>https://medium.com/@sparel/dspark-the-deepseek-inference-upgrade-that-matters-more-than-most-model-launches-590b60be549c?source=rss-16c2ce99df95------2</link>
            <guid isPermaLink="false">https://medium.com/p/590b60be549c</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[deepseek]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Serge Parel]]></dc:creator>
            <pubDate>Tue, 30 Jun 2026 12:54:47 GMT</pubDate>
            <atom:updated>2026-06-30T12:54:47.438Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b5duRWbZxw7rIWF7OFM3GA.png" /></figure><p>Most AI headlines chase bigger models, smarter models, or more agentic models. DSpark is about none of those, which is exactly why it caught my attention.</p><p>There is no new flagship here, no dramatic reasoning breakthrough. The work is quieter and, honestly, more useful: it makes an existing model stack run better in the real world.</p><p>DSpark is DeepSeek’s new speculative decoding framework for speeding up inference. Strip away the jargon and it is a way to make a large model produce useful tokens faster while wasting less GPU compute. The paper’s title is a mouthful — <strong>“Confidence-Scheduled Speculative Decoding with Semi-Autoregressive Generation”</strong> — but the recipe behind it is straightforward: draft several likely tokens, verify them intelligently, and stop paying full price for every step.</p><p>The reason that’s worth caring about is money. Inference, not training, is where a lot of the budget quietly burns. Run a model at scale and the questions that keep you up at night are simple: how many users can I serve, how fast can I answer them, and how much GPU am I throwing away in the process?</p><h3>Why token-by-token generation is such a pain</h3><p>Language models generate text one token at a time. The model predicts the next token, appends it to the context, then runs again for the one after that. Do this long enough and you get an answer.</p><p>It works, but it is slow and expensive. Each token depends on the ones before it, so the system cannot just emit a whole paragraph in a single cheap pass.</p><p>That serial dependency is why latency becomes the real bottleneck in chat products, coding assistants, and agentic loops. The model is often already smart enough. The serving loop is what makes it feel sluggish.</p><p>Speculative decoding sidesteps the bottleneck. Rather than make the full target model do every step, you let a smaller, faster draft component guess several likely next tokens. The main model then verifies those guesses in a single pass. When the guesses hold up, you accept a chunk of them at once and skip several costly target-model steps.</p><p>The catch is unavoidable: the draft guesses have to be good, and the verification has to avoid burning compute on tokens that were never going to survive. That tension is the problem DSpark sets out to solve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EqkYx1jOT_oanJa_4kEqIg.png" /><figcaption>Token-by-token generation vs. speculative decoding, AI generated</figcaption></figure><h3>What DeepSeek actually changed</h3><p>DeepSeek’s contribution isn’t “we do speculative decoding too” . Plenty of groups already do. The paper’s sharper claim is that existing approaches tend to fail in two distinct ways.</p><p>The first failure mode involves <strong>autoregressive drafters</strong>. They tend to produce better token sequences, because each draft token conditions on the previous draft tokens. The cost is speed: they are slower, so you hand back some of the very advantage that made speculation attractive.</p><p>The second failure mode involves <strong>fully parallel drafters</strong>. These draft an entire block in one pass, which is fast, but they get weirder the deeper into the sequence you go. The early tokens look plausible; the later ones fall apart because each position is predicted too independently of its neighbors. The paper gives this a name: <strong>suffix decay</strong>.</p><p>The term is worth holding onto, because it pins down something real. A parallel drafter can be fine at token one and increasingly flaky after that, leaving you to verify tails of tokens that were doomed from the start.</p><p>DSpark goes after both failures at once.</p><h3>The first idea: semi-autoregressive generation</h3><p>The first half of DSpark is what DeepSeek calls <strong>semi-autoregressive generation</strong>, and the design is clever precisely because it refuses to pick a side in the old “fast parallel vs. coherent autoregressive” fight. It takes some of each.</p><p>A <strong>parallel backbone</strong> still does the heavy lifting, producing hidden states and base logits for the whole draft block in one pass. That keeps the core speed advantage of parallel generation.</p><p>On top of that, DSpark bolts a <strong>lightweight sequential head</strong>. The head injects local dependency information into the block, so later draft tokens aren’t predicted in complete isolation. By default it’s a Markov-style head that conditions each token on the one immediately before it. An RNN variant exists, but DeepSeek treats the simpler Markov head as the practical default: most of the benefit, none of the extra baggage.</p><p>It’s the right compromise. You don’t have to make the entire drafter sequential again; you just need enough structure to stop the suffix from collapsing into noise. Guess each word in isolation and you can get something that sounds fine word by word yet incoherent as a phrase. A little sequential correction keeps the pieces aligned.</p><p>The numbers back it up. Against Eagle3, DSpark improves macro-average accepted length by roughly <strong>26.7% to 30.9%</strong> across Qwen3 target models. Against DFlash, the gain in accepted length is about <strong>16.3% to 18.4%</strong>. What I like about that result is what it rules out: this isn’t “parallel, but bigger.” It’s parallel with better local structure.</p><p>And the correction is nearly free. DeepSeek reports only <strong>0.2% to 1.3%</strong> extra per-round latency over DFlash for substantially better accepted-length behavior. A small local cost for an outsized global payoff, which is the kind of bargain systems engineers chase.</p><h3>The second idea: verify smarter, not longer</h3><p>It’s tempting to treat the draft model as the star of speculative decoding. It isn’t. Verification policy carries just as much weight. Verify too many low-probability draft tokens and you waste scarce target-model compute; verify too few and you leave speed on the table.</p><p>DSpark reframes this as a scheduling problem.</p><p>It adds a <strong>confidence head</strong> that estimates how likely each drafted token is to survive verification, assuming the earlier draft tokens were accepted. Those raw estimates then go through <strong>Sequential Temperature Scaling</strong> for calibration, because neural confidence scores are notoriously overconfident and dangerous to trust at face value.</p><p>That calibration step isn’t cosmetic. If your scheduling depends on predicted survival probabilities, bad calibration poisons every downstream decision. DeepSeek reports raw expected calibration error in the <strong>3% to 8%</strong> range, dropping to about <strong>1%</strong> after calibration: accurate enough to drive real scheduling.</p><p>Then comes the move that ties it together: a <strong>hardware-aware prefix scheduler</strong> that decides how many draft tokens are worth verifying per request under the current load.</p><p>The value of verifying one more token isn’t a constant. It depends on what else the GPU could be doing at that moment. Lightly loaded, verifying extra tokens is cheap. Under pressure, low-confidence tokens turn into expensive dead weight. DSpark’s scheduler reads predicted acceptance against the engine’s throughput profile and routes the verification budget accordingly.</p><h3>Why the headline numbers need a little discipline</h3><p>The splashy figures are real, but they come with conditions.</p><p>In production on DeepSeek-V4, DSpark reportedly lifts per-user generation speed by <strong>60% to 85%</strong> on V4-Flash and <strong>57% to 78%</strong> on V4-Pro against the older MTP-1 baseline. At moderate service-level targets, aggregate throughput improvements land around <strong>51% to 52%</strong>. Under stricter interactivity constraints the reported gains grow larger still, mostly because the baseline itself starts buckling.</p><p>Genuine gains, then, but the kind people love to misquote. They do not make DSpark a universal “free 2x-6x speed button” for every local model and every setup. DSpark is a serving-stack optimization, not a law of physics. Its gains depend on a tangle of factors: the target model, the draft architecture, the workload, the serving engine, the system load, and the shape of the hardware throughput curve. Swap any of those and the percentages move.</p><p>Run a different model or a different stack, and you shouldn’t expect the same numbers to fall out the other end.</p><p>That honesty doesn’t undercut the paper. DeepSeek, at least in the technical framing, is upfront that these wins are system-contextual rather than magical.</p><p>The simplest way to see where DSpark fits:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NBjF9C931EqPcaKxCthkrA.jpeg" /></figure><p>That bottom row is where the value lives. DSpark isn’t merely a better draft model; it’s a better account of where inference waste actually comes from.</p><h3>Why this matters beyond DeepSeek</h3><p>The industry still talks as though model quality alone decides product quality. Users experience something different. They experience the serving stack. They experience latency. They notice whether a coding assistant answers now or makes them wait.</p><p>If model intelligence is converging faster than it used to, the next front of competition won’t be “who trained the smartest weights.” It will be “who serves useful intelligence with the best latency-cost tradeoff.” DSpark is an early, concrete example of that shift. It also rhymes with a familiar lesson in systems design: a little structure often beats brute force. DeepSeek didn’t kill suffix decay by inflating the drafter into a heavyweight sequential model. It applied a small sequential correction exactly where it mattered. Disciplined work.</p><p>The open-source angle counts too. Along with DSpark checkpoints, DeepSeek also shipped <strong>DeepSpec</strong>, an MIT-licensed training and evaluation framework for speculative decoding drafters. That turns the release from a marketing moment into something other infra teams can actually test and extend.</p><h3>Where it still falls short</h3><p>DSpark is strong, but it’s not the last word on inference.</p><p>The paper names one limitation plainly: the draft side still pays an upfront cost to generate a block. If a request is genuinely hard and likely to see poor acceptance, some of that drafting compute is sunk, even if the scheduler later prunes the verification waste.</p><p>So the obvious next frontier is <strong>difficulty-aware drafting</strong>: a system that doesn’t just verify smarter, but also knows when not to spend full drafting effort on paths likely to fail.</p><p>Then there’s the unglamorous deployment reality. These methods aren’t tidy algorithm diagrams. They have to live alongside CUDA graph replay, batching behavior, KV-cache constraints, and the jagged throughput curves of real hardware. DeepSeek’s asynchronous scheduler adaptation is a reminder that good inference ideas often survive or die on whether they fit inside messy production pipelines.</p><p>That’s another reason the paper holds up for me: it never pretends hardware is smooth and obedient.</p><h3>The broader takeaway</h3><p>DSpark moves the conversation away from “how do we make the model smarter?” toward “how do we make intelligence cheaper, faster, and more available without degrading the output?”</p><p>For most real products, a slightly less glamorous model that is much faster, cheaper, and easier to serve at scale will beat a more impressive one that buckles under load. The user isn’t grading your inference paper; they’re waiting on the answer.</p><p>DeepSeek’s core insight is the one that holds it all together: speculative decoding isn’t a draft-model problem. It’s a joint problem spanning generation quality, acceptance dynamics, and system-level scheduling.</p><p>Which is why DSpark interests me more than a lot of model launches. It’s trying to make a real serving system better — and it largely succeeds.</p><h4>Sources</h4><ol><li>DeepSeek-AI. <em>DSpark: Confidence-Scheduled Speculative Decoding with Semi-Autoregressive Generation</em> (paper). DeepSpec repository, GitHub. <a href="https://github.com/deepseek-ai/DeepSpec/blob/main/DSpark_paper.pdf">https://github.com/deepseek-ai/DeepSpec/blob/main/DSpark_paper.pdf</a></li><li>Razzaq, Asif. “DeepSeek Releases DSpark, a Speculative Decoding Framework That Accelerates DeepSeek-V4 Per-User Generation 60–85% Over MTP-1.” <em>MarkTechPost</em>, 27 June 2026. <a href="https://www.marktechpost.com/2026/06/27/deepseek-releases-dspark-a-speculative-decoding-framework-that-accelerates-deepseek-v4-per-user-generation-60-85-over-mtp-1">https://www.marktechpost.com/2026/06/27/deepseek-releases-dspark-a-speculative-decoding-framework-that-accelerates-deepseek-v4-per-user-generation-60-85-over-mtp-1</a></li><li>Pyke, Curtis. “DeepSeek DSpark Explained: Speculative Decoding for Faster AI Inference.” <em>Kingy AI</em>, 28 June 2026. <a href="https://kingy.ai/blog/deepseek-dspark-speculative-decoding/">https://kingy.ai/blog/deepseek-dspark-speculative-decoding/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=590b60be549c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Mac Studio Quietly Lost 416GB of Memory]]></title>
            <link>https://medium.com/@sparel/the-mac-studio-quietly-lost-416gb-of-memory-d7c2989db10f?source=rss-16c2ce99df95------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7c2989db10f</guid>
            <category><![CDATA[hardware]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[semiconductors]]></category>
            <category><![CDATA[local-llm]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Serge Parel]]></dc:creator>
            <pubDate>Sat, 27 Jun 2026 19:33:53 GMT</pubDate>
            <atom:updated>2026-06-27T19:33:53.383Z</atom:updated>
            <content:encoded><![CDATA[<p>Last week Apple did something it almost never does. The company with the best supply chain in consumer electronics, the one that can squeeze any supplier on earth, raised Mac and iPad prices by $200 to $300 and admitted it had no choice:</p><p><em>“We have never seen a component price increase this much, this quickly.”</em></p><p>If Apple can’t absorb it, nobody can. And it is not just about price. Earlier this year you could order a Mac Studio with up to 512GB of unified memory; today the configuration tops out at 96GB. The high-memory machines did not just get pricier, they quietly disappeared. Memory has become the most consequential bottleneck in tech, and the effects are landing everywhere at once: phones, laptops, GPUs, and the AI rigs a lot of people have been thinking about building.</p><p>So you’ve probably also seen the other side of this. Tech Twitter, the AI subreddits, the YouTube hardware channels. “Buy the Mac Studio now or miss the local AI wave.” “Prices only go up from here.” “The DRAM shortage means you need to act today.”</p><p>What those posts rarely mention is that the people writing them are often long memory stocks.</p><p>The crisis is real. The prices are real. But the “invest now or miss AI” framing built on top of it serves the people amplifying it more than it serves you. Pull on the data and the urgency starts to look less like opportunity and more like a manufactured panic that happens to move inventory and inflate share prices at the same time.</p><p>Let me walk through what the numbers actually say, who they apply to, and when the real buying window opens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RXq6mqmng-csKzBZzGSNWw.jpeg" /><figcaption><em>Rainer Knäpper, </em><a href="http://artlibre.org/licence/lal/en/"><em>Free Art License</em></a><em>, via Wikimedia Commons</em></figcaption></figure><h3>The Number Most Coverage Gets Wrong</h3><p>Let’s start with the mechanism, because almost everyone reports it incorrectly.</p><p>AI data centers need a special kind of memory called HBM, or high-bandwidth memory. It comes off the same production lines as the ordinary DDR5 in your laptop. So when a chipmaker decides whether to make HBM for Nvidia or DRAM for you, it makes HBM, every time, because the margins are three to five times higher. Three companies, Samsung, SK Hynix, and Micron, control about 95% of the world’s DRAM. All three made the same call at the same time. No cartel required when the incentives line up on their own.</p><p>Here is the figure most headlines stop at: HBM consumes about 22% of global DRAM wafer capacity in 2026.</p><p>But that number undersells the damage. Each HBM bit needs roughly three times the wafer area of a DDR5 bit, so that 22% of capacity yields only about 9% of total memory bits. The real squeeze on conventional DRAM supply is therefore close to two and a half times worse than the wafer percentage suggests. And TrendForce projects HBM’s wafer share rising to 30% by the end of 2027, so the squeeze deepens from here.</p><p>That is why your laptop RAM is getting expensive even though the story everyone is chasing is about AI servers. The shortage has already worked its way down the entire stack. DDR5 ran short, so buyers moved to DDR4. DDR4 ran short, so they moved to DDR3. Now even DDR2, a standard from twenty years ago, is seeing 55 to 60% quarterly price jumps. There is no rung left below the bottom one.</p><p>Here is how the price moves break down across the market:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*90XAOVuY7J6WeOSPfm-4Sw.jpeg" /></figure><h3>A Quote Built for Two Audiences</h3><p>SK Hynix Chairman Chey Tae-won told Nikkei Asia in June that building a leading-edge memory fab takes a minimum of three years, and that “there is currently no way to move faster than this.”</p><p>The buy-now crowd cites this as proof prices only go up. The doomers cite it as proof the constraint is permanent. They are reading the same sentence and reaching opposite conclusions. Only one of them is right, and the answer is in the part both sides leave out.</p><p>SK Hynix has four new fabs in progress, the first phase arriving as early as 2027. Micron’s Virginia plant reaches initial output around mid-2027, with meaningful additional capacity in 2027 and 2028. SK Hynix’s stated goal is to triple total wafer capacity by 2034. Fabs do not ramp overnight and yields take time to stabilize, but the direction is clear: relief is coming, just not this year and not next year in full. The most credible reading puts the next genuinely favorable window for local AI hardware around 2028.</p><p>It is worth knowing where the scariest forecasts come from. The numbers calling for another 40 to 50% jump in Q3 2026 alone trace back to an unnamed Jefferies analyst, relayed through an anonymous Twitter account, then picked up by secondary outlets. That is four hops from a named source. The consensus view, grounded in TrendForce data, is closer to 20% in Q3 and 30% in Q4. Still painful. Very different from “prices double forever.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W2iX-yMmPggcZWBKEh0NIg.jpeg" /><figcaption>Photo: Carol M. Highsmith, 2018. <a href="https://www.loc.gov/item/2018703086/">Library of Congress</a>, public domain.</figcaption></figure><h3>The 98% Quarter</h3><p>The headline data is genuinely shocking. Contract DRAM prices rose by as much as 98% in Q1 2026, nearly doubling in ninety days. Some consumer SSDs now cost more than triple what they did a year ago. Micron posted an 84.9% gross margin last quarter, a number with no precedent in commodity semiconductor history, and guided to 86% for the next one. For comparison, Apple runs around 45% gross margin.</p><p>A commodity business does not earn 85 cents of gross profit on every dollar of revenue by accident. That margin is what a genuine, sustained shortage looks like on a balance sheet. Micron’s revenue hit $41.5 billion last quarter, up 346% year on year, its fifth consecutive record. When the numbers are that lopsided, the company has little reason to talk the shortage down.</p><p>Then there is the part that tells you this is not a normal cycle. Micron has signed sixteen long-term supply agreements running through 2030, with floor prices the company describes as “well above peak quarterly margins in any past cycle.” The cloud giants paid up front and locked in $22 billion of committed orders. This is not a spot market getting briefly squeezed. It is a price floor written into contracts that last to the end of the decade.</p><p>The window to buy at sane prices existed three to six months ago. If you bought a Mac Studio or a GPU rig back then, you timed it well. Buy today and you are paying the full premium of a supply shock still moving through the system. And that shock will not clear in six months, because the things causing it, three-year fab timelines and hyperscalers buying half the world’s memory before it exists, do not clear in six months.</p><h3>The Supply Lock Nobody Talks About</h3><p>Cloud providers have already reserved roughly half of total global memory production, with some hyperscale operators reportedly putting down 40% prepayments to secure allocations before the wafers are even made.</p><p>When half of supply is spoken for before it arrives, everyone downstream, the researcher, the indie developer, the enthusiast, is fighting over whatever the hyperscalers passed on. This is also why the talk of falling back to older memory is mostly a trap. DDR2 and DDR3 prices are surging not because they are a clever workaround but because desperate buyers are cascading down to them. Winbond is exiting DDR2 production entirely. There is no back door here for anyone running modern workloads.</p><p>There is one quiet winner in all of this: anyone who already owns the hardware. An RTX 4090 that cost $1,200 to $1,500 in 2023 now carries a replacement cost north of $1,800. The memory crisis handed early buyers an unearned capital gain. And the cards have aged well, because the software moved in the right direction. Thanks to quantization, a 24GB card today runs 70-billion-parameter models that needed 140GB of memory two years ago. The hardware got more capable while it sat on your desk.</p><h3>Who Should Actually Buy Now</h3><p>A blanket “don’t buy” is as lazy as a blanket “buy now.” The decision has real numbers behind it, and they sort cleanly by how much you currently spend on AI. The break-even math comes from three independent 2026 cost analyses, and they broadly agree:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yIUZ00A7fKKTnjLoaddYmg.jpeg" /></figure><p>A few of these deserve a sentence more.</p><p>The surprise is the $50 to $200 band, which is where a lot of serious hobbyists actually sit. Your cheapest move there is probably neither cloud nor local. Open-weight models hosted through a provider land below both proprietary APIs and the all-in cost of running your own card at personal volumes. You skip the capital outlay and the electricity bill entirely. The local-versus-cloud debate everyone is having is a false binary for most individuals.</p><p>The privacy row is the one that ignores the table. If you are running AI on your own medical data, inside an air-gapped network, or in a real-time loop where latency matters, no API exists as a substitute. You either have that capability or you don’t, and no price moves the decision.</p><p>And if you already own a capable pre-crisis card, the right answer is usually to do nothing. Run it until 2028. There is no reason to upgrade into a price peak.</p><h3>The Real Window Is 2028</h3><p>2026 is a crunch year. Prices stay high, allocations stay tight, and anyone buying premium local AI hardware now pays a peak tax.</p><p>2027 brings the first new capacity online, the early SK Hynix phase and initial Micron Virginia output, but broad relief waits until those ramps prove out and yields settle. 2028 is when multiple fabs hit maturity at once, the hyperscalers have fed enough of their own demand to stop fighting for every wafer, and the forecasts that currently point in every direction finally start agreeing.</p><p>There is one wildcard that could move that date, in either direction. The entire shortage rests on AI investment staying at full tilt. If hyperscaler spending slows, demand for HBM eases and wafers flow back to consumer DRAM faster than anyone expects. If it accelerates, 2028 slips. The single best signal to watch is not a memory analyst but the quarterly capital expenditure lines from Google, Microsoft, Amazon, and Meta. That is where the real demand lives.</p><p>The clean window already closed once, three to six months ago. The next one is worth waiting for. Not because the crisis ends cleanly, AI memory demand is a long secular trend rather than a passing cycle, but because what you pay today is the top of a supply shock, not the floor of a new normal.</p><p>The people shouting “buy now” loudest are the ones with the clearest reason to want you to. That is not a conspiracy. It is just incentive, plainly visible once you know where to look.</p><h4>Sources</h4><p><strong>Micron Technology, Fiscal Q3 2026 Earnings Call Prepared Remarks.</strong> Sanjay Mehrotra, CEO. June 24, 2026.<br> <a href="https://investors.micron.com/static-files/631b1a32-5537-46ae-8f40-82e42fc79dfe">https://investors.micron.com/static-files/631b1a32-5537-46ae-8f40-82e42fc79dfe</a></p><p><strong>TrendForce, “Tight DRAM Supply Gives Suppliers Greater Pricing Power in HBM.”</strong> June 2, 2026.<br> <a href="https://www.trendforce.com/presscenter/news/20260602-13074.html">https://www.trendforce.com/presscenter/news/20260602-13074.html</a></p><p><strong>TrendForce, “Consumer DRAM Shortages Extend to DDR2 Products.”</strong> June 22, 2026.<br> <a href="https://www.trendforce.com/presscenter/news/20260622-13112.html">https://www.trendforce.com/presscenter/news/20260622-13112.html</a></p><p><strong>The Register, “Micron locks in historically high memory prices for five years.”</strong> Simon Sharwood. June 25, 2026.<br> <a href="https://www.theregister.com/systems/2026/06/25/micron-locks-in-historically-high-memory-prices-for-five-years/5261854">https://www.theregister.com/systems/2026/06/25/micron-locks-in-historically-high-memory-prices-for-five-years/5261854</a></p><p><strong>The Register, “SK Hynix to triple wafer capacity by 2034.”</strong> Tobias Mann. June 12, 2026.<br> <a href="https://www.theregister.com/systems/2026/06/12/sk-hynix-to-triple-wafer-capacity-by-2034/5255151">https://www.theregister.com/systems/2026/06/12/sk-hynix-to-triple-wafer-capacity-by-2034/5255151</a></p><p><strong>The Register, “Expect more of those DRAM price hikes as memory shortage continues to bite.”</strong> Dan Robinson. June 2, 2026.<br> <a href="https://www.theregister.com/storage/2026/06/02/expect-more-of-those-dram-price-hikes-as-memory-shortage-continues-to-bite/5250049">https://www.theregister.com/storage/2026/06/02/expect-more-of-those-dram-price-hikes-as-memory-shortage-continues-to-bite/5250049</a></p><p><strong>The Guardian, “Apple raises iPad and MacBook prices, blaming cost of chips amid AI boom.”</strong> June 25, 2026.<br> <a href="https://www.theguardian.com/technology/2026/jun/25/apple-price-hike">https://www.theguardian.com/technology/2026/jun/25/apple-price-hike</a></p><p><strong>The Register, “Smartphone market to shrink 15 percent this year due to memory crisis.”</strong> Dan Robinson. June 17, 2026.<br> <a href="https://www.theregister.com/personal-tech/2026/06/17/smartphone-market-to-shrink-15-percent-this-year-due-to-memory-crisis/5257652">https://www.theregister.com/personal-tech/2026/06/17/smartphone-market-to-shrink-15-percent-this-year-due-to-memory-crisis/5257652</a></p><p><strong>TechRadar, “RAM is set to get even pricier?”</strong> Darren Allan. June 23, 2026.<br> <a href="https://www.techradar.com/computing/memory/memory-expert-predicts-huge-ram-price-hikes-over-the-rest-of-2026-but-im-not-buying-it-the-forecast-or-the-ram">https://www.techradar.com/computing/memory/memory-expert-predicts-huge-ram-price-hikes-over-the-rest-of-2026-but-im-not-buying-it-the-forecast-or-the-ram</a></p><p><strong>SupplyICs, “HBM and DRAM Supply Chain Dynamics Amid the 2026 AI Bubble Correction.”</strong> June 2, 2026.<br> <a href="https://supplyics.com/insights/market-intelligence/hbm-dram-supply-chain-dynamics-ai-impact-2026/">https://supplyics.com/insights/market-intelligence/hbm-dram-supply-chain-dynamics-ai-impact-2026/</a></p><p><strong>GigaGPU, “RTX 4090 24GB Break-Even Calculator.”</strong> May 4, 2026.<br> <a href="https://gigagpu.com/rtx-4090-24gb-break-even-calculator/">https://gigagpu.com/rtx-4090-24gb-break-even-calculator/</a></p><p><strong>SitePoint, “Local LLMs vs Cloud APIs: 2026 Total Cost of Ownership Analysis.”</strong> March 5, 2026.<br> <a href="https://www.sitepoint.com/local-llms-vs-cloud-api-cost-analysis-2026/">https://www.sitepoint.com/local-llms-vs-cloud-api-cost-analysis-2026/</a></p><p><strong>Markaicode, “RTX 5090 Inference Pricing: Local GPU Costs vs Cloud API.”</strong> May 25, 2026.<br> <a href="https://markaicode.com/pricing/rtx-5090-inference-cost-analysis/">https://markaicode.com/pricing/rtx-5090-inference-cost-analysis/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7c2989db10f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Night They Turned Off the Best AI in the World]]></title>
            <link>https://medium.com/@sparel/the-night-they-turned-off-the-best-ai-in-the-world-cd89a17536d5?source=rss-16c2ce99df95------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd89a17536d5</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[anthropic-claude]]></category>
            <category><![CDATA[tech-policy]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[geopolitics]]></category>
            <dc:creator><![CDATA[Serge Parel]]></dc:creator>
            <pubDate>Sun, 14 Jun 2026 13:30:41 GMT</pubDate>
            <atom:updated>2026-06-14T13:30:41.175Z</atom:updated>
            <content:encoded><![CDATA[<p><em>On a Friday evening in June 2026, the US government picked up a phone and shut down the most capable AI model anyone had ever used. For everyone. Everywhere. Including the people who built it.</em></p><h3>5:21 PM ET on a Friday</h3><p>Somewhere in the world, an agent stopped mid-task.</p><p>A developer in Berlin watched their terminal go quiet. A drug-discovery researcher three days into an autonomous protein design run got an error message. A team at Stripe, which had used Fable 5 to compress two months of engineering into a single day’s work on a 50-million-line Ruby codebase, hit a wall that had not been there an hour earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TQT-juqXmSdMeGQCcQFbFA.jpeg" /></figure><p>What happened was this. At 5:21 PM Eastern Time on June 12, 2026, the US government issued an export control directive ordering Anthropic to suspend all access to Claude Fable 5 and Claude Mythos 5 for any foreign national, anywhere on Earth, including foreign nationals living in the United States, including Anthropic’s own foreign employees. The directive came with no published evidence, no transition plan, and no answer to the obvious operational question of how a cloud API is supposed to sort calls by passport.</p><p>Anthropic complied within hours, in the only way it could. Sorting users by nationality on the fly is not a feature any cloud platform has. So Anthropic killed the models for everyone. Hundreds of millions of users, US citizens included, lost access to what the people who had been using it for three days were calling the largest single capability jump in AI history.</p><p>The reason given was a jailbreak. Someone, the government said, had figured out how to make Fable 5 read a codebase and identify security vulnerabilities, slipping past the safety filters. Anthropic looked at the evidence and published a different reading: the bypass was narrow, applied only in specific contexts, and produced exactly the same output that GPT-5.5 already produces without needing to be jailbroken at all. Anthropic linked to OpenAI’s own cybersecurity disclosures to make the point.</p><p>GPT-5.5 stayed up. Fable 5 stayed down.</p><h3>The Three-Day Window</h3><p>Fable 5 had launched on June 9. The reactions in those three days were unusually consistent. People who had been jaded by years of incremental model releases were genuinely surprised. Cognition’s FrontierBench gave it the top score. Fable could play through Pokémon FireRed using only screenshots, where every previous model had needed a tangle of helper tools. In private testing, Mythos 5, the same underlying model with the safety filters lifted for trusted partners, accelerated protein design experiments by an order of magnitude.</p><p>Three days of that, and then nothing.</p><p>The next morning the picture got stranger. The Wall Street Journal reported, with The Information and Reuters confirming, that Amazon CEO Andy Jassy had been the one to bring the jailbreak to the government. Jassy told Treasury Secretary Scott Bessent and other officials that Amazon researchers had used Fable 5 to obtain information that could be used in cyberattacks. David Sacks, Trump’s former AI czar and now a co-chair of the President’s Council of Advisors on Science and Technology, went on the record with a more pointed version of the story: the administration gave Dario Amodei a choice, fix the jailbreak or pull the model, and Amodei refused.</p><p>Amazon is a five-billion-dollar investor in Anthropic. It runs Anthropic’s models on AWS. It signed a hundred-billion-dollar cloud spending partnership with the company earlier this year. When your largest investor calls the Treasury Secretary about a problem with your product instead of calling you, something is happening that does not fit the standard tech-industry script. Whether the Amazon researchers stumbled onto a real risk and Jassy escalated in good faith, whether Amazon was protecting its own government cloud relationships, whether the administration wanted a pretext and Amazon supplied one, or whether the truth contains pieces of all three, none of the available evidence rules any of those out.</p><p>The Friday timing did not help. This administration has a habit of releasing market-moving news after the close on Friday. Strikes on Iranian nuclear sites, the closure of Venezuelan airspace, a hundred-percent tariff threat against China, a major Intel deal. Friday after market close, every time. The pattern is well-documented. Whether that timing reflects standard practice for minimizing volatility or something less innocent depends on which week you ask, and which event you point at.</p><h3>The Karpathy Problem</h3><p>Here is where the directive’s impossibility comes into focus.</p><p>Andrej Karpathy joined Anthropic in May 2026, reportedly to lead a pre-training research effort aimed at using Anthropic’s own models to accelerate the development of the next generation of Anthropic’s models. He is one of the most respected machine-learning researchers alive, the kind of hire any frontier lab would build a recruiting pitch around.</p><p>He is a permanent resident of the United States, on an EB-1 green card (nicknamed the “Einstein visa”), the visa category reserved for people of extraordinary ability. He is not a US citizen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M7tZn9O7EyJHClN3AYcITw.jpeg" /><figcaption>Andrej Karpathy. Wikimedia Commons</figcaption></figure><p>If you read the directive the way it is written, Karpathy cannot use the model he was hired to improve. He cannot run experiments on Fable. He cannot do recursive distillation. He cannot benchmark a candidate next-generation model against the current one. The recruitment pitch was build the future of Claude using Claude. The directive says you are not allowed to touch Claude.</p><p>He is not the only one. Chris Olah, an Anthropic co-founder who runs much of the company’s interpretability research, was born in Canada. Amanda Askell, who shaped Claude’s character and is one of the most-cited people in alignment research, was born in the United Kingdom. The list goes on, because frontier AI is built by an international workforce. Always has been. Whatever fraction of Anthropic’s research org is non-American, that fraction now exists in a directive-defined gray zone where the company’s own legal compliance posture says they cannot use the company’s flagship product.</p><p>This is the kind of policy that does not survive contact with implementation. Either it gets quietly walked back, or it gets applied selectively in ways nobody publishes, or every frontier lab in the United States ends up running two parallel research stacks for the same reason airlines run domestic and international fleets. None of those outcomes is good for American AI competitiveness, which is presumably what export controls on AI are supposed to protect.</p><h3>The Anthropic Mirror</h3><p>Yann LeCun, who ran AI at Meta and has spent two years in public arguments with the AI-doom camp, wrote three sentences on Facebook the night the directive landed. The closing line was <em>one reaps what one sows.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IVBl59yDux7xzObTdR58-Q.jpeg" /><figcaption>Source: Facebook</figcaption></figure><p>LeCun was being uncharitable, but he was not wrong about the shape of it. For two years Anthropic had been the most prominent voice in the industry arguing that frontier models could become genuinely dangerous, that government should have the authority to block unsafe deployments, that a statutory framework with teeth was necessary to keep the industry honest. The safety research behind those arguments is real and substantive. The jailbreak resistance Anthropic built into Fable was, by any measurable standard, the strongest in the industry. The published system card is more transparent than what comes out of OpenAI or Google.</p><p>And then the government took Anthropic at its word, in the worst possible way.</p><p>There is a specific irony buried in the technical detail. The capability the government cited as the danger, finding vulnerabilities in code, is what defenders do for a living. It is what Project Glasswing was built around, the program where Anthropic gave Mythos-class capability to vetted cybersecurity teams and critical infrastructure operators precisely because that capability has enormous defensive value. The Glasswing partners were the people the government was supposedly protecting from this technology. They were also among the people who lost access to it on Friday night.</p><p>You also cannot read this story without noticing what came before it. Earlier this year the same administration tried to do something close to corporate murder on Anthropic. After the company spent years working its way into Department of Defense procurement and ended up with its models running inside classified systems, the administration turned around and declared Anthropic a supply chain risk, instructing federal contractors and anyone working with the government to drop Anthropic products. That label is normally reserved for foreign adversaries. Chinese frontier labs, by the way, are not on that list. The justification was thin and the timing was political, and the right-wing commentariat picked up the cue and decided that since the administration was attacking Anthropic, Anthropic must be ideologically suspect, and therefore the attacks were correct. A clean little circular argument, written in real time on Twitter.</p><p>The hypocritical part, the part that is genuinely hard to square, is that none of this stopped the Pentagon from using Anthropic’s models. For the five months after the supply-chain-risk designation, Anthropic models continued to power classified operations, including in the Iran conflict. So the company is, simultaneously, a national security risk in commerce and a national security asset in combat. Banned from the federal procurement pipeline as a matter of public posture, deployed inside the kill chain as a matter of operational reality. Both at once, this week.</p><p>Read against that history, the Fable 5 directive starts to look less like a coherent national security action and more like the next move in a sustained campaign. The first move was the supply-chain-risk label, which mostly hurt Anthropic’s enterprise sales pipeline. This move hurts the consumer and developer business, hits an IPO window that everyone in the industry has been watching, and conveniently lands while a company whose CEO has the Treasury Secretary on speed dial happens to be a major Anthropic investor and a competitor in the AI services market. There is no smoking gun. There rarely is. But the pattern is hard to unsee, and “vindictive” is the word the situation keeps reaching for.</p><h3>What This Looks Like From Outside America</h3><p>The directive was framed as a restriction on foreign nationals. Operationally it became a restriction on everyone. The longer-term question is sharper. What happens when the United States and China, the two countries with frontier AI capacity, start treating their best models as strategic assets to be rationed instead of products to be sold?</p><p>Europe is the most exposed, and not in a way Brussels seems to have priced in. The EU has no frontier model. DeepMind is in London but owned by Google. Mistral is doing serious work but is several capability tiers behind Mythos. The EU AI Act, which is finally moving into enforcement phase, was designed to regulate AI use, not to develop European AI capability. Brussels has been chronically late on every layer of this stack: late on cloud, late on semiconductors, late on large language models, late on the inference hardware build-out. If the US and China lock down access to the models at the frontier, Europe has no fallback at that capability level. European research centers, pharma companies, regulated banks, and any software company building on Fable found that out on Friday with no warning, no appeals process, and no European alternative to switch to.</p><p>The rest of the world fares worse. Most of Southeast Asia, Latin America, Africa, and the Middle East has no domestic frontier AI capacity, full stop. They are dependent on US and Chinese models by default. A world where those models are subject to export controls, the way semiconductors and encryption software already are, is a world where the AI revolution happens to some countries and is imported as a service to others, on terms set by governments that have no particular reason to look out for the interests of non-citizens. A Hacker News comment that captured it best, the one cited in the <em>12 grams of carbon</em> Substack the next morning, was four sentences: “in two years, the strongest LLMs may not be available for general use at all. China will not keep its frontier weights open if America stops sharing. Whether we will be poorer or safer in that world is a real question. Whether we will be in that world is no longer one.”</p><h3>The Open-Source Hedge</h3><p>There is a partial answer to all of this, and it has been getting better in plain sight for two years.</p><p>Open-weight models, the kind whose parameters are publicly released and can be downloaded and run on local hardware, cannot be revoked by government directive. When Fable 5 went dark on Friday, the Llama models running on people’s own machines kept working. Qwen 3.6 on a Mac Studio kept working. DeepSeek, GLM 5.1, all of them kept working. No phone call to the Treasury Secretary can reach into your hardware.</p><p>The honest version of the open-source argument, though, has caveats. The best open-weight models today are roughly a generation behind the best proprietary ones. Fable 5 was clearly better than anything you can run locally. Frontier-capable open weights demand hardware that most individuals and small organizations do not own. And if both the United States and China decide that releasing frontier-class weights is itself a security liability, which is exactly where the logic of export controls leads, the open-weight pipeline could narrow. We are not yet in a world where open models match proprietary ones. We are in a world where the gap is closing fast enough that several governments are starting to worry about it.</p><p>What changed on Friday is the calculation, not the capability. Treating open-weight models as a serious infrastructure investment rather than as an interesting research project now has a concrete reason behind it. A hospital running an open-weight model for clinical decision support keeps that capability when the political wind shifts. A university genomics lab does too. A regulated bank in Frankfurt that builds its compliance workflow on a model it controls is not waiting on a Friday phone call from someone in Washington.</p><p>The tradeoff between capability and control is not new. It is the same one that drove enterprises back to on-premise infrastructure after they got burned on cloud cost surprises, and the same one that drove governments to build domestic chip programs after their TSMC dependencies became visible. AI has now crossed the threshold where that tradeoff is worth making, at least as a hedge.</p><h3>What Was Crossed</h3><p>The most important thing about the Fable 5 ban is not whether it was justified. Reasonable people looking at the same evidence will spend months arguing about that. The government has not disclosed the full technical assessment. Anthropic disputes the severity. Amazon’s motives are not legible. The Friday timing is suggestive but not decisive. The fact that GPT-5.5 has comparable cybersecurity capabilities and was not restricted is an anomaly nobody in the administration has bothered to address.</p><p>All of that matters. None of it changes what got crossed.</p><p>On June 12, 2026, the US government showed it had both the legal authority and the political will to remove a frontier AI model from global use within hours. Future administrations inherit that precedent, the better ones with cleaner process and the worse ones with more cynical motives. The specific decision may be reversed next week. <strong>The capability to make such a decision will not be uninvented</strong>.</p><p>The crypto wars of the 1990s are the closest analogy and the most cautionary one. The US government spent most of a decade trying to control strong encryption, treating it as a munition. The government eventually lost, because encryption is mathematics and mathematics travels. But the loss took seven years, and during those years the companies that built encryption infrastructure mostly served US and European customers. The rest of the world waited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*pOokw3EsXDoXFfvMPUpK6Q.jpeg" /><figcaption>Munitions T-Shirt. Wikimedia Commons, modified by the author</figcaption></figure><p>AI weights are not quite mathematics. A trained model is a specific artifact, the product of specific data and specific compute, not something you can derive from first principles in a textbook. Restricting a particular set of weights is, in this narrow sense, more enforceable than restricting an algorithm. That makes the optimistic version of the crypto wars analogy weaker. Export controls on AI may eventually fail. They may not fail quickly.</p><h3>What to Do on Monday</h3><p>Anthropic says it is working on restoration. As of this writing nothing has been announced. The questions worth tracking are not whether the jailbreak was real, because it probably was in some narrow form, but whether the government will publish any standard for what triggers a restriction, whether Anthropic will mount a legal challenge or settle for quiet negotiation, and whether the GPT-5.5 anomaly will eventually force someone to be consistent.</p><p>For organizations that depend on frontier AI, the response is not to stop using hosted models. <strong>It is to stop treating any single hosted model as infrastructure</strong>. Build an abstraction layer that lets you swap models without rewriting your application. Maintain a tested open-weight fallback for the workflows you cannot afford to lose. Negotiate contracts with explicit access continuity provisions, and renegotiate them once your provider’s lawyers have absorbed what just happened. If you are running anything outside the United States, push your government to treat AI capability as a strategic interest rather than as a content moderation problem.</p><p>The developers who built their workflows on Fable 5 three days before the ban did nothing wrong. They used the best tool available. The takeaway is not that they were naïve. The takeaway is that the rules changed faster than they expected, and that the rules are going to change again.</p><p>The next time, the people who lose access first will not get a warning either.</p><h3>References</h3><ol><li>Anthropic. <em>Claude Fable 5 and Claude Mythos 5</em> (launch announcement). June 9, 2026. <a href="https://www.anthropic.com/news/claude-fable-5-mythos-5">https://www.anthropic.com/news/claude-fable-5-mythos-5</a></li><li>Anthropic. <em>Statement on the US government directive to suspend access to Fable 5 and Mythos 5</em>. June 12, 2026. <a href="https://www.anthropic.com/news/fable-mythos-access">https://www.anthropic.com/news/fable-mythos-access</a></li><li>OpenAI. <em>GPT-5.5 System Card — Cybersecurity</em>. April 23, 2026. <a href="https://deploymentsafety.openai.com/gpt-5-5/cybersecurity">https://deploymentsafety.openai.com/gpt-5-5/cybersecurity</a></li><li>Anthony Ha. <em>Amazon CEO reportedly raised Anthropic model concerns before government crackdown</em>. TechCrunch, June 13, 2026. <a href="https://techcrunch.com/2026/06/13/amazon-ceo-reportedly-raised-anthropic-model-concerns-before-government-crackdown/">https://techcrunch.com/2026/06/13/amazon-ceo-reportedly-raised-anthropic-model-concerns-before-government-crackdown/</a></li><li>theahura. <em>Tech Things: There is a massive shadow hanging over this Fable thing</em>. 12 Grams of Carbon, June 13, 2026. <a href="https://12gramsofcarbon.com/p/tech-things-there-is-a-massive-shadow">https://12gramsofcarbon.com/p/tech-things-there-is-a-massive-shadow</a></li><li>Yann LeCun. Comment on the Fable 5 directive. Facebook, June 13, 2026. <a href="https://www.facebook.com/share/18akCaWG6i/">https://www.facebook.com/share/18akCaWG6i/</a></li><li><em>The Karpathy Paradox: When a Frontier AI Researcher Is Locked Out of the AI He Was Hired to Build</em>. DeepNetGroup post, June 13, 2026. <a href="https://www.facebook.com/groups/DeepNetGroup/permalink/2844133139312883/">https://www.facebook.com/groups/DeepNetGroup/permalink/2844133139312883/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd89a17536d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI’s All-You-Can-Eat Era Just Ended — And Most Companies Haven’t Heard the Alarm]]></title>
            <link>https://medium.com/@sparel/ais-all-you-can-eat-era-just-ended-and-most-companies-haven-t-heard-the-alarm-56cfccfa0bb8?source=rss-16c2ce99df95------2</link>
            <guid isPermaLink="false">https://medium.com/p/56cfccfa0bb8</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[enterprise-technology]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Serge Parel]]></dc:creator>
            <pubDate>Tue, 26 May 2026 18:45:39 GMT</pubDate>
            <atom:updated>2026-06-21T16:20:33.556Z</atom:updated>
            <content:encoded><![CDATA[<h3>AI’s All-You-Can-Eat Era Just Ended — And Most Companies Haven’t Heard the Alarm</h3><p><em>The flat-fee AI pricing model collapsed in May 2026. A pricing war with hard July deadlines is reshaping the economics of coding agents. But the real story isn’t the pricing. It’s what enterprises can do right now about the cost drivers nobody is talking about.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*cG6DxnFaX0YvL6_w2XVe3A.jpeg" /><figcaption><em>“The All You Can Eat Buffet, Grafton Street” by Eric Jones / Geograph, CC BY-SA 2.0</em></figcaption></figure><h3>The Week Everything Changed</h3><p>On May 14, 2026, two press releases formally ended the era of unlimited AI. Anthropic announced that effective June 15, its Claude subscription would split into two pools: interactive usage (a human at a keyboard) would stay in the plan, but automated and agentic usage, the kind generated by AI coding agents running tasks around the clock, would move behind a separate credit meter with fixed monthly API credits. Within hours, Sam Altman posted that OpenAI would give enterprise customers two free months of Codex if they switched within 30 days, complete with a one-click migration tool. Anthropic countered the same day with a 50% capacity boost valid until July 13.</p><p>GitHub, which owns the most-used developer tool in the world, made the same move independently. On April 27, Chief Product Officer Mario Rodriguez published an unusually direct blog post: “Copilot is not the same product it was a year ago. It now powers far more complex, agentic workflows that consume far more compute.” Starting June 1, all Copilot plans would transition to usage-based billing, with flat-rate premium requests replaced by token-based AI Credits.</p><p>Then came the strangest signal of all. According to a widely-circulated LinkedIn post from technology executive Debashis Ghosh, Microsoft has decided to pull Claude Code from its own engineering division (the one that builds Windows, 365, Outlook, Teams, and Surface) effective June 30. The decision came after a six-month parallel trial in which engineers reportedly preferred Claude Code over Microsoft’s own Copilot CLI. Microsoft has not officially confirmed this, and the report should be treated as unverified, but if accurate, the implications are striking: this is the same Microsoft that invested $5 billion in Anthropic and committed to a $30 billion Azure deal. The strategic partnership remains intact. The internal spend was the part that got cut.</p><h3>How We Got Here: A Flat Fee Met an Autonomous Consumer</h3><p>The explanation is structurally simple, even if its consequences are complex. AI subscriptions were designed for humans, who send dozens or hundreds of prompts per day, bounded by the speed of reading and thinking. This puts a natural ceiling on consumption, the same ceiling that makes Netflix’s unlimited streaming viable: you can only watch so many hours of television.</p><p>Agentic coding tools have no such ceiling. One autonomous agent can generate thousands of API requests per session, run tests continuously, browse the web, and recursively call models. It doesn’t pause for coffee. The consumption asymmetry between a human and a fully autonomous coding agent isn’t 2x or 5x; it’s 100 to 1,000x. The subscription was priced for the human. The agent showed up anyway.</p><p>At Anthropic’s Max plan ($200/month), CNBC estimated a heavy Claude Code user could receive usage worth up to $5,000 at API rates: a 25x subsidy. This wasn’t a pricing error but a deliberate customer acquisition cost. The error was that agentic workloads made the subsidy far larger than projected, because the use case that created the most enterprise value (running agents continuously) was the one that most violated the economics.</p><p>Two additional mechanisms made the crisis acute rather than gradual. The first was a stealth tokenizer change. When Anthropic released Claude Opus 4.7 in April, it kept per-token prices identical to the previous model. But the new tokenizer, the component that determines how many tokens your input “costs,” generates up to 35% more tokens for the same text. Same price per token, more tokens per sentence. Bills climbed 27% or more with no change to any pricing page, the kind of increase that only appears on the invoice three months later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P55PQgDCNSPV6yFPeu_r3A.jpeg" /><figcaption><em>“Wall Street sign” by PLBechly, CC BY-SA 4.0</em></figcaption></figure><p>The second was the IPO forcing function. Both OpenAI ($852B post-money valuation) and Anthropic (over $30B annualized revenue) are targeting second-half 2026 IPOs. Public markets will not tolerate widening gaps between subscription revenue and compute cost, and usage-based billing is the fastest path to investor-grade unit economics. The repricing that would have happened gradually over two years got compressed into six months by the need to file prospectuses.</p><h3>The Damage Report</h3><p>Uber burned through its entire 2026 AI budget by April. Monthly API costs per engineer ranged from $500 to $2,000, with 84% of its developers classified as agentic-coding users in internal telemetry and 70% of committed code generated by AI. The tool proved too successful to afford at scale. ServiceNow hit the same wall. KPMG data shows U.S. organizations projecting average AI spending of $207 million over the next 12 months, nearly double what they projected a year ago, and Goldman Sachs surveys indicate large companies are already overrunning budgets by orders of magnitude.</p><p>The clock is ticking. Anthropic’s promotional capacity boost expires July 13, and OpenAI’s two free months expire around the same date. After July, the competitive urgency fades and pricing leverage shifts back to providers. Enterprises that haven’t negotiated contracts or implemented cost controls by then will be operating without a safety net.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JxGgGaD5zrGyqf_iqF5kiQ.jpeg" /><figcaption>“A yellow smoke bomb with a lit fuse” by P. Gordon, <em>CC BY-SA 2.0</em></figcaption></figure><h3>The Ferrari to Aldi Problem</h3><p>Here is the part of the story nobody is telling: a significant fraction of the enterprise cost explosion is avoidable right now, without any vendor negotiation, contract change, or pricing war resolution. Two mechanisms are entirely within enterprise engineering control, and a third sits at the intersection of engineering and culture.</p><h4>1. Stop Sending the Whole Codebase on Every Call</h4><p>Every token in your context window is billed on every API call. An agentic session that accumulates 100K tokens of context (file reads, test outputs, error messages, conversation history) and makes 50 API calls is sending 5 million input tokens, even if the model only needed 10K tokens for the last task step. Three patterns of context bloat are invisible on invoices but structurally present in every naive agentic deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PLgLxqfYJfi5y7dIxCTefg.jpeg" /><figcaption><em>“kWh Energy meter” by Asurnipal, modified by the author, CC BY-SA 4.0</em></figcaption></figure><p>The first is naive accumulation: the agent appends every tool result to the running context without pruning. A session that reads 20 files and runs 10 tests builds a 200K-500K token context where 90% is irrelevant to the current step. The second is full-codebase injection, where developers or agents inject entire repositories into the system prompt as “background context.” A 50K-token codebase sent on every call at 500 calls/day is 25 million tokens of daily context overhead, roughly $125/day at Opus rates, for content that adds near-zero value after the initial few calls. The third is the absence of prompt caching: Anthropic’s prompt caching feature offers a 90% discount on cached input, yet most enterprise deployments reconstruct the full system prompt on every call, paying full price every time for content that hasn’t changed.</p><p>The fix is engineering, not negotiation. Use prompt caching for stable content (90% savings on that portion). Implement RAG-based context injection: retrieve only the relevant 2–5K tokens of code instead of injecting 50K every time. Apply context pruning by summarizing or dropping old messages after N turns. Set output length constraints, since output tokens cost 5x input. Together, these techniques can reduce token consumption by 30–70% without any change to output quality.</p><h4>2. Stop Using the Ferrari for Every Trip</h4><p>Under flat-fee pricing, there was no financial reason not to use the best available model for every task. Under metered billing, the cost differential is real and stark. Claude Opus 4.7 costs $5.00 input / $25.00 output per million tokens. Sonnet 4.6 costs $3.00 / $15.00. Haiku 4.5 costs $1.00 / $5.00. Opus is 5x more expensive than Haiku.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EqvL6K_bAYU8eUxkxXpL1g.png" /><figcaption><em>“Ferrari LaFerrari GIMS 2024” by Alexander-93, modified by the author, CC BY-SA 4.0</em></figcaption></figure><p>For a 500-engineer organization, the difference between “default to Opus for everything” and “route intelligently” is approximately $9.6 million per year. Most enterprise deployments still route every task to the flagship model, which was rational under flat-fee pricing (the best model was free to choose) and financially irrational under metered billing for the majority of tasks.</p><p>Not everything needs the Ferrari. Code completion, simple refactoring, and documentation are tasks Haiku handles at 1/5th of the cost with no quality loss. Most coding tasks, unit test generation, and PR reviews are well within Sonnet’s range, at 40% less than Opus. Complex architectural reasoning, security analysis, and novel multi-step problems are where Opus is genuinely justified.</p><p>A well-implemented model routing layer classifies each task at the start, routes to the cheapest sufficient model, and escalates only when the lower-tier output fails a quality check. The estimated cost reduction from intelligent routing is 60–70% compared to all-Opus default, with comparable quality on the overwhelming majority of tasks.</p><h4>3. Teach Your Engineers (Two Hours Is Enough)</h4><p>Under flat-fee pricing, no developer needed to know what a token cost. Under metered billing, every developer habit has a price tag. Conversational over-prompting, where developers ask “explain what you did” after every generation or re-ask slightly varied questions instead of refining one prompt, multiplies token consumption for the same output. Pasting excessive context, like including entire files when the question is about 20 lines, can be a 50x inflation: a 10,000-token manual injection that could have been 200 targeted lines.</p><p>Other habits are equally costly. Not batching async work means paying double, since the Batch API offers 50% off and developers who could submit overnight analysis jobs interactively are paying for latency they didn’t need. Using the LLM for search burns tokens on questions that grep, documentation, or a quick web lookup would answer better. Unconstrained output is particularly expensive because output tokens cost 5x input: a prompt that generates 3,000 tokens when 300 would suffice costs 10x more in output alone.</p><p>A two-hour training session covering these five habits, the token model, the model tiers, and the cost impact of each choice is among the highest-ROI interventions available to engineering managers right now. No infrastructure required. No vendor negotiation. Just knowledge transfer that the flat-fee era made unnecessary and metered billing makes urgent.</p><h3>The Pricing War Window: What to Do Before July</h3><p>Both OpenAI and Anthropic are spending aggressively to lock in customers before their IPO windows open, creating a brief window of roughly six weeks where enterprise buyers have unusual negotiating leverage.</p><p>Lock in token pricing by negotiating multi-year metered contracts at current promotional rates before July expiry, because after July, there is no competitive reason for either provider to offer below-cost incentives. Build vendor optionality: OpenAI’s one-click migration tool and Anthropic’s MCP configuration portability both lower switching costs, so use both providers now and let the one you prefer after July be the one you negotiate from a position of strength. Audit token consumption at the per-team, per-agent, per-model level, because you cannot negotiate what you cannot measure. Finally, model your costs at 2x to 5x current metered rates: the current promotional prices are explicitly transitional, and you should budget for what comes after the war.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CoGY360Ay2T6dRxBVNWSqw.jpeg" /><figcaption><em>“Wikimedia Foundation Servers” by Victor Grigas, CC BY-SA 3.0. Source: Wikimedia Commons</em></figcaption></figure><h3>Beyond Tokens: Where This Goes Next</h3><p>Step back from the immediate pricing war for a moment and consider the billing primitive itself. A token is not a natural unit of value; it is an implementation detail of transformer architectures, the equivalent of billing for electricity by electron count. It measures the mechanism, not the outcome. And that distinction matters more than it sounds!</p><p>Salesforce is making a different bet, rolling out a metric called “agentic work units” that tracks the work AI completes rather than the tokens it consumes. The idea: if an agent resolves a customer support ticket, you pay for the ticket resolved, not for the million tokens the agent burned figuring it out. This is the logical endpoint, and token billing is the second of three pricing eras: flat-fee (2022–2026, customer acquisition, now dead), per-token (2026-~2027, cost-reflective but measuring inputs not outputs), and per-outcome (2027–2030?, measuring what the customer actually received).</p><p>Think about what this means in practice. Two developers ask an AI agent to fix the same bug. Developer A’s agent wanders through the codebase for 3 million tokens, trying multiple approaches and reading irrelevant files before finding the fix. Developer B’s agent, with better prompting and a more structured approach, finds the same fix in 200K tokens. Under per-token billing, Developer A’s fix costs 15x more, despite producing the same outcome. Under outcome billing, both fixes cost the same. The system rewards efficiency rather than penalizing exploration.</p><p>The historical parallel is instructive. Early cloud computing was billed by CPU hours, then moved to more granular units like per-second billing and per-invocation for serverless. The direction has always been toward the most meaningful unit, ultimately toward paying for what was accomplished, not for what resources were consumed. AI billing is on the same trajectory, just earlier in its evolution.</p><p>Outcome-based billing also structurally resolves what we might call the “heavy user paradox”: if a tool costs more the more your strongest people lean on it, how do you keep that in check without discouraging exactly the behavior you were trying to encourage? Under token billing, this is unsolvable. Under outcome billing, it dissolves: cost scales with output delivered, not input consumed, and your best engineers produce more outcomes per token, making them your <em>cheapest</em> users on a per-outcome basis.</p><p>The practical implication for enterprises today: don’t lock into long-term contracts priced exclusively on tokens. The billing primitive will shift. Build flexibility into your agreements.</p><h3>The Question Nobody Is Asking</h3><p>One final observation. Not a single source in the entire public discourse on this crisis quantifies what the AI spending <em>produced</em>. Zero. Every article is about costs: Uber’s $1,500 per engineer per month, ServiceNow’s blown budget, KPMG’s projections, Anthropic’s repricing, OpenAI’s land grab. Nobody asks what those tokens built. If 70% of Uber’s committed code is AI-generated and 1,800 code changes per week require no human input, what is that worth? If AI tripled engineering throughput, $1,500/engineer/month is among the best ROI in Uber’s entire cost structure.</p><p>The cost conversation without the value conversation is half a sentence. The companies that will thrive in the metered-billing era won’t be the ones who cut AI spending most aggressively. They’ll be the ones who spend the same amount or more, but on the right tasks with the right models at the right context size, and who can prove with data that the investment produced more than it consumed.</p><p>The subsidy era ended with a press release on a Wednesday in May. The question now isn’t whether you heard the alarm. It’s whether you have anything to say about value, or only about cost.</p><h3>References</h3><ol><li>Fried, I. (2026, May 14). <em>Anthropic tightens Claude limits and OpenAI courts defectors.</em> Axios. <a href="https://www.axios.com/2026/05/14/anthropic-claude-price-openai-tokens">https://www.axios.com/2026/05/14/anthropic-claude-price-openai-tokens</a></li><li>Rodriguez, M. (2026, April 27). <em>GitHub Copilot is moving to usage-based billing.</em> The GitHub Blog. <a href="https://github.blog/news-insights/company-news/github-copilot-is-moving-to-usage-based-billing/">https://github.blog/news-insights/company-news/github-copilot-is-moving-to-usage-based-billing/</a></li><li>Bosa, D., &amp; Wu, J. (2026, April 17). <em>AI demand is inflated, and only Anthropic is being realistic.</em> CNBC. <a href="https://www.cnbc.com/2026/04/17/ai-tokens-anthropic-openai-nvidia.html">https://www.cnbc.com/2026/04/17/ai-tokens-anthropic-openai-nvidia.html</a></li><li>Joseph, D. (2026, April 23). <em>Why Uber has already burned through its AI budget.</em> AI Magazine. <a href="https://aimagazine.com/news/why-uber-has-already-burned-through-its-ai-budget">https://aimagazine.com/news/why-uber-has-already-burned-through-its-ai-budget</a></li><li>Finout. (2026, May 11). <em>Anthropic API pricing in 2026: Complete guide — models, caching, batch &amp; optimization.</em> <a href="https://www.finout.io/blog/anthropic-api-pricing">https://www.finout.io/blog/anthropic-api-pricing</a></li><li>The State of Brand. (2026, May). <em>The time bomb went off: AI’s all-you-can-eat era just ended in real time.</em> <a href="https://www.thestateofbrand.com/news/ai-subscription-price-subsidiation-ending">https://www.thestateofbrand.com/news/ai-subscription-price-subsidiation-ending</a></li><li>The Register. (2026, April 16). <em>Anthropic ejects bundled tokens from enterprise seat deal.</em> <a href="https://www.theregister.com/software/2026/04/16/anthropic-ejects-bundled-tokens-from-enterprise-seat-deal/5226555">https://www.theregister.com/software/2026/04/16/anthropic-ejects-bundled-tokens-from-enterprise-seat-deal/5226555</a></li><li>Ghosh, D. (2026, May). <em>LinkedIn post on Microsoft Claude Code cancellation and the AI cost problem.</em> LinkedIn. <a href="https://www.linkedin.com/feed/update/urn:li:activity:7464330756476088321/">https://www.linkedin.com/feed/update/urn:li:activity:7464330756476088321/</a> <em>(Note: The Microsoft cancellation claim has not been officially confirmed by Microsoft and should be treated as unverified.)</em></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56cfccfa0bb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Deal Is Broken: Why Communities Keep Saying No to Data Centers, and What Actually Fixes It]]></title>
            <link>https://medium.com/@sparel/the-deal-is-broken-why-communities-keep-saying-no-to-data-centers-and-what-actually-fixes-it-d77158e94187?source=rss-16c2ce99df95------2</link>
            <guid isPermaLink="false">https://medium.com/p/d77158e94187</guid>
            <category><![CDATA[energy]]></category>
            <category><![CDATA[society]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[politics]]></category>
            <dc:creator><![CDATA[Serge Parel]]></dc:creator>
            <pubDate>Sat, 16 May 2026 09:44:28 GMT</pubDate>
            <atom:updated>2026-05-16T09:44:28.826Z</atom:updated>
            <content:encoded><![CDATA[<p><em>AI infrastructure is coming whether we like it or not. The question is whether it arrives as a partnership or an occupation.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*koF7ZoKeobr9q6NhsUZQzA.jpeg" /><figcaption>Server room of BalticServers” by BalticServers.com — licensed under <a href="https://creativecommons.org/licenses/by-sa/3.0/">CC BY-SA 3.0</a>. Source: <a href="https://commons.wikimedia.org/wiki/File:BalticServers_data_center.jpg">Wikimedia Commons</a>*</figcaption></figure><p>Seven in ten Americans oppose having an AI data center built in their community. Nearly half are <em>strongly</em> opposed. That figure, from a March 2026 Gallup poll [¹], is not a fringe position. It is bipartisan, it spans every age group and income level, and it already exceeds the highest level of opposition to nuclear power plants Gallup has ever recorded in its history.</p><p>Think about what that means. Americans are now more opposed to data centers than they have ever been to nuclear reactors — and the industry hasn’t even had its Three Mile Island moment yet.</p><p>In Festus, Missouri, voters didn’t just file complaints or sign petitions. They waited for Election Day and removed every single council member who approved a $6 billion, 360-acre data center complex. All four. Gone [²]. A petition is now circulating to remove the remaining officials who backed the project.</p><p>Meanwhile, in 2025 alone, 25 data center projects were canceled because of community pushback. That was up from 6 in 2024 and just 2 in 2023. At least 99 projects are currently contested nationally [³].</p><p>The tech industry’s response to all of this has been, broadly, to call communities NIMBYs (“Not In My Back Yard”) and complain about lost enterprise value.</p><p>That isn’t a diagnosis. It is a symptom of a deeper problem, and getting the diagnosis right is the only way to find a solution that actually works.</p><h3>The Opposition Is Rational</h3><p>The dominant framing in tech circles goes something like this: communities are blocking data centers because they’ve been misled. Inflated claims about water use, exaggerated fears about electricity costs, general technophobia. Educate people better, tell a more compelling story about AI’s benefits, and opposition will fade.</p><p>That framing is wrong. Not just partially. It misreads the structure of the problem.</p><p>The Gallup data tells a more nuanced story [¹]:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*EMzZBL2CoLKfnI1Xo6tnqA.jpeg" /><figcaption><em>Source: Gallup, March 2026. Survey of U.S. adults, n ≈ 1,000</em></figcaption></figure><p>Two patterns are worth noting. The first is that opposition is bipartisan and demographically uniform. It shows no meaningful variation by age, income, education, or whether someone lives in a city or a rural area. The second is that the top reasons for opposition are not abstract fears about AI. They are specific, measurable, physical concerns: resource consumption, utility bills, noise, land use. These are real impacts. A hyperscale data center draws power equivalent to a mid-sized city [⁴]. It consumes millions of gallons of water annually for cooling. It generates continuous industrial noise. It covers hundreds of acres. And it typically lands in a community that had no meaningful say in whether it was coming.</p><p>Yes, some specific claims circulating online are exaggerated. A widely-shared report once claimed a Chilean data center used 1,000 times a city’s water supply; the real figure was 0.2 times [³]. But the existence of some exaggerated claims does not mean the underlying concerns are unfounded. The National League of Cities, representing 19,000 member municipalities, has confirmed these are legitimate issues requiring real regulatory solutions, not a communication problem to be managed away [⁴].</p><p>The opposition isn’t irrational. The <em>deal</em> is broken.</p><h3>Two Very Different Stories About the Same Project</h3><p>Here is the economic reality of data center development, told two ways.</p><p><strong>Story A:</strong> A single large data center complex creates tens of thousands of temporary construction jobs, several thousand permanent positions paying well above regional averages, and generates hundreds of millions of dollars per year in local and state tax revenue [⁵]. In Loudoun County, Virginia, home to the densest concentration of data centers on earth, data centers pay $26 in taxes and fees for every $1 of local services they consume [⁶]. That 26:1 ratio has funded $111 million in school investment, $17 million in affordable housing, and net reductions in property taxes for residents [³]. Northern Virginia has been home to a thriving data center ecosystem for 30 years. Opposition has not materialized at scale.</p><p><strong>Story B:</strong> Kevin Stanley is a 57-year-old blind man in Baltimore who survives on disability payments. He lives well over an hour from northern Virginia’s Data Center Alley. He has never attended a city council meeting to oppose a data center. But his electricity bills are roughly 80% higher than they were three years ago. “They’re going up and up,” he told Bloomberg reporters. “You wonder, ‘What is your breaking point?’” [⁷] Stanley’s neighborhood is not an anomaly. A Bloomberg investigation of 25,000 wholesale electricity price points across the US found that costs surged as much as 267% from 2020 to 2025 in areas near major data center clusters — and that more than 70% of the nodes recording price increases were within 50 miles of significant data center activity [⁷]. The tax revenue from those facilities flows to shareholders and into government general funds. The noise, the industrial footprint, the changed character of the neighborhood — those stay local. And then a prominent venture capitalist publishes an essay calling people like Kevin Stanley NIMBYs for opposing it.</p><p>Both stories are true. They describe the same economic reality from different vantage points. Story A captures the aggregate national picture; Story B captures the local experience. The problem is that for most communities, Story B is the only story they actually live, because Story A’s benefits are not structured to reach them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M42SeZkdbwN_gyMjiqEB0g.jpeg" /><figcaption><em>Aerial view of data centers in Loudoun County, near Ashburn, Virginia — the densest data center market on earth, and the only large-scale example of genuine community acceptance. By Theodore Christopher — </em><a href="https://creativecommons.org/publicdomain/zero/1.0/"><em>CC0 Public Domain</em></a><em>. Source: </em><a href="https://commons.wikimedia.org/wiki/File:Data_centers_in_Ashburn.jpg"><em>Wikimedia Commons</em></a></figcaption></figure><p>Garry Tan, president of Y Combinator and one of the most prominent voices arguing for faster data center development, puts the core issue plainly: “local residents are being asked to subsidize AI infrastructure through higher electricity bills with no upside. That’s not a sustainable ask” [³]. He’s right. And the solution he proposes (benefit-sharing) is also right, as far as it goes. Loudoun County proves the model works. The problem is that the industry treats the Loudoun model as optional inspiration rather than mandatory baseline.</p><h3>History Keeps Trying to Warn Us</h3><p>This dynamic is not new. Large infrastructure has always arrived in communities with the same collision of national interest and local cost.</p><p>The US interstate highway system was built by overriding community objections, and in many cases, by routing expressways directly through the densest, most politically vulnerable urban neighborhoods, disproportionately Black communities in Atlanta, Memphis, and Baltimore. The infrastructure got built. The communities were sometimes destroyed. The resentment has lasted generations, and is traceable to the infrastructure distrust that persists today.</p><p>The nuclear power industry believed it could win public acceptance through economic arguments and safety reassurances. It could not. After Three Mile Island in 1979, public opposition crystallized into something immovable, and no new nuclear plant orders were placed in the United States from 1979 until 2012. That is a 33-year halt to an entire sector.</p><p>The nuclear precedent deserves particular attention. Current data center opposition, at 70%, already exceeds the historical peak of nuclear opposition [¹]. And the industry hasn’t had its Three Mile Island moment yet. Festus, Missouri might be a preview of what that looks like when it arrives: a visible, politically consequential event that crystallizes diffuse opposition into organized electoral action. The lesson from nuclear is sobering. Once opposition reaches a tipping point, rational economic argument stops working, and prevention is dramatically cheaper than reversal.</p><p>The pattern across every major infrastructure wave is the same. Speed without consent builds resentment. The highway era moved fast and left damage that took generations to name. Every large-scale infrastructure project that achieved genuine social legitimacy required a negotiated social contract between the people building and the people hosting.</p><h3>The Moratorium Question: Signal, Not Solution</h3><p>In March 2026, Senator Bernie Sanders and Representative Alexandria Ocasio-Cortez introduced federal legislation for an immediate moratorium on new AI data center construction. It would remain in place until Congress enacts laws addressing climate impacts, electricity price increases, job displacement, and the distribution of AI wealth [⁸].</p><p>The bill is almost certainly dead on arrival in a Congress aligned with the Trump administration’s pro-AI growth agenda. But its political trajectory is worth noting. A few months earlier, Sanders himself described the moratorium idea as “radical, fringe and Luddite.” By the time the bill was introduced, towns and counties in Missouri, Indiana, Georgia, and North Carolina had already passed their own local construction bans. At least 11 states are now considering moratorium legislation [⁸]. More than 200 advocacy groups had written to Congress calling for exactly this. A December 2025 poll found 60% of Americans believe the sector should be better regulated.</p><p>That is not a fringe movement. That is the democratic system creating leverage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I7VqvxFzNBxZvHbeL2uClQ.jpeg" /><figcaption><em>Data center infrastructure in the United States, 2025. The intense concentration in Northern Virginia is immediately visible. By U.S. Department of Energy / National Renewable Energy Laboratory (NREL) — </em><a href="https://creativecommons.org/publicdomain/mark/1.0/"><em>Public Domain</em></a><em>. Source: </em><a href="https://commons.wikimedia.org/wiki/File:Data_center_infrastructure_in_the_United_States.jpg"><em>Wikimedia Commons</em></a></figcaption></figure><p>Is a moratorium the right solution? Probably not, for the same reason that pausing a car is not the same as fixing the engine. A moratorium doesn’t restructure the deal; it just stops the clock. When it lifts, the same broken incentives return. Worse, “temporary” pauses in large infrastructure sectors have a habit of becoming permanent political atmospheres. The nuclear industry’s experience is instructive: the pause became a generation-long halt.</p><p>The moratorium proposal is most usefully understood not as policy but as a <strong>price signal</strong>. It tells the industry: fix the deal voluntarily, or wait for legislation that fixes it for you — in a form you will like considerably less. The White House’s response, which has been to host tech executives for voluntary “pledges” to shield Americans from rate hikes, has already been called unenforceable by critics, and most Americans are skeptical of it [⁸]. Pledges are not contracts. Communities know the difference.</p><p>The window the tech industry has to get this right is real, and it is closing.</p><h3>The China Argument Is a Trap</h3><p>When the economic case runs thin, the tech industry tends to reach for the China comparison. China is building AI infrastructure at state-directed pace, unconstrained by community opposition. Every gigawatt blocked by a Missouri city council is a gigawatt the US cedes in a strategic competition with real national security stakes.</p><p>The argument is not wrong as a geopolitical matter. AI capability does increasingly map to military, economic, and intelligence advantage. The competition is real.</p><p>But deployed as a rhetorical move in local community debates, it is politically suicidal. It positions ordinary residents as obstacles to national security. Worse, the implicit message, that the US should override community concerns the way China does, is precisely what Americans find most objectionable about authoritarian governance.</p><p>You cannot win a democratic argument by suggesting your preferred policy is better because it’s more like an authoritarian state.</p><p>There is a more constructive reading of the geopolitical picture. States are competing for data center investment, and the states that have figured out the social contract are winning. Virginia has $203 billion in accumulated data center capital and capacity equal to 23 other US states combined [⁶]. It got there not by steamrolling communities, but by developing a fiscal framework that made the investment attractive while making the benefits visible to residents. A state that passes clear benefit-sharing requirements (ratepayer protection, tax revenue dedication, transparent process standards) actually becomes <em>more</em> attractive to developers, not less, because it provides regulatory predictability and pre-empts the opposition that has been killing projects elsewhere.</p><p>The geopolitical case for fast AI infrastructure development is real. But it is an argument for urgency in getting the social contract right, not for bypassing it.</p><h3>What “Fixing the Deal” Actually Requires</h3><p>Set the advocacy aside on both sides, and the minimum conditions for data center development to earn genuine community support are not complicated. There are four of them.</p><p><strong>Process before announcement.</strong> Communities have to be engaged before decisions are made, not informed afterward. The Festus dynamic, which involved fast-track approval, possible violations of Missouri’s open meetings law, public outrage, and electoral consequence, is entirely predictable when developers treat process as an obstacle rather than a foundation [²]. Consultation after approval is not consultation. It is notification dressed up as participation. Front-loaded engagement typically adds six to eighteen months to a project timeline. Contested projects that skip it typically lose two to five years to litigation, appeals, and cancellation. That tradeoff isn’t close.</p><p><strong>Protect ratepayers from the grid impact.</strong> The single most commonly cited driver of opposition, electricity cost increases, is addressable [¹]. Developers should be required to model and publish the projected impact on local ratepayer bills, then commit to specific mechanisms to neutralize negative effects: rate agreements, developer-funded relief programs, ring-fenced utility structures. The 267% surge in wholesale electricity costs already documented near high-datacenter regions [⁸] is what happens when this step is skipped. It is not charity. It is the minimum cost of operating an industrial facility that imposes costs on the surrounding grid.</p><p><strong>Make the benefit visible and contractual.</strong> Loudoun County works because residents can see the schools that data centers built, the housing that was funded, the property taxes that went down [³][⁶]. Abstract arguments about regional economic multipliers do not create social license. Visible, attributable, personal benefit does. Community benefit agreements, which are binding contracts specifying what share of tax revenue goes to which community purposes with annual public reporting, are how you make that happen. Voluntary corporate commitment is not sufficient. The White House’s unenforceable “pledges” episode is a recent illustration of why [⁸]. Communities need contractual certainty.</p><p><strong>Site appropriately and mitigate honestly.</strong> Industrial zones. Real noise and light mitigation, not compliance minimums. Independent environmental assessments (not developer-commissioned) with genuine community review periods [⁴]. The physical form of a facility tells its neighbors how much the developer respects them.</p><p>None of this requires giving communities a veto over nationally important infrastructure. All of it requires treating communities as partners rather than obstacles to be managed.</p><h3>A Better Question</h3><p>Here is the question the tech industry keeps asking: <em>How do we overcome community opposition to data centers?</em></p><p>Here is a more productive one: <em>What would make communities want to host them?</em></p><p>The first question treats opposition as a problem to solve through better messaging, faster permitting, or federal preemption. It assumes the goal is to build despite community sentiment. The second treats opposition as information about what the current deal is missing.</p><p>Loudoun County answered the second question. Festus, Missouri is what tends to happen when developers keep asking the first.</p><p>Calling communities NIMBYs for rationally opposing the imposition of costs without compensation is not just politically counterproductive. It misdiagnoses the problem in a way that guarantees the wrong prescription. The opposition is not ignorance — the deal is broken. And broken deals don’t get fixed with better slide decks.</p><p>AI infrastructure is coming. The compute required to run modern AI at scale is real, large, and has to be built somewhere. That part is not up for debate. What is up for debate is whether it arrives as a partnership, hosted by communities that chose it because they could see what they would receive in return, or as an occupation, imposed on communities that will then spend the next decade making everyone involved pay for that imposition.</p><p>The model for the first option already exists. It has been running in Northern Virginia for thirty years. It is not secret. The industry just has to stop treating it as optional.</p><p>Fix the deal first. The communications work comes after.</p><h3>References</h3><p>[¹] Gallup. “Americans Oppose AI Data Centers in Their Area.” Survey conducted March 2–18, 2026; open-ended follow-up April 2026. Published May 13, 2026. <a href="https://news.gallup.com/poll/709772/americans-oppose-data-centers-area.aspx">https://news.gallup.com/poll/709772/americans-oppose-data-centers-area.aspx</a></p><p>[²] “Just In: Missouri Voters Fired Every Council Member Who Approved a $6 Billion AI Data Center.” YourDailyUpdates.news, May 13, 2026. <a href="https://yourdailyupdates.news/festus-missouri-voters-oust-council-data-center/">https://yourdailyupdates.news/festus-missouri-voters-oust-council-data-center/</a></p><p>[³] Tan, Garry. “Data Center NIMBYs Are Killing $1 Trillion in AI Infrastructure.” garryslist.org, February 22, 2026. <a href="https://garryslist.org/posts/data-center-nimbys-are-killing-1-trillion-in-ai-infrastructure">https://garryslist.org/posts/data-center-nimbys-are-killing-1-trillion-in-ai-infrastructure</a> <em>(Author is president of Y Combinator with direct financial interest in the AI ecosystem. The “$1 trillion in lost enterprise value” figure chains three uncertain estimates; treat as directional signal. The Loudoun County fiscal data cited here is independently corroborated by [⁶].)</em></p><p>[⁴] Grossman, Jeremy / National League of Cities. “Data Centers and Local Environmental Considerations.” NLC.org, May 23, 2025. <a href="https://www.nlc.org/article/2025/05/23/data-centers-and-local-environmental-considerations/">https://www.nlc.org/article/2025/05/23/data-centers-and-local-environmental-considerations/</a></p><p>[⁵] Consumer Energy Alliance. <em>Economic Impact of Data Centers.</em> December 2025. <a href="https://consumerenergyalliance.org/cms/wp-content/uploads/2025/12/Economic-Impact-of-Data-Centers.pdf">https://consumerenergyalliance.org/cms/wp-content/uploads/2025/12/Economic-Impact-of-Data-Centers.pdf</a> <em>(Important: the Consumer Energy Alliance is a fossil fuel industry lobbying organization funded by BP, ExxonMobil, Shell, Chevron, and the American Petroleum Institute, not a neutral consumer group. Its economic impact figures are benefits-only and were produced to advocate for data center development. Numbers are directionally consistent with independent Virginia data [⁶] but should be read accordingly.)</em></p><p>[⁶] Northern Virginia Technology Council. <em>2024 NVTC Data Center Report.</em> 2025. <a href="https://e1.nmcdn.io/assets/loudoun/wp-content/uploads/2025/05/2024-NVTC-Data-Center-Report.pdf">https://e1.nmcdn.io/assets/loudoun/wp-content/uploads/2025/05/2024-NVTC-Data-Center-Report.pdf</a></p><p>[⁷] Saul, Josh, Leonardo Nicoletti, Demetrios Pogkas, Dina Bass, and Naureen Malik. “AI Data Centers Are Sending Power Bills Soaring.” <em>Bloomberg</em>, September 29, 2025. <a href="https://www.bloomberg.com/graphics/2025-ai-data-centers-electricity-prices/">https://www.bloomberg.com/graphics/2025-ai-data-centers-electricity-prices/</a> <em>(Paywalled; archived at </em><a href="https://archive.ph/meXXv"><em>https://archive.ph/meXXv</em></a><em>)</em></p><p>[⁸] Noor, Dharna. “Bernie Sanders and AOC Introduce Bill to Pause Building of New Datacenters.” <em>The Guardian</em>, March 25, 2026. <a href="https://www.theguardian.com/us-news/2026/mar/25/datacenters-bernie-sanders-aoc">https://www.theguardian.com/us-news/2026/mar/25/datacenters-bernie-sanders-aoc</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d77158e94187" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Golden Cage of Countess Cosel]]></title>
            <link>https://medium.com/@sparel/the-golden-cage-of-countess-cosel-b3b8ced996b6?source=rss-16c2ce99df95------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3b8ced996b6</guid>
            <category><![CDATA[womens-history]]></category>
            <category><![CDATA[history]]></category>
            <category><![CDATA[saxony]]></category>
            <category><![CDATA[baroque]]></category>
            <category><![CDATA[psychology]]></category>
            <dc:creator><![CDATA[Serge Parel]]></dc:creator>
            <pubDate>Sun, 19 Apr 2026 10:24:23 GMT</pubDate>
            <atom:updated>2026-04-19T10:24:23.977Z</atom:updated>
            <content:encoded><![CDATA[<h4>When a Mistress of Augustus the Strong Met Modern Psychology</h4><p>Dresden, a rainy Saturday evening. My partner, our friends, and I had a few days off, just wandering, eating, drinking good wine. That evening we found ourselves at the Boulevardtheater Dresden, tickets to <em>Barock me, Gräfin Cosel</em>. Three hours later, I had questions.</p><p>The production was glittering absurdity. Baroque wigs met pop sensibility. A traveling troupe performing within the story itself, courtly excess colliding with contemporary irreverence. The music was infectious, Bach-like phrases smashing into rock power chords, composers of the era tipping their wigs to Andreas Goldmann’s clever score. But underneath the energy, the story landed differently than the spectacle suggested.</p><p>Watching Anna Constantia von Brockdorff rise and fall across that stage, I wasn’t thinking about romance. I was thinking about psychology. About power and influence, the particular pathology of court life. About a woman imprisoned in a castle for 49 years and what her guard reports might tell us about how she survived, and what surviving cost her.</p><p>Who was she really? And why does her story resonate so much?</p><h3>The True Story: A Biography in Three Acts</h3><h4><strong>Act One: The Rise (1680–1713)</strong></h4><p>Anna Constantia von Brockdorff was born on October 17, 1680, at Gut Depenau in Holstein. Her father was a minor nobleman and landowner; her mother was a merchant’s daughter, which was already marked as unconventional. The Brockdorffs were ancient nobility, one of those longstanding Schleswig-Holstein families that traced their roots back to medieval times. Her mother, Anna Margarethe Marselis, came from wealthy Hamburg merchants: prestige, yes, but also slight social disapproval. Her parents gave her an education remarkable for its era: multiple languages, mathematics, classical studies, music (lute especially), and most unusually for a young noblewoman, a genuine passion for hunting and firearms. Her impetuous nature worried them.</p><p>At fourteen, in 1694, her parents sent her to serve as a lady-in-waiting to Sophie Amalie at Gottorf Castle in Schleswig. It was excellent placement for court training. But eight years later, around 1702, she became pregnant out of wedlock. The father was reportedly Louis Rudolph, Duke of Brunswick-Lüneburg, younger brother of her mistress’s husband. The child was born. Its fate is unknown. She was removed from court in disgrace and sent back to her parents.</p><p>After this shame, she married: Adolf Magnus von Hoym, a Saxon Privy Councillor and senior taxation director, a man over a decade her senior. They married formally on July 2, 1703. The marriage brought her to Dresden and into the orbit of Elector Augustus II, King of Poland. But the union deteriorated rapidly. Historical records use the word “shatters.” By January 1705, it was over.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i9BoqF79SG3ri9ZVrUCG_Q.jpeg" /><figcaption>Anna Constantia and her husband, Adolf Magnus von Hoym (Exhibition Stolpen Castle)</figcaption></figure><p>Then, in 1704, she met Augustus the Strong.</p><p>Augustus II was infamous: libertine, extravagant, polyglot, brilliant in strategy when he bothered to focus. He maintained numerous mistresses, but his wife, Christiane Eberhardine of Brandenburg-Bayreuth, was pious and refused to appear at his Catholic court in Poland. She had essentially exiled herself to Pretzsch Castle in Saxony, becoming what history remembered as “Saxony’s pillar of prayer.” This left a power vacuum at court, one that ambitious women could potentially fill.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*8hmkEvP-qJUn4rZRQip1nA.jpeg" /><figcaption>Augustus the Strong (public domain)</figcaption></figure><p>Augustus noticed Anna Constantia. According to accounts, she initially resisted becoming his mistress. She had lived through enough scandal already, and this refusal seems to have intensified his pursuit. A fire at the Hoym house became the stuff of legend: Augustus witnessed her composure under pressure, and her strategy of playing hard to get clearly worked. By late 1704 or early 1705, as her marriage dissolved, the affair began.</p><p>The turning point came in December 1705, when Augustus signed a secret marriage contract. He promised her his eternal fidelity. She believed (or at least told herself she believed) that when his wife died they would marry. This was leverage extracted through calculated resistance and, possibly, real affection. It elevated her from clandestine mistress to acknowledged paramour.</p><p>In 1706, she was created the Imperial Countess (<em>Reichsgräfin</em>) of Cosel, a title within the Holy Roman Empire itself, arranged through imperial channels. She received the Taschenberg Palace in Dresden, built specifically for her residence starting in 1707. Her annual pension was 100,000 thalers, an astronomical sum. By any measure, she had arrived.</p><p>Between 1708 and 1712, she bore Augustus three children: Augusta Anna Constantia (1708), Friederike Alexandrine (1709), and Frederick Augustus (1712). Augustus fathered many illegitimate children, but the three Cosel children were among the very few he officially acknowledged and ennobled. Historians note this as unusual, suggesting real affection, even by the standards of a man with numerous affairs.</p><p>For seven years, from 1706 to 1713, Anna Constantia wielded real political influence. She was by Augustus’s side daily. She employed spies to monitor his movements. She meddled in state affairs, particularly in the tense Great Northern War, when Saxon military commitments and the precarious Polish throne were at stake. She aligned with the pro-French faction and opposed pro-Austrian courtiers. Her Protestant faith made her suspect to Polish Catholic nobility who wanted the king’s attention turned toward Catholic alliances. Ministers complained that she interfered with diplomatic negotiations, promoted family members to positions of power, and that her influence had simply grown too large to manage.</p><p>By 1713, a coalition of Saxon ministers had decided she needed to go. They began looking for a replacement, someone beautiful enough to hold Augustus’s attention but with no appetite for politics. They found their opening in Warsaw, where Augustus had been visiting Countess Maria Magdalena von Dönhoff. The ministers began engineering the relationship, placing the two together at every opportunity.</p><p>It worked faster than they probably expected. Augustus fell for Dönhoff. Anna Constantia’s spies told her what was happening, and when she learned Dönhoff had borne Augustus a child, she did not take it quietly. According to one account, she confronted him directly: <em>“You promised me upon oath an everlasting fidelity. I will not suffer your abuses except your life pays for them. I am resolved to break your head with a pistol.”</em> She allegedly screamed that they should drown the child, and threatened to strangle both mother and baby if Augustus acknowledged the offspring.</p><p>The threats made things worse. Augustus, now advised by his ministers that she was a political liability, sent word that she was not to appear at court. Anna Constantia tracked him to Warsaw anyway. Dönhoff claimed she feared for her life. Augustus sent his former mistress a formal message ordering her away. She took out a gun and tried to shoot the messenger.</p><p>The relationship was over. Augustus allowed her to retire to Pillnitz Palace, still luxurious, still respected, but removed from power. She lived there for three years in relative comfort.</p><p>Then she made a fatal error.</p><h4><strong>Act Two: The Fall and the Flight (1713–1716)</strong></h4><p>In 1713, as her influence waned, Anna Constantia became involved in factional intrigue again. Court politics in Saxony was not a place for women without active royal protection. By 1715, she was in crisis. She decided to flee.</p><p>Her target was Berlin, where her cousin Count Detlev Christian zu Rantzau held something invaluable: the original secret marriage contract that Augustus had signed in 1705. That document was her hill to die on. With it, she believed she could restore her position, perhaps resurrect her claim on the king, or at minimum maintain leverage. Without it, she had nothing.</p><p>In December 1715, she escaped Pillnitz and made her way to Berlin under Prussian protection. But the Prussian court, wary of antagonizing Augustus, eventually agreed to extradite her. On November 22, 1716, she was arrested in Halle an der Saale and exchanged for Prussian deserters in Saxony.</p><p>Augustus was furious. His ministers were unanimous: she was too dangerous to remain at large. The secret marriage contract represented a potential claim on the throne, or at minimum a political weapon in the wrong hands. Her flight was deemed treason. She was effectively declared a <em>Landesverräter</em> (state traitor), though through royal decree rather than formal trial. For a woman of her era and status, that meant permanent removal from the world.</p><p>On Christmas Eve, 1716, at age thirty-six, Anna Constantia was transported under heavy guard to Stolpen Castle, a remote medieval fortress outside Dresden. The fortress had originally been a bishop’s residence. Now it would be her prison. She was guarded by 40 men to prevent escape or communication. She was confined to the armory, and later to the Johannis Tower, soon to be known as the Cosel Tower, held under constant surveillance.</p><p>She would never leave that tower again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*muv85X9iegiEddFdtPY4Kg.jpeg" /><figcaption>Johannis (“Cosel”) Tower at Stolpen Castle</figcaption></figure><h4><strong>Act Three: The Golden Cage (1716–1765)</strong></h4><p>Forty-nine years. That is the length of her imprisonment.</p><p>The conditions were not brutal by the standards of the era. She was not tortured, not starved, not forced into a dungeon. She had rooms within the tower, modestly furnished compared to her former opulence, but comfortable by prison standards. She had servants, limited mobility within the castle grounds, a Bible, and writing materials (all censored). She was not in absolute darkness or deathly silence. But she was isolated, stripped of titles that mattered to her, denied freedom, separated from her children. Cut off.</p><p>After Augustus died on February 1, 1733, seventeen years into her captivity, his successor, Augustus III, made no move to release her. Rumors persist that she was offered freedom twice, in 1745 and 1756, on the condition that she renounce her title as Countess Cosel. Both times, according to accounts that remain disputed among historians, she refused.</p><p>The historians who cite these refusals interpret them as evidence of either extraordinary stubbornness or of what we might now recognize as complex trauma. She had become institutionalized. The walls of Stolpen were all she knew. The title “Countess Cosel” was the only thing the world had not taken from her. It was her identity, and her refusal to let go of it may have been the only form of resistance still available to her.</p><p>Or perhaps she simply could not fathom a world beyond those walls.</p><p>She died on March 31, 1765, at age eighty-four. She was buried in the castle chapel, never leaving Stolpen even in death. In 1881, during restoration work at Stolpen Castle, excavations beneath the chapel revealed a brick-built vault. Workers found her remains, a neo-Gothic cross now marking the spot where she finally rested.</p><h3>The Psychological Analysis: What the Guard Reports Reveal</h3><p>Here is where the story becomes unsettling. The guardians at Stolpen Castle kept detailed reports. For nearly five decades, officers of the Saxon guards documented the Countess’s behavior: her complaints, her symptoms, her moods, her health. These reports were filed with the Elector’s administration in Dresden. What emerges from these documents is not a heroic victim or a tragic lover. It’s something more complicated: a person whose patterns of behavior modern psychology would recognize immediately.</p><h4>What the Documents Show</h4><p>The guard reports are meticulous. Officer after officer notes the same things:</p><ul><li>She claims sudden illnesses that appear and vanish in correlation with visitors or the arrival of guards.</li><li>Her symptoms are theatrical: dramatic fainting spells, elaborate descriptions of pain, emotional outbursts timed to ensure maximum visibility.</li><li>When guards are present, her suffering intensifies. When alone, she appears to recover.</li><li>She manufactures situations that demand attention, stages emotional crises, creates conflicts with servants, engineers small dramas that the guards must report up the chain of command.</li><li>Over years, the officers develop something approaching clinical observation: her symptoms are real enough, but they serve a function. They communicate. They demand response.</li></ul><p>For a woman imprisoned in a remote castle with no voice in the outside world, this makes psychological sense. It is the only language the system will hear.</p><h4><strong>Reading the Patterns (With Appropriate Caution)</strong></h4><p>Applying modern psychological frameworks to an 18th-century figure is inherently anachronistic. But it is useful anachronism. It illuminates patterns of human behavior that transcend eras. And the guard reports give us something rare in history: longitudinal data over forty-nine years.</p><p>The current WHO standard, ICD-11, abandoned the old named personality disorder categories entirely. There is no longer a discrete “Histrionic Personality Disorder” or “Narcissistic Personality Disorder” in the classification. Instead, ICD-11 uses a dimensional model: a single “Personality Disorder” diagnosis, graded by severity, then described through trait domains. That shift actually suits Anna Constantia better than the old system did. Her behavior does not fit neatly into one box. It spans several.</p><p><strong>Negative Affectivity</strong> covers emotional instability, anxiety, and volatile reactions disproportionate to circumstances. The guard reports are full of it: sudden illnesses that vanish when no one is watching, outbursts timed to coincide with audiences, emotional crises staged for impact. Her suffering was real enough, but it also served a purpose.</p><p><strong>Dissociality</strong> describes a disregard for others’ interests and a tendency to use relationships instrumentally. The Lieutenant Helm incident (see below) is the clearest illustration: she converted his act of kindness into a security breach that cost him years of his life. The guard reports suggest she understood exactly what she was doing.</p><p><strong>Disinhibition</strong> covers impulsivity and a failure to moderate behavior based on consequences. The flight to Berlin fits here. So does the pistol at the messenger. And so, arguably, does refusing freedom for forty-nine years rather than surrendering a title that had long since stopped meaning anything to anyone but her.</p><h4><strong>Why This Matters</strong></h4><p>Applying modern psychological frameworks to historical figures is not about diagnosing them. It’s about recognizing patterns, acknowledging that the trait constellations described in 2026 are not inventions of modern psychology. They are recognizable across centuries.</p><p>The 18th-century answer to Anna Constantia’s behavior was simpler. She was a “hysterical woman,” an ambitious upstart, a dangerous woman who had overreached. Those labels were socially acceptable frameworks for pathologizing female ambition and dismissing her as irrational.</p><p>A modern lens does something different. It takes her seriously. It says her behavior was not random: it was patterned, strategic, a response to constraint. It served specific functions: attention-seeking, identity maintenance, emotional expression in a system that denied her any legitimate voice.</p><p>And yet this is crucial. Understanding these patterns does not erase her culpability or her agency. She chose to refuse freedom to preserve a title. She chose to flee to Berlin, to stage emotional crises, to manipulate those around her. These were her choices. But understanding the psychological architecture beneath them allows us to see her not as either a romantic figure or a villain, but as a human being whose personality and circumstances created a tragic convergence.</p><h3>The Lieutenant Helm Incident: A Case Study</h3><p>In 1718, barely two years into her imprisonment, Anna Constantia engineered a bribery scheme that would cost an unwitting man years of his life.</p><p>A guard named Lieutenant Helm was young, perhaps sympathetic to her isolation, perhaps simply moved by chivalry. One day, she dropped a handkerchief from her window. It was a romantic gesture, deliberately so. Helm, playing the part of the gentleman, picked it up.</p><p>But as he climbed the staircase, unseen by other guards, Anna Constantia passed him a receipt. It was an invoice for goods, a mundane document. But it was a message. It proved she could communicate with the outside, that the security was penetrable, that she had allies.</p><p>The authorities discovered the scheme. Helm was arrested, tried, and sentenced to death, later reduced to three and a half years in prison. His crime: showing her a moment of kindness.</p><p>What is psychologically significant about this incident is not the scheming itself. That was practical, even understandable; she had real reasons to want contact with the outside world. It was the architecture of the scheme. Anna Constantia could have used the receipt simply as communication. Instead, she constructed something more elaborate. The handkerchief was performance. The receipt was performance. Helm’s sympathetic gesture was the prop. What she created was a situation that forced a response from the system.</p><p>She had created a tableau: a man showed her kindness, she manipulated that kindness into an act of treason against his employer, and the state responded with disproportionate punishment. In the middle of it all sat Anna Constantia, simultaneously perpetrator and audience.</p><p>In psychological terms, this is a pattern of engineering situations in which her own actions produce harm to others, while allowing her to witness the consequences. It communicates something: <em>“See what happens when you get involved with me. See the power I still have, even from this tower.”</em></p><p>Helm’s punishment was severe. But for Anna Constantia, the incident was proof that she still mattered. That she could still affect the world. That the walls had not yet contained her entirely.</p><h3>The Musical: “Barock me, Gräfin Cosel”</h3><p>We sat in a theater watching a baroque traveling troupe perform a musical within the musical structure of the production itself. Very German, this recursive, meta-theatrical approach to historical tragedy. The production is subtitled: <em>“Ein perücktes Musical über Macht, Mätressen und Magie”</em>, “A crazy musical about power, mistresses, and magic.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*60JrQU8j2HQ-Jnat-DW7Jw.jpeg" /><figcaption>“Barock me, Gräfin Cosel” (<a href="https://boulevardtheater.de/">https://boulevardtheater.de/</a>)</figcaption></figure><p>The production gets several things right.</p><p>It centers her agency rather than just her suffering. She is not a passive victim but an active architect of her own rise and, to some degree, her fall. The musical shows her choosing to play hard to get, pursuing the secret marriage contract, refusing freedom. These are presented as her decisions, not things that happened to her.</p><p>The absurdity of the aesthetic (the wigs, the contemporary pop music mixed with baroque orchestrations, the theatrical camp) actually serves the material well. There is something deeply absurd about a woman imprisoned for forty-nine years, still insisting on a title no one acknowledges. The baroque <em>Perücke</em> becomes a metaphor for all the trappings that don’t matter anymore: the powdered hair, the imperial titles, the marks of nobility that mean nothing when you are locked in a tower.</p><p>And the production does not shy away from the psychology. It shows her as dramatic, demanding, petulant, but also trapped. It shows Augustus as infatuated but ultimately cowardly, acquiescing to his ministers rather than defending her. The ministers are portrayed as pragmatists managing a crisis. Everyone is comprehensible from their own perspective.</p><p>But it also has limitations.</p><p>It tends toward romantic melodrama in places where psychological clarity would deepen the material. The “golden cage” framing, while poetic, still romanticizes what was a prison. The musical energy and camp sensibility can obscure the real tragedy underneath: a woman who spent half a century confined, her mind the only territory she could actually govern.</p><p>And the production does not fully engage with the psychological dimensions: the guard reports, the decades of documented behavioral patterns, the particular damage done to a brilliant woman imprisoned in a system with no legitimate outlet for her intelligence or ambition. These complexities could deepen the material immensely.</p><p>But perhaps that is unfair. The musical does what theater does. It makes the story accessible, emotional, alive. It does not pretend to be psychohistorical analysis. It is entertainment that takes her seriously enough to suggest that her story still matters.</p><p>And it does still matter.</p><h3>Why Her Story Matters Now</h3><h4>The Prison of Narrative</h4><p>We do this still. We contain difficult women in narratives that strip their agency.</p><p>The initial narrative about Anna Constantia was that she was a hysterical woman, an ambitious upstart, a mistress who overreached. Convenient shorthand for minimizing her threat. It made her pathological rather than political. It explained her punishment as inevitable rather than chosen by the men around her.</p><p>A psychological reading, that she displayed histrionic and narcissistic traits, can seem like it does the same thing, reduces her to a diagnosis. But it does something different. It takes her seriously. It says her behavior was not random or irrational. It was patterned, strategic, a response to constraint. And it acknowledges that the state <em>chose</em> to interpret her behavior as treason and locked her away for forty-nine years.</p><p>Modern parallels aren’t hard to find. We still pathologize ambition in women who are deemed “difficult.” We still label assertiveness as hysteria when it exceeds acceptable bounds. The vocabulary has changed; the reflex has not.</p><p>The insight about Anna Constantia is not that she was “really” histrionic or narcissistic. It’s that the categories we use to explain human behavior become distorted when applied to people without institutional power. When a king displays narcissistic patterns, we call it charisma. When a mistress insists on her title, we call it histrionics.</p><h4>The “Impossible” Refusal</h4><p>Multiple times over decades, if the accounts are accurate, Anna Constantia was offered freedom. The condition: renounce her title as Countess Cosel.</p><p>She refused.</p><p>For decades, she refused. Even as her beauty faded (the guards’ reports note this with the dispassionate cruelty of administrative records), even as the world moved on, even as the title became meaningless to everyone but her, she would not surrender it.</p><p>Modern interpretation sometimes reads this as institutionalization: she had been confined so long that she could no longer imagine life outside. She had internalized her imprisonment so completely that the walls became her identity.</p><p>But there is another reading. This is identity as resistance.</p><p>The state wanted to erase her. It wanted her name gone and her existence forgotten. The condition for freedom was self-erasure: become nobody and you may go.</p><p>She refused. For forty-nine years, confined in a tower, she refused the state’s demand that she disappear.</p><p>I find it hard to call that pathological. Stubborn, certainly. Costly, beyond measure. But defiant in a way that deserves to be taken seriously.</p><h4>Psychology Then vs. Now</h4><p>In the 18th century, the language available to describe Anna Constantia’s behavior was limited. She was “hysterical.” She was “ambitious.” She was “dangerous.” These were socially intelligible framings that justified her imprisonment.</p><p>We still lack adequate language for women whose intelligence, ambition, and emotional intensity exceed socially acceptable bounds. The vocabulary has been updated, but the underlying instinct (to contain, to pathologize) hasn’t changed as much as we’d like to think.</p><p>The psychological framework we can apply now (histrionic patterns, narcissistic patterns, impulsive patterns) is not more accurate or more “true” than the 18th-century language. But it is more honest. It acknowledges that what looked like irrational hysteria was actually sophisticated emotional communication in a system that had given her no legitimate means of expression.</p><p>The guards at Stolpen Castle were accidental psychologists. For forty-nine years, they documented her behavior with the precision of men filling out forms. Modern psychology looks at those records and says: this woman was not mad. She was trapped in a system with no legitimate outlet for her agency, her intelligence, her will. Her symptoms communicated what words could not.</p><h3>The Ghost in the Castle</h3><p>Stolpen Castle still stands. The Johannis Tower is still there. So is the staircase where she passed the receipt to Lieutenant Helm, and the chapel where she was buried, though Napoleon destroyed most of it in 1813. In 1881, during restoration work, excavations revealed her vault beneath the chapel, a brick-built chamber that had held her remains for more than a century.</p><p>Today, the castle is a museum. The Cosel Tower has an exhibition on three floors documenting her life. Visitors can see the rooms where she was held, the narrow windows where she watched the world she could no longer touch. They can read copies of the guard reports. They can see the “Cosel Bible” and original letters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BSnqFU4EZKIp8C8V5ETXIg.jpeg" /><figcaption>Cosel Bible, with AvC (Anna von Cosel) monogram (<a href="https://wissen.schloesserland-sachsen.de/blog/detail/coselbibel/">https://wissen.schloesserland-sachsen.de/blog/detail/coselbibel/</a>)</figcaption></figure><p>The musical lets us laugh and cry. It lets us feel her humanity without becoming entirely complicit in her tragedy. The psychological analysis lets us understand her behavior without excusing or condemning it. But maybe the most honest response is the simplest one. She was a woman who refused to disappear.</p><p>For forty-nine years, confined in a tower, separated from her children, stripped of power, facing an ever-aging face in a mirror, she insisted on her existence and her title. She staged emotional crises when the world stopped listening. She refused freedom if it meant erasing herself.</p><p>In effect, she was saying: <em>I will not disappear. I will not let you erase me. I would rather remain in this tower forever, insisting on being called “Countess,” than vanish into the nothing you offer me.</em></p><p>And so she did.</p><p>Her grave is marked by a neo-Gothic cross in the castle chapel. A stone monument to a woman the state tried to erase, who spent half a century making sure they couldn’t.</p><p>Stolpen Castle today is the architectural record of what happens when a woman’s ambition and intelligence exceed the tolerance of those around her. It is the prison where the state tried to make her disappear. And somewhere in its stones, her ghost persists: not haunting us with accusations, but insisting, as she always did, <em>I was here. I mattered.</em></p><p>That is her legacy.</p><h3>Sources &amp; Further Reading</h3><ul><li>Wikipedia: Anna Constantia von Brockdorff (en.wikipedia.org/wiki/Anna_Constantia_von_Brockdorff)</li><li>Burg Stolpen: Countess Cosel exhibition and information (<a href="https://www.burg-stolpen.org/en/stolpen-castle/countess-cosel/">https://www.burg-stolpen.org/en/stolpen-castle/countess-cosel/</a>)</li><li>Sächsische.de: “Der Gräfin Cosel ganz nah” — burial discovery account (<a href="https://www.saechsische.de/">saechsische.de</a>)</li><li>Boulevardtheater Dresden: “Barock me, Gräfin Cosel” (<a href="http://boulevardtheater.de/">boulevardtheater.de</a>)</li><li>History of Royal Women: “Countess Cosel — The imprisoned love of King Augustus II of Saxony” (<a href="https://www.historyofroyalwomen.com/the-royal-mistresses-series/countess-cosel-the-imprisoned-love-of-king-augustus-ii-of-saxony/">https://www.historyofroyalwomen.com/the-royal-mistresses-series/countess-cosel-the-imprisoned-love-of-king-augustus-ii-of-saxony/</a>)</li><li>Eleanor Herman: <em>Sex With Kings</em> (historical reference on royal mistresses)</li><li>Józef Ignacy Kraszewski: <em>The Countess Cosel</em> (1873 historical novel, later adapted into the 1968 Polish film)</li><li>ICD-11 Classification: WHO International Classification of Diseases (11th revision)</li></ul><h3>Notes on Historical Accuracy</h3><p>The broad outline of Countess Cosel’s biography is well-documented and consistent across multiple historical sources. Key verified facts include:</p><ul><li>Birth date (17 October 1680) and death date (31 March 1765)</li><li>Her relationship with Augustus II from 1704–1713</li><li>Her creation as Imperial Countess of Cosel in 1706</li><li>Her three children with Augustus (Augusta, Friederike, Frederick)</li><li>Her imprisonment at Stolpen Castle from 24 December 1716 until her death</li><li>The duration of imprisonment (49 years)</li><li>Her confinement to the Johannis (Cosel) Tower</li><li>The guard reports documenting her behavior during imprisonment</li><li>The Lieutenant Helm incident of 1718</li><li>Her refusal of offers of freedom (though the specific instances in 1745 and 1756 remain disputed among historians)</li><li>Her burial in the castle chapel</li><li>The excavation of her vault in 1881 during castle restoration</li></ul><p>Specific psychological interpretations presented here are analytical frameworks applied to historical behavior and should be understood as interpretive rather than diagnostic. The guard reports do exist, but their specific content is drawn from historical summaries rather than primary document review.</p><p>The musical “Barock me, Gräfin Cosel” was performed at Boulevardtheater Dresden in early 2026. The next run is planned for June/July 2027.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3b8ced996b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>