Model Stock: All we need is just a few fine-tuned models
Paper • 2403.19522 • Published • 15
How to use Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce")
model = AutoModelForCausalLM.from_pretrained("Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce", 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]:]))How to use Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce
How to use Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce" \
--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": "Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce" \
--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": "Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce with Docker Model Runner:
docker model run hf.co/Yingyaeliae/Ariel-Alloy-V1-24B-Extra-Heretic-Sauce
| Parameter | Value |
|---|---|
| direction_index | 22.40 |
| attn.o_proj.max_weight | 1.41 |
| attn.o_proj.max_weight_position | 37.98 |
| attn.o_proj.min_weight | 0.93 |
| attn.o_proj.min_weight_distance | 23.04 |
| mlp.down_proj.max_weight | 1.33 |
| mlp.down_proj.max_weight_position | 31.85 |
| mlp.down_proj.min_weight | 0.63 |
| mlp.down_proj.min_weight_distance | 14.05 |
| Metric | This model | Original model (ShyliaSafetensors/Ariel-Alloy-V1-24B-Heretic) |
|---|---|---|
| KL divergence | 0.0235 | 0 (by definition) |
| Refusals | 2/100 | 9/100 |
The goal was creating good/stable Role-Play model with merging multiple models with multiple steps.
This is a merge of pre-trained language models created using mergekit. Then used Heretic to remove refusals
| Metric | Before | After |
|---|---|---|
| Refusal rate | 98 / 100 | 10 / 100 |
| KL Divergence | 0 | 0.0152 |
This model was merged using the SLERP, Dare-Ties, and Model Stock merge method.
The following YAML configurations was used to produce this model:
Step 1:
merge_method: dare_ties
base_model: MS3.2-PaintedFantasy-v4.1-24B-ultra-uncensored-heretic-v1
models:
- model: Magidonia-24B-v4.3-heretic
parameters:
density: 0.65
weight: 0.65
rescale: true
- model: Dans-PersonalityEngine-V1.3.0-24b
parameters:
density: 0.65
weight: 0.65
rescale: true
- model: Cydonia-24B-Heretic-v4
parameters:
density: 0.65
weight: 0.50
rescale: true
- model: Rotor_24B_V.1
parameters:
density: 0.65
weight: 0.45
rescale: true
- model: MS3.2-The-Omega-Directive-24B-Unslop-v2.0
parameters:
density: 0.65
weight: 0.60
rescale: true
- model: Dark-Nexus-24B-v2.0
parameters:
density: 0.65
weight: 0.55
rescale: true
parameters:
normalize: true
int8_mask: true
dtype: bfloat16
name: ArielRefined-V1-DareTies
Step 2:
merge_method: model_stock
base_model: Dans-PersonalityEngine-V1.3.0-24b
filter_wise: true # stable
models:
- model: Broken-Tutu-24B-Transgression-v2.0
- model: MS3.2-PaintedFantasy-v4.1-24B-ultra-uncensored-heretic-v1
- model: WeirdCompound-v1.7-24b-absolute-heresy
- model: Dans-PersonalityEngine-V1.3.0-24b
- model: Mistral-Small-3.2-24B-Instruct-2506-Text-Only
- model: Eurydice-24b-v3.5
dtype: bfloat16
name: ArielRefined-Model_stock
Step 3:
merge_method: slerp
base_model: ArielRefined-V1-DareTies
parameters:
t: 0.50 # 50-50
models:
- model: ArielRefined-Model_stock
dtype: bfloat16
name: Ariel-Alloy