license: other license_name: deepseek-license base_model:
- deepseek-ai/DeepSeek-V4.1-Flash
- dealignai/DeepSeek-V4.1-Flash-UNCENSORED-FP8 tags:
- deepseek-v4.1
- moe
- affinity
- rocm
- rdna4
- quantized
- uncensored library_name: affinity pipeline_tag: text-generation
DeepSeek-V4.1-Flash-UNCENSORED — affinity container (2.875 bpw)
A quantised affinity container of the uncensored DeepSeek-V4.1-Flash, made to run on two AMD Radeon AI PRO R9700 (gfx1201) GPUs. It loads only in the affinity engine (the C++/HIP inference engine by Yoshi Exeler) with the V4.1 port — not in llama.cpp, vLLM or SGLang.
Full setup, engine patches, deployment and measurements live in the companion GitHub repo: https://github.com/drwolfen/deepseek-v4.1-flash-r9700-affinity
Public model files hosted for free on the Hub as 5 parts (the main container exceeds the per-file limit). Nothing here is an official DeepSeek or affinity release; it is a personal quantisation of an abliterated community checkpoint.
Files
| file | size | role |
|---|---|---|
model-uc.aff.part-00 … part-04 | 191.32 GiB total | the container. Reassemble (below). |
model-uc.dspark.aff | 5.22 GiB | DSpark speculative-decoding draft head |
model-uc.engram | 506 KiB | engram n-gram sidecar (layers 1 and 14) |
uc-v41cb.raw | 32 KiB | the 2×1024-entry codebook the experts were encoded against |
SHA256SUMS.parts | — | checksums of the parts |
Reassemble:
cat model-uc.aff.part-* > model-uc.aff
Then verify the pieces you downloaded match SHA256SUMS.parts (which was produced from these
parts): sha256sum model-uc.aff.part-* and compare.
What this is
- Architecture: DeepSeek-V4.1-Flash — 40 layers, 384 routed experts (top-6), hidden 5120, 129280 vocab, two-level sparse-attention indexer, engram n-gram layers, vision tower (DeepSeek ViT).
- Quantisation: only the routed experts are quantised — 2.875 bpw with affinity's codebook quant (2 variants × 1024 entries), imatrix-weighted. Dense weights stay in the checkpoint's FP8 (6.2 GiB), embedding/head in bf16. Routed experts ≈ 93 GiB of the 191.32 GiB total.
- Uncensored: the source is
dealignai/DeepSeek-V4.1-Flash-UNCENSORED-FP8(DPO/refusal-ablated). An alternative build frompqhaz/DeepSeek-V4.1-Flash-heretic(directional ablation, lower KL 0.210 vs 0.333) can be quantised the same way; this container is the-ucone.
How it runs (speed, hardware)
Measured on the machine below, single stream, 512k-context config, DSpark speculative decoding on, thinking on:
- Decode 18–19.6 tok/s long-context reasoning (median ≈ 18.9), 24–25 tok/s on high-acceptance bursts; draft acceptance 54–93 %.
- Prefill ~1000 tok/s at 16k–48k (prefix-cache hit 98.7 %).
- Hardware: 2 × Radeon AI PRO R9700 (gfx1201, 32 GiB), Xeon Platinum 8160, 754 GiB RAM. Minimum ~160 GiB RAM for this configuration: 3274/15360 experts are resident in VRAM, the other 12086 are read from a 143.5 GiB host pool over PCIe. Decode is PCIe-bandwidth bound; the cards link at Gen5 but the host's switch uplink is Gen3 ×16 (PCIe-3.0 CPU), which saturates — a Gen4 ×16 host is the largest available speedup (~1.6×).
Engine changes and optimisations
This container is served by a fork of affinity that adds (full detail + commit list in the GitHub repo):
- DeepSeek ViT on the CPU, wired into prefill and the chat endpoint, with a weight-stationary GEMM + AVX-512 attention (546×546 image: 13.2 s → 3.25 s; 1024×1024: minutes → 38 s) and corrected 2D-RoPE / aligner / preprocessing (embedding cosine vs reference 0.31 → 0.85).
- Compressed KV sized per kv source (KV 1016 → 100 MiB/card) and indexer mask tiling (prefill arena 2068 → 1426 MiB/card) — both raise how many experts stay resident.
- Marker-less ("bare") DSML tool-call recovery and stop-at-block-close, which stops the agentic runaway/confabulation on a long context (a 117k-token replay: 4360 → 195 completion tokens).
- Learned placement heat-plane persistence across restarts (no re-learn from zero).
- DSpark confidence head and opt-in backoff/adaptive-width knobs for speculative decoding.
- On-GPU imatrix calibration (the engine can emit its own imatrix from the model's own activations).
AFF_NOBUDGET_MAX_TOKENS: bounds the default output when a client sends nomax_tokens, so a gateway reasoning loop cannot hold the single slot for tens of minutes.
Usage
docker run --device=/dev/kfd --device=/dev/dri --group-add video --ipc=host \
-v $PWD:/models affinity:v41-vision \
-m /models/model-uc.aff --tokenizer /models/tokenizer.json \
--dspark on --dspark-model /models/model-uc.dspark.aff \
--engram /models/model-uc.engram --engram-tables /models \
--kv-size 524288 --kv-commit 262144 \
--host-pool-mib 200000 --placement-strategy demand \
--prefill-chunk-size 2816 --default-effort 75 --max-tokens-floor 0
Credits and license
Engine: StillDeadcode/affinity (MIT), by Yoshi Exeler.
Optimization ports: Luce-Org/lucebox · lucebox.com
(Apache-2.0, Lucebox AI) — the bounded-replay, adaptive-verify-width and protected-outlier-expert
optimizations in this engine fork are ported from Lucebox's ds41-gorgon work, and the port's quality
gate reuses their fineweb-edu eval corpus; thanks to Lucebox.
Base model: deepseek-ai/DeepSeek-V4.1-Flash
(DeepSeek license). Uncensored weights: dealignai. GGUF/imatrix: Adolphsson. This quantisation and
the engine fork are derivative work; the DeepSeek license governs the weights. The transformation of
the affinity engine into this R9700-tweaked build was done with the help of DeepSeek-V4.1-Flash and
Gemini 4 Argon. Released for use in environments you own or are authorised to test.