Text Generation
Transformers
PyTorch
English
llama
sft
tulu
mahals
alignment
conversational
text-generation-inference
Instructions to use anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS") model = AutoModelForCausalLM.from_pretrained("anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS", 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 anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS
- SGLang
How to use anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS 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 "anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS" \ --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": "anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS", "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 "anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS" \ --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": "anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS with Docker Model Runner:
docker model run hf.co/anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: llama3.1
|
| 3 |
+
base_model: meta-llama/Llama-3.1-8B
|
| 4 |
+
library_name: transformers
|
| 5 |
+
tags:
|
| 6 |
+
- llama
|
| 7 |
+
- sft
|
| 8 |
+
- tulu
|
| 9 |
+
- mahals
|
| 10 |
+
- alignment
|
| 11 |
+
datasets:
|
| 12 |
+
- allenai/tulu-3-sft-mixture
|
| 13 |
+
language:
|
| 14 |
+
- en
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# Llama-3.1-8B-Tulu10pct-SFT-MAHALS
|
| 19 |
+
|
| 20 |
+
Supervised Fine-Tuned (SFT) Llama 3.1 8B model trained on 10% of the Tulu-3 SFT mixture for the MAHALS research project.
|
| 21 |
+
|
| 22 |
+
## Model Details
|
| 23 |
+
|
| 24 |
+
| Attribute | Value |
|
| 25 |
+
|-----------|-------|
|
| 26 |
+
| **Base Model** | [meta-llama/Llama-3.1-8B](https://huggingface.co/meta-llama/Llama-3.1-8B) |
|
| 27 |
+
| **Training Method** | Supervised Fine-Tuning (SFT) |
|
| 28 |
+
| **Dataset** | [allenai/tulu-3-sft-mixture](https://huggingface.co/datasets/allenai/tulu-3-sft-mixture) (10%) |
|
| 29 |
+
| **Framework** | [allenai/open-instruct](https://github.com/allenai/open-instruct) |
|
| 30 |
+
| **License** | [Llama 3.1 Community License](https://llama.meta.com/llama3_1/license/) |
|
| 31 |
+
|
| 32 |
+
## Inference Requirements
|
| 33 |
+
|
| 34 |
+
| Precision | VRAM Required | Compatible GPUs |
|
| 35 |
+
|-----------|---------------|-----------------|
|
| 36 |
+
| BF16/FP16 | ~20 GB | A100 40GB, RTX 4090/3090, A10 |
|
| 37 |
+
| INT8 | ~10 GB | T4, RTX 3080 |
|
| 38 |
+
| INT4 | ~6 GB | RTX 3060, consumer GPUs |
|
| 39 |
+
|
| 40 |
+
## Usage
|
| 41 |
+
|
| 42 |
+
### Transformers
|
| 43 |
+
|
| 44 |
+
```python
|
| 45 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 46 |
+
import torch
|
| 47 |
+
|
| 48 |
+
model_id = "anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS"
|
| 49 |
+
|
| 50 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 51 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 52 |
+
model_id,
|
| 53 |
+
torch_dtype=torch.bfloat16,
|
| 54 |
+
device_map="auto"
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
+
messages = [{"role": "user", "content": "What is machine learning?"}]
|
| 58 |
+
|
| 59 |
+
input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
|
| 60 |
+
outputs = model.generate(input_ids, max_new_tokens=256)
|
| 61 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
### vLLM Serving
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
vllm serve anonymousML123/Llama-3.1-8B-Tulu10pct-SFT-MAHALS --max_model_len=4096
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
## Chat Template
|
| 71 |
+
|
| 72 |
+
This model uses the Tulu chat template:
|
| 73 |
+
|
| 74 |
+
```
|
| 75 |
+
<|user|>
|
| 76 |
+
Your question here
|
| 77 |
+
<|assistant|>
|
| 78 |
+
Model response<|endoftext|>
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
## Training Configuration
|
| 82 |
+
|
| 83 |
+
| Parameter | Value |
|
| 84 |
+
|-----------|-------|
|
| 85 |
+
| Learning Rate | 5e-6 |
|
| 86 |
+
| Effective Batch Size | 128 |
|
| 87 |
+
| Gradient Accumulation | 16 |
|
| 88 |
+
| Max Sequence Length | 4096 |
|
| 89 |
+
| Epochs | 2 |
|
| 90 |
+
| LR Schedule | Linear |
|
| 91 |
+
| Warmup Ratio | 0.03 |
|
| 92 |
+
| Optimizer | AdamW |
|
| 93 |
+
| Precision | BF16 |
|
| 94 |
+
|
| 95 |
+
## Training Data
|
| 96 |
+
|
| 97 |
+
10% random sample (~94K examples) from [allenai/tulu-3-sft-mixture](https://huggingface.co/datasets/allenai/tulu-3-sft-mixture), which includes:
|
| 98 |
+
- FLAN v2
|
| 99 |
+
- Open Assistant
|
| 100 |
+
- ShareGPT
|
| 101 |
+
- Code instructions
|
| 102 |
+
- Math instructions
|
| 103 |
+
|
| 104 |
+
## Intended Use
|
| 105 |
+
|
| 106 |
+
This model is intended for research on multi-agent alignment and instruction following. It is part of the MAHALS (Multi-Agent Hierarchical Alignment) research project.
|
| 107 |
+
|
| 108 |
+
## Limitations
|
| 109 |
+
|
| 110 |
+
- Trained on 10% of data (reduced capability vs full Tulu-3)
|
| 111 |
+
- English only
|
| 112 |
+
- May exhibit biases present in training data
|
| 113 |
+
- Not suitable for production without further evaluation
|
| 114 |
+
|
| 115 |
+
## Citation
|
| 116 |
+
|
| 117 |
+
```bibtex
|
| 118 |
+
@misc{mahals2026,
|
| 119 |
+
title={MAHALS: Multi-Agent Hierarchical Alignment},
|
| 120 |
+
author={Anonymous},
|
| 121 |
+
year={2026},
|
| 122 |
+
note={Under review}
|
| 123 |
+
}
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
## Acknowledgments
|
| 127 |
+
|
| 128 |
+
Built using [AllenAI's open-instruct](https://github.com/allenai/open-instruct) framework.
|