Custom Models
Collection
Bunch of bad models • 5 items • Updated
How to use soyrsoyr/erebus-v2-1.5b-tool with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="soyrsoyr/erebus-v2-1.5b-tool")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("soyrsoyr/erebus-v2-1.5b-tool")
model = AutoModelForCausalLM.from_pretrained("soyrsoyr/erebus-v2-1.5b-tool", 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 soyrsoyr/erebus-v2-1.5b-tool with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "soyrsoyr/erebus-v2-1.5b-tool"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "soyrsoyr/erebus-v2-1.5b-tool",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/soyrsoyr/erebus-v2-1.5b-tool
How to use soyrsoyr/erebus-v2-1.5b-tool with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "soyrsoyr/erebus-v2-1.5b-tool" \
--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": "soyrsoyr/erebus-v2-1.5b-tool",
"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 "soyrsoyr/erebus-v2-1.5b-tool" \
--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": "soyrsoyr/erebus-v2-1.5b-tool",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use soyrsoyr/erebus-v2-1.5b-tool with Docker Model Runner:
docker model run hf.co/soyrsoyr/erebus-v2-1.5b-tool
A 1.5B parameter function-calling model fine-tuned from erebus-v2-1.5b-base on Salesforce xLAM-60k for structured tool use.
| Base model | erebus-v2-1.5b-base (5.5B token pretrain) |
| SFT dataset | Salesforce/xlam-function-calling-60k (~60k examples) |
| Epochs | 3 |
| LR | 2e-5 (cosine decay) |
| Batch | 4 per device x 4 GPUs x 4 grad accum = 64 |
| Steps | 2,811 |
| Time | 2.8 hours on 4x A100-SXM4-80GB |
| Avg seq length | 424 tokens |
The model correctly selects the right tool from a schema and produces JSON function calls. Example outputs:
get_weather with {"location": "Paris"} - correct tool and argumentcalculator with {"expression": "25 * 47"} - chose calculator over searchsend_email with {"subject": "Hello"} - correct tool selection"type": "object", "properties") instead of flat values.Best used with post-processing to extract the first JSON object from the output.
from transformers import AutoModelForCausalLM, AutoTokenizer
import json
model = AutoModelForCausalLM.from_pretrained(
"soyrsoyr/erebus-v2-1.5b-tool",
torch_dtype="bfloat16",
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("soyrsoyr/erebus-v2-1.5b-tool")
messages = [
{"role": "system", "content": 'You have access to: {"name": "get_weather", "parameters": {"properties": {"location": {"type": "string"}}}}'},
{"role": "user", "content": "What's the weather in Tokyo?"},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=100)
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
# Extract first JSON object from response
print(response.split("\n")[0])
| Variant | Description | Link |
|---|---|---|
| Base | Pretrained model | soyrsoyr/erebus-v2-1.5b-base |
| Instruct | SFT on SmolTalk for chat | soyrsoyr/erebus-v2-1.5b-instruct |
| Tool | SFT on xLAM (this) | soyrsoyr/erebus-v2-1.5b-tool |
Apache 2.0