Text Generation
Transformers
Safetensors
Romanian
English
rost
romanian
bilingual
nanochat
conversational
custom_code
Instructions to use rostlabs/rost-1b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rostlabs/rost-1b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rostlabs/rost-1b-instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("rostlabs/rost-1b-instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rostlabs/rost-1b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rostlabs/rost-1b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rostlabs/rost-1b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rostlabs/rost-1b-instruct
- SGLang
How to use rostlabs/rost-1b-instruct 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 "rostlabs/rost-1b-instruct" \ --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": "rostlabs/rost-1b-instruct", "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 "rostlabs/rost-1b-instruct" \ --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": "rostlabs/rost-1b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rostlabs/rost-1b-instruct with Docker Model Runner:
docker model run hf.co/rostlabs/rost-1b-instruct
Upload folder using huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: [ro, en]
|
| 3 |
+
license: cc-by-nc-4.0
|
| 4 |
+
tags: [romanian, bilingual, nanochat, pretrained]
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# stefaniancu/rost-d24-sft
|
| 8 |
+
|
| 9 |
+
the instruction-tuned chat model, depth d24, checkpoint step 000387.
|
| 10 |
+
|
| 11 |
+
Trained from scratch on a bilingual Romanian/English mixture — tokenizer
|
| 12 |
+
included, so the Romanian tokenization is purpose-built rather than inherited
|
| 13 |
+
from an English model.
|
| 14 |
+
|
| 15 |
+
| | |
|
| 16 |
+
|---|---|
|
| 17 |
+
| architecture | nanochat GPT, d24, 4,096 context |
|
| 18 |
+
| tokenizer | [stefaniancu/rost-tok-bilingual](https://huggingface.co/stefaniancu/rost-tok-bilingual), 32,768 vocab, bilingual |
|
| 19 |
+
| pretraining mixture | 30% Romanian / 70% English, interleaved at document level |
|
| 20 |
+
| Romanian source | FineWeb2-ro, educational score >= 3, diacritic-normalized |
|
| 21 |
+
| English source | ClimbMix |
|
| 22 |
+
| stage | sft |
|
| 23 |
+
|
| 24 |
+
The tokenizer is included under `tokenizer/` so this repo is self-contained.
|
| 25 |
+
|
| 26 |
+
## Running it
|
| 27 |
+
|
| 28 |
+
```python
|
| 29 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 30 |
+
|
| 31 |
+
model = AutoModelForCausalLM.from_pretrained("stefaniancu/rost-d24-sft", trust_remote_code=True)
|
| 32 |
+
tokenizer = AutoTokenizer.from_pretrained("stefaniancu/rost-d24-sft")
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
`trust_remote_code` is required because RoST is a custom architecture, not a
|
| 36 |
+
Llama variant: the modelling code ships in this repo (`modeling_rost.py`) and
|
| 37 |
+
is a transcription of the training implementation, verified to reproduce its
|
| 38 |
+
logits exactly.
|
| 39 |
+
|
| 40 |
+
The original training checkpoint (`model_*.pt` + `meta_*.json`) is included too,
|
| 41 |
+
for use with [the rost repository](https://github.com/StefanIancu/rost).
|
| 42 |
+
|
| 43 |
+
**GGUF / llama.cpp is not available yet.** llama.cpp compiles architectures in
|
| 44 |
+
rather than loading them dynamically, so Ollama and LM Studio support needs the
|
| 45 |
+
architecture implemented and upstreamed there.
|
| 46 |
+
|
| 47 |
+
## Licence
|
| 48 |
+
|
| 49 |
+
**CC-BY-NC-4.0, non-commercial.** Both halves of the training data carry
|
| 50 |
+
non-commercial terms: ClimbMix is CC-BY-NC-4.0 ("for research and development
|
| 51 |
+
only"), and the OpenLLM-Ro SFT datasets are CC-BY-NC-4.0. The model inherits
|
| 52 |
+
that. Note that the ClimbMix mirror used is tagged MIT, which does not override
|
| 53 |
+
the upstream terms.
|
| 54 |
+
|
| 55 |
+
## Known characteristics
|
| 56 |
+
|
| 57 |
+
The Romanian pretraining data is roughly **one third health content** by
|
| 58 |
+
character count (measured across three shards of the source), with history,
|
| 59 |
+
geography, finance and education each near 10%. Entertainment, gaming and
|
| 60 |
+
software are each under 1%. Expect fluency to be uneven across domains
|
| 61 |
+
accordingly.
|
| 62 |
+
|
| 63 |
+
## Reproduce
|
| 64 |
+
|
| 65 |
+
```bash
|
| 66 |
+
bash runs/speedrun_ro.sh
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
Source and full experiment log: https://github.com/StefanIancu/rost
|