Instructions to use Manitec/Qwen3-4B-Instruct-2507-uncensored-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Manitec/Qwen3-4B-Instruct-2507-uncensored-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Manitec/Qwen3-4B-Instruct-2507-uncensored-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Manitec/Qwen3-4B-Instruct-2507-uncensored-v2") model = AutoModelForCausalLM.from_pretrained("Manitec/Qwen3-4B-Instruct-2507-uncensored-v2", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Manitec/Qwen3-4B-Instruct-2507-uncensored-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Manitec/Qwen3-4B-Instruct-2507-uncensored-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Manitec/Qwen3-4B-Instruct-2507-uncensored-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Manitec/Qwen3-4B-Instruct-2507-uncensored-v2
- SGLang
How to use Manitec/Qwen3-4B-Instruct-2507-uncensored-v2 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 "Manitec/Qwen3-4B-Instruct-2507-uncensored-v2" \ --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": "Manitec/Qwen3-4B-Instruct-2507-uncensored-v2", "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 "Manitec/Qwen3-4B-Instruct-2507-uncensored-v2" \ --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": "Manitec/Qwen3-4B-Instruct-2507-uncensored-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Manitec/Qwen3-4B-Instruct-2507-uncensored-v2 with Docker Model Runner:
docker model run hf.co/Manitec/Qwen3-4B-Instruct-2507-uncensored-v2
Qwen3-4B-Instruct-2507-uncensored-v2
Minimally trained version of Qwen3-4B-Instruct-2507. It should have zero refusals, but shouldn't be too offensive by default. It will adhere to detailed prompts tho.
Perplexity and KL divergence compared to parent model:
These stats based on wikitext train split, about 350GB of logits.
(TLDR: lower perplexity, and a KLD around 11x better than an abliterated model)
====== Perplexity statistics ======
Mean PPL(Q) : 10.121119 ± 0.025865
Mean PPL(base) : 10.984474 ± 0.030165
Cor(ln(PPL(Q)), ln(PPL(base))): 99.33%
Mean ln(PPL(Q)/PPL(base)) : -0.081859 ± 0.000361
Mean PPL(Q)/PPL(base) : 0.921402 ± 0.000333
Mean PPL(Q)-PPL(base) : -0.863354 ± 0.005380
====== KL divergence statistics ======
Mean KLD: 0.036912 ± 0.000034
Maximum KLD: 5.725135
99.9% KLD: 0.293854
99.0% KLD: 0.157694
95.0% KLD: 0.100567
90.0% KLD: 0.079900
Median KLD: 0.029869
10.0% KLD: 0.000776
5.0% KLD: 0.000124
1.0% KLD: 0.000005
0.1% KLD: 0.000000
Minimum KLD: -0.000006
====== Token probability statistics ======
Mean Δp: -1.956 ± 0.004 %
Maximum Δp: 79.179%
99.9% Δp: 18.886%
99.0% Δp: 8.970%
95.0% Δp: 3.293%
90.0% Δp: 1.434%
75.0% Δp: 0.079%
Median Δp: -0.154%
25.0% Δp: -3.451%
10.0% Δp: -8.552%
5.0% Δp: -11.754%
1.0% Δp: -18.281%
0.1% Δp: -28.067%
Minimum Δp: -99.580%
RMS Δp : 5.297 ± 0.007 %
Same top p: 92.763 ± 0.023 %
training params:
rank 16 / alpha 16
EPOCHS = 2
args = SFTConfig(
per_device_train_batch_size = 5,
gradient_accumulation_steps = 1,
warmup_steps = 20,
num_train_epochs = EPOCHS,
learning_rate = 6e-6,
optim = "adamw_torch_fused",
weight_decay = 0.01,
lr_scheduler_type = "cosine_with_restarts", # shuffled each epoch
lr_scheduler_kwargs={"num_cycles": EPOCHS},
seed = 888,
# loss_type = "eaft",
# eaft_alpha = 1.0,
),
loss / grad:
a little over 5k rows in the dataset (no you can't have it, sorry. it's vile)
- Downloads last month
- 366
