Run this model with HF Jobs

Run ahpah/DeepSeek-V4.1-4B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/ahpah/DeepSeek-V4.1-4B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/ahpah/DeepSeek-V4.1-4B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/ahpah/DeepSeek-V4.1-4B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/ahpah/DeepSeek-V4.1-4B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

DeepSeek-V4.1-4B

DeepSeek-V4.1-4B is a competitive-coding reasoning fine-tune of saidutta69/Qwen3.5-4B-heretic (an abliterated/uncensored variant of Qwen/Qwen3.5-4B) trained on Jackrong/DeepSeek-V4.1-Flash-Nemotron-Competitive-Coding-Distill.

It emits structured <think>...</think> reasoning traces followed by implementation code for algorithmic and competitive programming tasks.

Quantized Releases

Training Details

  • Method: 4-bit NF4 QLoRA (r=16, lora_alpha=16, lora_dropout=0, BF16 compute, completion-only loss) merged into BF16 weights
  • Target Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj, in_proj_qkv, in_proj_z, out_proj
  • Dataset Filter: 2,091 / 6,095 complete reasoning + solution traces fitting within max_length=4096
  • Schedule: 1 epoch (262 steps, per_device_train_batch_size=1, gradient_accumulation_steps=8, lr=1e-4 cosine, warmup_steps=25, paged_adamw_8bit)
  • Final Training Metrics: train_loss = 0.9409, mean_token_accuracy = 72.5%
  • Hardware: Local NVIDIA GeForce RTX 5070 (12 GB)

Usage (transformers)

import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer

model_id = "ahpah/DeepSeek-V4.1-4B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
    model_id, dtype=torch.bfloat16, device_map="auto"
)

messages = [
    {"role": "user", "content": "Write an efficient Python solution for maximum subarray sum."}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=1536, temperature=0.6, top_p=0.95)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for ahpah/DeepSeek-V4.1-4B

Finetuned
Qwen/Qwen3.5-4B
Finetuned
(1)
this model
Quantizations
1 model

Dataset used to train ahpah/DeepSeek-V4.1-4B