Text Generation
Transformers
Safetensors
English
multilingual
qwen2
text-generation-inference
unsloth
sft
rlhf
trl
conversational
Instructions to use At-Tawheed/Anis with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use At-Tawheed/Anis with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="At-Tawheed/Anis") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("At-Tawheed/Anis") model = AutoModelForCausalLM.from_pretrained("At-Tawheed/Anis") 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 At-Tawheed/Anis with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "At-Tawheed/Anis" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "At-Tawheed/Anis", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/At-Tawheed/Anis
- SGLang
How to use At-Tawheed/Anis 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 "At-Tawheed/Anis" \ --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": "At-Tawheed/Anis", "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 "At-Tawheed/Anis" \ --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": "At-Tawheed/Anis", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use At-Tawheed/Anis with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for At-Tawheed/Anis to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for At-Tawheed/Anis to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for At-Tawheed/Anis to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="At-Tawheed/Anis", max_seq_length=2048, ) - Docker Model Runner
How to use At-Tawheed/Anis with Docker Model Runner:
docker model run hf.co/At-Tawheed/Anis
| base_model: unsloth/qwen2.5-7b-unsloth-bnb-4bit | |
| tags: | |
| - text-generation-inference | |
| - transformers | |
| - unsloth | |
| - qwen2 | |
| - sft | |
| - rlhf | |
| - trl | |
| - conversational | |
| license: apache-2.0 | |
| language: | |
| - en | |
| - multilingual | |
| datasets: | |
| - At-Tawheed/Anis-RLHF | |
| pipeline_tag: text-generation | |
| # Anis | |
| **Developed by:** [At-Tawheed](https://huggingface.co/At-Tawheed) · Attawheed AI Lab (ATTLAB) | |
| **Base model:** [`unsloth/qwen2.5-7b-unsloth-bnb-4bit`](https://huggingface.co/unsloth/qwen2.5-7b-unsloth-bnb-4bit) | |
| **Parameters:** 8B · **Tensor type:** BF16 · **License:** Apache 2.0 | |
| This Qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library. | |
| [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth) | |
| --- | |
| ## About Anis | |
| **Anis** is an 8B parameter language model fine-tuned from Qwen2.5-7B using Supervised Fine-Tuning (SFT). It is the first stage in ATTLAB's open-source RLHF alignment pipeline, trained on **[`At-Tawheed/Anis-RLHF`](https://huggingface.co/datasets/At-Tawheed/Anis-RLHF)** — a curated 57.9 GB dataset of 33 instruction, preference, math, code, and multilingual subsets. | |
| ``` | |
| unsloth/qwen2.5-7b-unsloth-bnb-4bit (base) | |
| └── Anis (SFT ← this model) | |
| └── attlab-7b-dpo-v1 (DPO) | |
| ``` | |
| **System prompt:** | |
| ``` | |
| You are ATTLAB, a helpful, harmless, and honest AI assistant developed by the ATTLAB team. | |
| ``` | |
| --- | |
| ## Training Data — Anis-RLHF (57.9 GB · 33 subsets) | |
| | Category | Subsets | | |
| |---|---| | |
| | **Instruction / Chat** | `openhermes_2_5`, `slim_orca`, `openorca_full`, `ultrachat_200k`, `smoltalk_1m`, `lmsys_chat_1m`, `tulu3_sft_mixture`, `oasst1_top_ranked` | | |
| | **Preference / DPO** | `ultrafeedback`, `ultrafeedback_binarized`, `hh_rlhf_full`, `capybara_dpo_7k`, `helpsteer2` | | |
| | **Math / Reasoning** | `metamath_qa`, `numina_math_cot`, `openmath_instruct2`, `magpie_reasoning_250k` | | |
| | **Code** | `opencode_instruct_5m`, `codefeedback_66k`, `evol_codealpaca_110k`, `magicoder_oss_75k` | | |
| | **Synthetic** | `magpie_llama3_1m`, `magpie_llama31_1m`, `magpie_llama33_1m`, `magpie_qwen25_1m` | | |
| | **Knowledge** | `wikipedia_en`, `gutenberg_books`, `stackexchange_qa`, `fineweb_edu` | | |
| | **Multilingual** | `aya_multilingual`, `wikipedia_yoruba` | | |
| | **WizardLM** | `wizardlm_evol_v2` | | |
| --- | |
| ## Usage | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| import torch | |
| model_id = "At-Tawheed/Anis" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_id, | |
| torch_dtype=torch.bfloat16, | |
| device_map="auto" | |
| ) | |
| messages = [ | |
| {"role": "system", "content": "You are ATTLAB, a helpful, harmless, and honest AI assistant developed by the ATTLAB team."}, | |
| {"role": "user", "content": "What is reinforcement learning from human feedback?"} | |
| ] | |
| input_ids = tokenizer.apply_chat_template( | |
| messages, | |
| tokenize=True, | |
| add_generation_prompt=True, | |
| return_tensors="pt" | |
| ).to(model.device) | |
| with torch.no_grad(): | |
| outputs = model.generate( | |
| input_ids, | |
| max_new_tokens=256, | |
| do_sample=True, | |
| temperature=0.7, | |
| top_p=0.9, | |
| ) | |
| response = outputs[0][input_ids.shape[-1]:] | |
| print(tokenizer.decode(response, skip_special_tokens=True)) | |
| ``` | |
| ### With Unsloth | |
| ```python | |
| from unsloth import FastLanguageModel | |
| model, tokenizer = FastLanguageModel.from_pretrained( | |
| model_name="At-Tawheed/Anis", | |
| max_seq_length=2048, | |
| dtype=None, | |
| load_in_4bit=True, | |
| ) | |
| FastLanguageModel.for_inference(model) | |
| ``` | |
| --- | |
| ## Limitations | |
| - **SFT only:** Anis is not fully aligned. For preference-optimized outputs use the DPO variant (`attlab-7b-dpo-v1`). | |
| - **Hallucination:** May produce factually incorrect outputs — do not use as a sole source of truth. | |
| - **Bias:** Training data is sourced from the internet and inherits its biases. | |
| --- | |
| ## Citation | |
| ```bibtex | |
| @misc{anis2025, | |
| author = {Ibraheem, Olushola Taoheed}, | |
| title = {Anis: A Supervised Fine-Tuned Language Model}, | |
| year = {2025}, | |
| publisher = {Hugging Face}, | |
| howpublished = {\url{https://huggingface.co/At-Tawheed/Anis}}, | |
| note = {Attawheed AI Lab (ATTLAB). Fine-tuned from Qwen2.5-7B with Unsloth and TRL.} | |
| } | |
| ``` | |
| --- | |
| **ATTLAB** · [Hugging Face](https://huggingface.co/At-Tawheed) · [GitHub](https://github.com/OluOlamide) · [Dataset](https://huggingface.co/datasets/At-Tawheed/Anis-RLHF) |