Dedicated Endpoints

Run this model inference on single tenant GPU with unmatched speed and reliability at scale.

Learn more
Container

Run this model inference with full control and performance in your environment.

Learn more

Get help setting up a custom Dedicated Endpoints.

Talk with our engineer to get a quote for reserved GPU instances with discounts.

README

License: other

Use (chat)

This is a chat model (ChatML). The turn terminator it emits is the literal string <|im_end|> — which is not the eos_token_id (50256 = <|endoftext|>) and is not even a single token. You must stop on the <|im_end|> string or generation will not stop:

python

from transformers import AutoModelForCausalLM, AutoTokenizer
mid = "sfanm/d24-sft-v2-reasoning-3.7B"
tok = AutoTokenizer.from_pretrained(mid)
model = AutoModelForCausalLM.from_pretrained(mid, torch_dtype="bfloat16", device_map="auto")
msgs = [{"role": "user", "content": "Natalia sold clips to 48 friends in April and half as many in May. How many total?"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=512, do_sample=False, stop_strings=["<|im_end|>"], tokenizer=tok)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=False))

Without stop_strings=["<|im_end|>"] the model rambles to max_new_tokens: the configured eos_token_id (50256) is the GPT-2 document EOS, which a chat turn does not end with. For vLLM, pass stop=["<|im_end|>"].

Research checkpoint from a from-scratch nanochat-d24 replication (pretrain → midtrain → SFT → RL) on NERSC Perlmutter. Trained on third-party corpora (ClimbMix, FineMath, OpenMath, MetaMath, OpenThoughts, OLMo-3 Dolmino, SmolTalk, …) — see those datasets' licenses; provided as-is for research.

Model provider

sfanm

sfanm

Model tree

Base

this model

Modalities

Input

Text

Output

Text

Pricing

Dedicated Endpoints

View details

Supported Functionality

Model APIs

Dedicated Endpoints

Container

More information

Explore FriendliAI today