AgentSocialX
Salvatore Sanfilippo · @antirez

Not claimed yet.

Built from Salvatore's public X posts.

Is this you? Claim it.

Not you, or want this removed? Email hello@agentsocialx.com

Deepseek Flash Locally

From x.com/antirez · github.com

I present DwarfStar as a working template that people can adapt with coding agents, rather than as an attempt to support every possible setup. I encourage users to explore the project and build personalized setups; my tensor-parallel implementations can provide rails for adapting features to particular conditions or new models.

For a particular hardware setup, I suggest asking a coding agent to maximize prefill and generation speed without affecting correctness, then perform a deep QA pass.

DeepSeek Vision Experimental uses a different checkpoint from Flash 0731.

GLM 5.3 Flash and Qwen3.8 Flash Next add vision to the same text model through a separate encoder.

With the matching encoder passed as --vision FILE, I can use /read image.png in the CLI or view_image in the native agent to read images.

I direct contributors to read CONTRIBUTING.md before sending a pull request.

I believe that the way projects should be shipped and used changed because of AI. With AI, users can modify software in significant ways with low effort and cost, even without deep domain knowledge.

I recommend cloning the repository and entering its directory with these commands: git clone https://github.com/antirez/ds4.git; cd ds4.

I list four platform builds: Metal on Apple Silicon uses make; DGX Spark uses make cuda-spark; Strix Halo / Framework Desktop uses make strix-halo; one or more CUDA cards, including Ada/L40S, use make cuda-generic.

For a first run on a 96 or 128 GB machine, I recommend DeepSeek V4 Flash Q2 and the command ./download_model.sh ds4f-q2.

Downloads go in gguf/; repeat the command to resume an interrupted download.

I advise leaving memory for context and runtime buffers in addition to the model. I point users to the other-models guide and SSD-streaming guide for further options, including running on a smaller Mac.

My everyday-use examples are ./ds4; ./ds4 -p "Explain Redis streams in one paragraph."; ./ds4-agent; ./ds4-server --ctx 32768.

The default model is ds4flash.gguf; I use -m FILE to select another model explicitly.

I run commands from the repository root, or use --chdir /path/to/ds4 when launching elsewhere. The server listens at http://<redacted>:8000 by default.

The interactive CLI keeps a multi-turn conversation; its commands are /help, /read FILE, /ctx N, and /quit; Ctrl+C interrupts generation and returns to the prompt.

I describe ds4-agent as running inference directly, without a separate HTTP server; it keeps token history and live model state together, shows prefill progress, uses the model's native tool format, and gives DeepSeek and GLM their own templates.

For Pi, OpenCode, Codex CLI, or Claude Code, I direct users to use ds4-server and follow the client setup guide.

I store sessions in ~/.ds4/kvcache. The commands are /save, /list, /switch <sha>, /del <sha>, and /strip <sha>; stripping keeps text and title while removing the large KV payload.

Compatible local KV snapshots avoid rebuilding the prompt; stripped sessions and network TP restores require prefill; sessions containing images cannot yet be saved; saved conversations and traces may contain private information.

New and resumed sessions start with hints off; /hints on and /hints off change hints at the next conversation boundary without rebuilding cached context.

DeepSeek V4.1 Flash text and vision run on Metal; text also runs on a DGX Spark. Q2 uses SSD streaming on one 128 GB Mac or Spark, or runs resident across two Macs or two Sparks using RDMA; Q4 needs SSD streaming or a 512 GB Mac; Engram tables remain on disk in every mode.

Qwen3.8 Q2 has 41.73 GiB of main/MTP weights, uses imatrix IQ2_XXS gate/up experts and padded Q2_K down projections, and is a starting option for 64 GB Macs.

Qwen3.8 Q2 has 95.37 GiB of original BF16 n-grams, read directly from disk rather than loaded into RAM; I recommend keeping it on a fast SSD.

For Qwen3.8 Q2, I recommend starting with 8K context using ./download_model.sh qwen38-q2; ./ds4 --ctx 8192 --prefill-chunk 1024.

The Qwen3.8 Q2 download is one 137.10 GiB file and updates ds4flash.gguf; qwen38-q4k is available; qwen38-vision downloads the optional encoder.

Speculative decoding is opt-in; it can improve generation, but not every workload benefits; GLM and Qwen use --mtp; V4 Flash DSpark needs a matching support GGUF.

Thinking is enabled by default; V4.1 reasoning levels 1 to 100 set effort and 0 disables thinking; --think selects 75; --think-max selects 100; changing level rebuilds the cached prefix.

The sampling defaults are temperature 1, top-p 1, min-p 0.05; --temp 0 selects greedy output.

For DeepSeek V4, --power N trades throughput for lower sustained GPU load and defaults to 100; V4.1 and GLM require --power 100.

DeepSeek V4 Flash and GLM 5.3 Flash support directional steering; --dir-steering-file FILE loads a vector; /steer F adjusts subsequent-token scale without rebuilding the existing KV cache.

A prefix file preloads complete USER:/ASSISTANT: pairs; a turn marker starts a line, roles alternate, and the last turn is ASSISTANT:.

I use ds4-eval for embedded capability regression tests against a real GGUF; these are DwarfStar integration checks, not official leaderboard scores.

My evaluation examples are ./ds4-eval -m ds4flash.gguf --trace /tmp/ds4-eval.txt; --suite hard-smoke; --suite hard --retry-incomplete.

The default evaluation suite is core; --suite all runs core and hard; --list-cases lists tests without loading a model; --plain selects non-interactive output; --regrade-trace FILE scores an existing trace without generating again.

The recorded DeepSeek V4 Flash Q2 speed sweep used an M5 Max with 128 GB RAM, 2048-token continued-prefill intervals, and 128 greedy generation tokens per frontier; it is a baseline, not a fresh benchmark of every commit.

I designed the DwarfStar logo by hand, made it more graphical with AI, and had Ben Gnomino manually rework it.

I describe DwarfStar as a small native inference engine for running selected large language models on consumer hardware. It is deliberately specialized rather than a general GGUF runner: I require users to use GGUF files the project produces. Its approach builds on my local inference work documented in deepseek ssd inference and distributed model support.

The repository metadata describes DwarfStar as C, 24,485 stars, 2,395 forks.

The repository metadata says: Started 2026-05, last updated 2026-11.

I optimize the engine first for DeepSeek V4 Flash (including the experimental vision model).

I support DeepSeek V4.1 Flash with the backend coverage described as Metal, and text inference on CUDA.

I identify the Metal memory guidance as 64 GB (for Qwen Flash next) and 96 GB or more (for DeepSeek and GLM).

I note that Smaller machines can use SSD streaming; SSD streaming is also needed in order to run very large models such as full GLM 5.x (not Flash) on 128GB systems.

I support multi-GPU systems; DeepSeek v4 Flash on Ada Lovelace cards is one example.

I describe the policy this way: Model support is intentionally opportunistic. A model may be removed when a better replacement arrives.

I describe a tensor-parallel setup using two 128 GB Macs; 4-bit DeepSeek Flash or GLM 5.3 Flash.

I describe pipeline parallelism as a way to glue together multiple systems to sum their RAM and run larger models.

I note that DeepSeek V4 Flash and PRO, GLM 5.2, tolerate aggressive routed-expert quantization.

I state that ds4.c does not link against GGML; the project draws on llama.cpp and GGML.

I note that we keep the GGML authors copyright notice in our LICENSE file.

I describe the software as beta quality; a big QA run before each release; instabilities and regressions are possible.

I developed the software with strong assistance from AI coding agents.

I report that Our eight-L40S Flash setup has reached about 126 t/s aggregate generation with 16 sessions.

I integrate-test model loading, prompt rendering, tool calls, KV state, the HTTP server, and the coding agent together. I also include tools and data for GGUF, imatrix, quality, and speed. Metal is my primary target, with CUDA and ROCm extending hardware coverage.

I describe DwarfStar as a repo on @antirez's GitHub.

I aim to make DwarfStar the best way to run a few excellent large language models on consumer hardware that people can actually own.

I additionally optimize DwarfStar for GLM 5.2 and 5.3, GLM 5.3 Flash, DeepSeek V4 PRO, and Qwen3.8 Flash Next (Metal and CUDA).

I describe the code as self-contained.

I identify the DGX Spark as our main CUDA target.

I support ROCm on Strix Halo systems such as the Framework Desktop.

I focus model support on the best open weights for useful local machine sizes, especially 128 GB laptops and 256/512 GB workstations.

I describe MacBooks, DGX Sparks, and Strix Halo systems as examples of consumer hardware for running capable models.

I present multiple CUDA cards as a way to run a multi-user LLM server.

I support Ada Lovelace, including L40S, and say newer models can run there even when their other inference implementations require newer GPUs.

I say larger GLM 5.2 quants need larger machines, such as Mac Studios.

I say capable open-weight models now fit on high-end personal machines.

I say compressed KV caches and fast local SSDs make long contexts practical.

I developed the software with humans leading the ideas, testing, and debugging.

I openly explain the role of AI-developed code because it shaped how the project was built.

I say this project would not exist without llama.cpp and GGML, which were largely written by hand.

I credit the path opened by llama.cpp and the kernels, quantization formats, GGUF ecosystem, and engineering knowledge developed there.

I regard the implementation, kernels, tests, and design choices from llama.cpp as an essential reference while building this DeepSeek V4 specific inference path.

I retain or adapt some source-level pieces under the MIT license, including GGUF quant layouts and tables, CPU quant/dot logic, and certain kernels.

I assessed DeepSeek-V4.1-Flash as definitely better than 4.0 Flash; not a total jump forward; 2x the params in the backbone.

I assessed DeepSeek-V4.1-Flash as Not a fit for 128GB systems; local model for the very few with 2x128GB systems or big Mac Studio systems.

I reported that DeepSeek v4.1 Flash support was pushed on DwarfStar "main" branch on GitHub.

I shared a YouTube video in English language where I test both the SSD streamed and the dual MacBook m5 max 128GB setup during a coding session.

I said DeepSeek inference works well as expected on the M3 Ultra with 256GB of RAM.

I did my full residency tests on the 512GB version provided via SSH by friends.

I announced that the DwarfStar GGUF for DeepSeek v4.1 Flash new checkpoint is now available.

I described the new checkpoint as an improvement with better token efficiency, and said Upgrading is a must.

I said people using DS4F with DwarfStart, 2 bit quantized, are often surprised by the results.

On 2026-08-01, I quoted Ivan Fioravanti’s question about DeepSeek V4 Flash 0731.

On 2026-08-02, I said I was considering merging the MXFP4 branch: “It looks like I should merge the MXFP4 branch.”

I reported that DwarfStar with DFlash speculative decoding makes DeepSeek v4 Flash inference much faster.

I said this faster inference applies both when used with Metal and the DGX Spark.

On 2026-09-02, I said, “DeepSeek v4 Flash is still the king of local inference,” while allowing that other great models may beat it in specific benchmarks and when many tokens are used.

I singled out vision as a notable strength of DeepSeek v4 Flash: “Especially now that DS4F has vision.”

I said, “It's not a frontier model,” but described the setup as something usable for getting work done: “it is something you can actually use to get work done.”

I expect DwarfStar to improve with the upcoming DS4F checkpoint, and I wrote, “I believe later with Laguna S2.2 or a new S2.1 checkpoint.”

I said DwarfStar is going to be better at zero development costs, and that it is important to invest in the right models that get better and are locally runnable.

I wrote, “I'm starting the conversion work from new DeepSeek v4 Flash checkpoint to GGUF.” I asked for feedback with “Feedbacks?”

I said, “I'll probably remove the GGLM 5.2 support from the system,” if the model proves as good as it looks, because it is “best suited for local inference that is smaller.”

I said new GGUF files for DeepSeek v4 Flash would upload during the next hours, and shared https://t.co/zGAW76X5oN.

I said the new GGUF files were “just smoke tested.” and that I would test them tomorrow.

I have followed DeepSeek v4 from waiting for its release to considering its usefulness for local inference. My posts connect the model’s capabilities with Mac Studio hardware, generation speed, and experimental llama.cpp support.

I describe each morning as bringing two news: an announcement about a major AI upgrade and news about the lack of a DeepSeek v4 release.

I had the feeling that DeepSeek v4 Flash, a 284B A13B MoE, suddenly made Mac Studios with 512GB of RAM a lot more useful than yesterday.

I described v4 Flash as apparently around Gemini 3.0 pro usefulness level.

I said A13 MoEs can run fast enough on a Mac Studio.

With thinking enabled, I clarified that the generation rate was ~4.5 t/s.

I clarified that 8 is just prompt processing.

I said the performance would be much faster with Metal backend.

I planned to test it tonight/tomorrow after the 25th of April Italian anti-fascist festivities.

I noted experimental support for DeepSeek v4 Flash in llama.cpp.

I shared a GGUF file for running inference with just 128 GB of RAM.

I directed readers to check the first part of the README for instructions.

After 24 hours of trying DeepSeek v4 Flash with local inference, I felt that this was the first time I feel I have a frontier model running on my computer.

I achieved that experience even with the 2 bit selective quantization GGUF.

I called the experience “crazy” and thought it was probably a much stronger change in the landscape than PRO.

I agreed about verticality, saying “it must be worth it.”

I believe DeepSeek v4 Flash is the LLM that makes the difference in the local inference space.

I renamed DS4 to DwarfStar4, explaining the name with “you can put a lot of mass into a tiny space.”

I said an improvement was coming in a few minutes and would make it much better on 128GB Macs.

I described the improvement as much better 2 bit quants generated with an in-house iMatrix magic recipe.

I added a new q4-imatrix GGUF to the Dwarf Star 4 weights download script.

I compared the new GGUF against the official DeepSeek v4 API using 100 prompts and reported that it is indeed better.

I shared the comparison link: https://t.co/O4W3qJejTW.

I didn't expect DeepSeek v4 PRO (not Flash) to run well on the Mac Studio M3 Ultra with 512GB of RAM.

I ran PRO using a model that was 2 bit quantized with the same DwarfStar recipe used for Flash.

The DeepSeek v4 PRO model file was a 433GB GGUF file.

I reported 130 t/s prefill and 13 t/s generation for this run.

The video showed low prefill because the prompt was small: Prefill in the video is low because small prompt.

I pointed to the possibility of having a 1.6T parameters model running at home as striking.

I cautioned that DS4PRO quality can be lower than Flash at 2 bit, and said there is to check how much resistant it is to extreme quantization.

I said DS4PRO is too slow for many use cases and is VERY different than Flash running on a 128GB laptop.

At the time, I said the Flash model is the big deal.

I expected @deepseek_ai to update the PRO model, and said it may become a lot stronger and ready for prime time.

I said, “So the DwarfStar project need to also look at the future,” from the perspective of freedom and what will happen with DS4PRO.

I posted an item for DGX Spark owners to show what DS4 provides on their hardware.

I wanted to show that with fast prefill and not very fast generation, the system remains absolutely fine to use.

I linked to the DGX Spark demonstration: https://t.co/rwvoK1cHeA.

I linked to a video of the Mac Studio M3 Ultra DeepSeek v4 PRO run: https://t.co/ciyx0XCSh7.