Downloads · 30 days
34
19% of all-time downloads
AdvRahul/Axion-4B
Axion-4B is a machine learning model from AdvRahul. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as other.
A safety-enhanced version of Qwen3-4B-Instruct, optimized for reliable and responsible AI applications. 🛡️
Downloads · 30 days
34
19% of all-time downloads
All-time downloads
177
Public
Repo size
2.5 GB
Likes
0
Public
Click a slice to open those files.
.gguf2.5 GB · 100%
From the Hugging Face model README
A safety-enhanced version of Qwen3-4B-Instruct, optimized for reliable and responsible AI applications. 🛡️
Axion-4B is a fine-tuned version of the powerful Qwen/Qwen3-4B-Instruct-2507 model. The primary enhancement in this version is its robust safety alignment, making it a more dependable choice for production environments and user-facing applications.
The core purpose of Axion-4B is to provide a safer alternative for developers. The base model underwent extensive red-team testing using advanced protocols to significantly minimize the generation of harmful, biased, or inappropriate content.
While adding a crucial safety layer, Axion-4B retains the exceptional capabilities of its base model, including:
You can use this model directly with the transformers library (version 4.51.0 or newer is recommended).
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# IMPORTANT: Use the model name for this repository
model_name = "AdvRahul/Axion-4B"
# Load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
# Prepare the model input
prompt = "Give me a short introduction to large language models and their safety considerations."
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# Generate text
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512 # Limiting for a concise example
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
content = tokenizer.decode(output_ids, skip_special_tokens=True)
print("Response:", content)
Optimized Deployment
For high-throughput, production-ready deployment, you can use frameworks like vLLM or SGLang to serve the model via an OpenAI-compatible API.
vLLM:
Bash
vllm serve AdvRahul/Axion-4B --max-model-len 262144
SGLang:
Bash
python -m sglang.launch_server --model-path AdvRahul/Axion-4B --context-length 262144
Note: If you encounter out-of-memory (OOM) issues, consider reducing the max context length (e.g., --max-model-len 32768).
⚠️ Ethical Considerations and Limitations
This model was fine-tuned with the explicit goal of improving safety and reducing harmful outputs. However, no AI model is completely immune to risks.
No Guarantees: While the safety alignment is significantly improved, it does not guarantee perfectly harmless outputs in all scenarios.
Inherited Biases: The model may still reflect biases present in the vast amount of data used to train its base model.
Factual Accuracy: Always fact-check critical information, as the model can generate plausible but incorrect statements.
Best Practice: It is strongly recommended that developers implement their own content moderation filters and safety guardrails as part of a comprehensive, defense-in-depth strategy. Thoroughly evaluate the model's performance and safety for your specific use case before deploying it to a live audience.