Text Generation
MLX
Safetensors
English
Chinese
deepseek_v4
deepseek-v4
deepseek
quantized
apple-silicon
mixture-of-experts
Mixture of Experts
mxtq
turboquant
jang
jangtq
conversational
4.5-bit
Instructions to use osmapi/DeepSeek-V4-Flash-TQ-Q4.5-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use osmapi/DeepSeek-V4-Flash-TQ-Q4.5-MLX with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("osmapi/DeepSeek-V4-Flash-TQ-Q4.5-MLX") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use osmapi/DeepSeek-V4-Flash-TQ-Q4.5-MLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "osmapi/DeepSeek-V4-Flash-TQ-Q4.5-MLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "osmapi/DeepSeek-V4-Flash-TQ-Q4.5-MLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "osmapi/DeepSeek-V4-Flash-TQ-Q4.5-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }'
Update model card for TQ repo name
Browse files
README.md
CHANGED
|
@@ -25,9 +25,9 @@ tags:
|
|
| 25 |
- 4.5-bit
|
| 26 |
---
|
| 27 |
|
| 28 |
-
# DeepSeek-V4-Flash-
|
| 29 |
|
| 30 |
-
`osmapi/DeepSeek-V4-Flash-
|
| 31 |
|
| 32 |
No fine-tuning, distillation, or retraining was applied. The official mixed FP4/FP8 source weights were converted locally, the MTP head was dropped because it is not used for normal decode, and router/mHC/control tensors were preserved rather than aggressively quantized.
|
| 33 |
|
|
@@ -48,7 +48,7 @@ No fine-tuning, distillation, or retraining was applied. The official mixed FP4/
|
|
| 48 |
This is a JANGTQ/TurboQuant bundle and requires `jangtq_runtime.safetensors` from this repository. The sidecar stores the deterministic codebooks and Hadamard rotation signs used to decode the `.tq_packed` expert weights. If it is missing, re-download the full repository or fetch that file explicitly:
|
| 49 |
|
| 50 |
```bash
|
| 51 |
-
hf download osmapi/DeepSeek-V4-Flash-
|
| 52 |
```
|
| 53 |
|
| 54 |
## Quantization Recipe
|
|
@@ -76,7 +76,7 @@ Example:
|
|
| 76 |
from jang_tools.load_jangtq import load_jangtq_model
|
| 77 |
from mlx_lm import generate
|
| 78 |
|
| 79 |
-
model, tokenizer = load_jangtq_model("osmapi/DeepSeek-V4-Flash-
|
| 80 |
prompt = "Write a short note about MLX quantization."
|
| 81 |
text = generate(model, tokenizer, prompt=prompt, verbose=True)
|
| 82 |
print(text)
|
|
|
|
| 25 |
- 4.5-bit
|
| 26 |
---
|
| 27 |
|
| 28 |
+
# DeepSeek-V4-Flash-TQ-Q4.5-MLX
|
| 29 |
|
| 30 |
+
`osmapi/DeepSeek-V4-Flash-TQ-Q4.5-MLX` is an Apple-Silicon MLX TurboQuant/JANGTQ quantization of [`deepseek-ai/DeepSeek-V4-Flash`](https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash).
|
| 31 |
|
| 32 |
No fine-tuning, distillation, or retraining was applied. The official mixed FP4/FP8 source weights were converted locally, the MTP head was dropped because it is not used for normal decode, and router/mHC/control tensors were preserved rather than aggressively quantized.
|
| 33 |
|
|
|
|
| 48 |
This is a JANGTQ/TurboQuant bundle and requires `jangtq_runtime.safetensors` from this repository. The sidecar stores the deterministic codebooks and Hadamard rotation signs used to decode the `.tq_packed` expert weights. If it is missing, re-download the full repository or fetch that file explicitly:
|
| 49 |
|
| 50 |
```bash
|
| 51 |
+
hf download osmapi/DeepSeek-V4-Flash-TQ-Q4.5-MLX jangtq_runtime.safetensors --local-dir <your-model-dir>
|
| 52 |
```
|
| 53 |
|
| 54 |
## Quantization Recipe
|
|
|
|
| 76 |
from jang_tools.load_jangtq import load_jangtq_model
|
| 77 |
from mlx_lm import generate
|
| 78 |
|
| 79 |
+
model, tokenizer = load_jangtq_model("osmapi/DeepSeek-V4-Flash-TQ-Q4.5-MLX")
|
| 80 |
prompt = "Write a short note about MLX quantization."
|
| 81 |
text = generate(model, tokenizer, prompt=prompt, verbose=True)
|
| 82 |
print(text)
|