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.

Training

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

Findings

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 argument
  • calculator with {"expression": "25 * 47"} - chose calculator over search
  • send_email with {"subject": "Hello"} - correct tool selection

Known Limitations

  • Schema leakage: Arguments sometimes include schema-like fields ("type": "object", "properties") instead of flat values.
  • Missing/wrong args: Occasionally drops required arguments or fills in placeholder values.
  • Post-JSON degeneration: After the initial JSON object, output degenerates into repetition. Use a stop token or extract the first JSON object.
  • Same base model limitations: Small pretraining budget (5.5B tokens) limits overall language understanding.

Best used with post-processing to extract the first JSON object from the output.

Usage

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])

Variants

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

License

Apache 2.0

Downloads last month
39
Safetensors
Model size
2B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for soyrsoyr/erebus-v2-1.5b-tool

Finetuned
(2)
this model
Quantizations
1 model

Collection including soyrsoyr/erebus-v2-1.5b-tool