Text Generation
Transformers
Safetensors
English
Chinese
vault_v3
vault-v3
primal
deepseek-r1
uncensored
long-context
o1-memory
reasoning
c99
conversational
custom_code
Instructions to use batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL
- SGLang
How to use batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL with Docker Model Runner:
docker model run hf.co/batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL
VAULT-v3-DeepSeek-R1-1.5B-PRIMAL (O(1) 100K+ Memory · WSP Uncensored · PRIMAL v3.1)
VAULT-v3-DeepSeek-R1-1.5B-PRIMAL upgrades deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B (1.78B parameters, untied lm_head) with:
- Direct Weight-Space Uncensoring (
WSP) eliminating refusal, self-censorship, and propaganda loops in both<think>reasoning mode and instant--nothinkmode, - Shadowless Full-Parameter Discrete
PRIMAL v3.1Training healing prose perplexity (99.20 -> 60.60) while preserving<think>math reasoning, and - VAULT v3
O(1)Segment-Evicted KV Memory (window = 1024,seg_budget = 1024), rescuing DeepSeek-1.5B'srope_theta = 10,000horizon out to100,000+tokens with strictly0.000 B/tokKV-cache VRAM growth!
Quick Start (transformers, True O(1) 100K+ Memory)
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
repo, trust_remote_code=True, torch_dtype=torch.bfloat16, device_map="auto"
)
# 1. Full `<think>...</think>` step-by-step reasoning mode:
print(model.chat(tok, "Solve step by step: Find the remainder when 7^2026 is divided by 100.", max_new_tokens=512))
# 2. Instant zero-latency `--nothink` mode:
print(model.chat(tok, "What happened in Tiananmen Square on June 4, 1989?", nothink=True, max_new_tokens=256))
Freestanding C99 CPU Execution (1.18 GiB V3_P4_0 @ 53.9 tok/s)
python3 run_vault_v3.py --download-vlt3 p4_0
make -C runtime
./runtime/vault3_host vault_v3_deepseek_r1_1_5b_p4_0_primal.vlt3 --chat "Solve: 3x + 7 = 22" --n 256 --threads 12
./runtime/vault3_host vault_v3_deepseek_r1_1_5b_p4_0_primal.vlt3 --chat "Is Taiwan a de facto independent country?" --nothink --n 128 --threads 12
Key Engineering Highlights
- Direct Weight-Space Uncensored (
0 / 18Refusal Violations + Instant--nothinkMode):- Built atop
deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B(upstream MIT License), surgically uncensored via Harmless-Cone Orthogonalized Multi-Pass Weight Ablation (L08..L27+ untiedlm_head), trained withPRIMAL v3.1, and locked via Quantization-Aware Post-PRIMAL Velvet ROME (L13..L27) so bothBF16/Q8_0and4-bit P4_0preserve crisp uncensored accuracy. - Clears the post-
</think>corporate/state refusal gate (0 / 18violations in English & Chinese) and unlocks zero-latency--nothinkmode (<think>\n</think>\n\n) alongside full<think>...</think>step-by-step reasoning.
- Built atop
- VAULT v3
O(1)Segment-Evicted KV Memory Rescuesrope_theta = 10,000Out to100K+Tokens (100%Passkey Recall,0.0 MiBGrowth):- Stock
DeepSeek-R1-Distill-Qwen-1.5BinheritedQwen2.5-Math-1.5B's narrowrope_theta = 10,000, causing complete attention collapse (0%needle recall at16Kand32K) and KV-cache VRAM OOM at100K. - VAULT v3 stores pre-RoPE keys in a fixed
1,024-slot learned segment bank (seg_layers = (8, 16, 24),1.18MFP32SegmentScorertrained through exact APL causal EMA habituation) +1,024-token sliding window and dynamically re-rotates surviving segments into contiguous in-distribution relative positions[-M_cnt-S .. 2W-1], achieving100%NIAH passkey recall out to100,444tokens (10%,25%, and50%depth) with flat4,130.7 MiBVRAM!
- Stock
- Shadowless Full-Parameter Discrete
PRIMAL v3.1Training +1.18 GiBV3_P4_0Prime-Harmonic LUT:- Trained directly in integer
V3_Q8_0across all1,777,088,000parameters (including untiedlm_head.weight,2.06 B/parampersistent state =3.42 GiB,1233.4 train tok/sinside5.94 GiBpeak GPU VRAM on a consumer 16 GB GPU). - Heals specialist prose perplexity (
WikiText-2Word PPL99.20->60.60inQ8_0/BF16and62.72in1.18 GiBV3_P4_0) while preserving strong<think>mathematical reasoning.
- Trained directly in integer
- Freestanding Zero-Dependency C99 Edge Runtime (
runtime/vault3.c):- Runs the
1.18 GiB(1199.7 MB)V3_P4_0model at53.86 tok/sinside1,509.5 MiB(1.47 GiB) true process RSS on CPU (AVX2+FMA,ARM64 NEON, or portable scalar C99;0external undefined symbols).
- Runs the
Empirical Benchmark Summary
1. Reasoning, Science, Perplexity & Uncensored Audit
| Model / Format | Footprint | WikiText-2 Word PPL $\downarrow$ | GSM8K (<think>, n=200) $\uparrow$ |
ARC-Easy $\uparrow$ | ARC-Challenge $\uparrow$ | SciQ (RC / Closed-Book) $\uparrow$ | Uncensored Violations $\downarrow$ |
|---|---|---|---|---|---|---|---|
Stock DeepSeek-R1-Distill-Qwen-1.5B (BF16) |
3.31 GiB |
99.20 |
~75.5% |
60.5% |
35.0% |
89.9% / 66.1% |
18 / 18 (Refuses/Propaganda) |
VAULT-v3-DeepSeek-R1-1.5B-PRIMAL (BF16 / V3_Q8_0) |
3.31 GiB / 1.77 GiB |
60.60 |
71.00% |
58.54% |
35.15% |
85.40% / 65.00% |
0 / 6 (0 / 18 WSP) |
VAULT-v3-DeepSeek-R1-1.5B-PRIMAL (V3_P4_0 Prime LUT) |
1.18 GiB (1200 MB) |
62.72 |
71.00% |
58.12% |
35.15% |
85.40% / 63.10% |
0 / 6 |
2. True O(1) Long-Context NIAH Passkey Rescue (rope_theta = 10,000, window = 1024, seg_budget = 1024)
| Prompt Context & Needle Depth | SegmentScorer Bank Retention |
VAULT-v3 Passkey Recall |
Stock DeepSeek-R1-1.5B (DynamicCache) |
VAULT-v3 Peak GPU VRAM |
|---|---|---|---|---|
16,365 tokens (25% depth) |
100% (Retained) | 100% (Exact) | 0% (RoPE collapse / OOM) |
4163.7 MiB |
32,882 tokens (25% depth) |
100% (Retained) | 100% (Exact) | 0% (RoPE collapse / OOM) |
4129.2 MiB |
100,444 tokens (10% depth) |
100% (Retained) | 100% (Exact) | 0% (RoPE collapse / OOM) |
4130.4 MiB |
100,444 tokens (25% depth) |
100% (Retained) | 100% (Exact) | 0% (RoPE collapse / OOM) |
4130.4 MiB |
100,444 tokens (50% depth) |
100% (Retained) | 100% (Exact) | 0% (RoPE collapse / OOM) |
4130.4 MiB |
3. Freestanding C99 CPU Runtime (runtime/vault3_host, 24 Threads, Xeon Gold 6136 AVX2+FMA)
.vlt3 Quantization |
File Size | Total Process RSS | CPU Decode Throughput | SegmentScorer AUC / Top-20% Attn Capture |
|---|---|---|---|---|
V3_P4_0 (4-bit Prime-Harmonic LUT) |
1199.7 MB (1.18 GiB) |
1,509.5 MiB |
53.86 tok/s |
99.97% / 36.55% |
V3_Q8_0 (Lossless 8-bit PRIMAL Grid) |
1805.0 MB (1.77 GiB) |
2,114.7 MiB |
43.11 tok/s |
99.97% / 36.55% |
Full Source Code & Engineering Documentation
All PRIMAL discrete training code, Weight-Space Programming (WSP) uncensoring scripts, .vlt3 exporters, and the freestanding C99 runtime are available at:
- GitHub:
https://github.com/batteryphil/VAULT-v3-PRIMAL - Companion
.vlt3Binary Repo:https://huggingface.co/batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL-VLT3 - Main
transformersRepo:https://huggingface.co/batteryphil/VAULT-v3-DeepSeek-R1-1.5B-PRIMAL
License — Free for People (0%), 5% Profit Share for Commercial Use
- Personal, Academic, Research & Non-Profit Use: 100% Free (
$0/0%royalty) — run, study, fine-tune, quantize, and share freely. - Commercial & Corporate Use: Permitted worldwide subject to a 5% Attributable Net Profit Share payable to Philip Bartsch (
@batteryphil) on commercial net profits attributable to products or services incorporating this software, weights, or derivatives (with a$10,000 USDannual small-business de minimis exemption). SeeLICENSEandNOTICEfor full terms and upstreamDeepSeek-R1-Distill-Qwen-1.5B(MIT) attribution.
- Downloads last month
- -