Text Generation
Transformers
TensorBoard
Safetensors
English
qwen3
pretrained
base-model
from-scratch
conversational
text-generation-inference
Instructions to use josh-a/rivet-1b-pt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use josh-a/rivet-1b-pt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="josh-a/rivet-1b-pt") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("josh-a/rivet-1b-pt") model = AutoModelForCausalLM.from_pretrained("josh-a/rivet-1b-pt", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use josh-a/rivet-1b-pt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "josh-a/rivet-1b-pt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "josh-a/rivet-1b-pt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/josh-a/rivet-1b-pt
- SGLang
How to use josh-a/rivet-1b-pt 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 "josh-a/rivet-1b-pt" \ --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": "josh-a/rivet-1b-pt", "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 "josh-a/rivet-1b-pt" \ --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": "josh-a/rivet-1b-pt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use josh-a/rivet-1b-pt with Docker Model Runner:
docker model run hf.co/josh-a/rivet-1b-pt
Base model card (v9 pretrained checkpoint)
Browse files
README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- text-generation
|
| 8 |
+
- pretrained
|
| 9 |
+
- base-model
|
| 10 |
+
- from-scratch
|
| 11 |
+
- qwen3
|
| 12 |
+
library_name: transformers
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Rivet-1B-PT (base model)
|
| 16 |
+
|
| 17 |
+
The **pretrained base** behind [josh-a/rivet-1b-it](https://huggingface.co/josh-a/rivet-1b-it): a 1.09B parameter language model trained **entirely from scratch** — custom tokenizer, custom corpus, no inherited weights. This repo holds the raw pretrained checkpoint (v9 lineage), before any supervised fine-tuning.
|
| 18 |
+
|
| 19 |
+
> Uses the Qwen3 *architecture* for serving compatibility. Shares **no weights** with Qwen — the tokenizer (custom 32k SentencePiece) and every parameter were trained from zero.
|
| 20 |
+
|
| 21 |
+
**Want the usable model?** You almost certainly want [rivet-1b-it](https://huggingface.co/josh-a/rivet-1b-it), the post-trained version that chats, reasons in `<think>` blocks, and does tasks. This base model completes text; it does not follow instructions.
|
| 22 |
+
|
| 23 |
+
## What this is for
|
| 24 |
+
|
| 25 |
+
- Fine-tuning your own model on top of a from-scratch 1B with a 16K context
|
| 26 |
+
- Research into small-model pretraining dynamics (full cost/data disclosure in the [technical report](https://huggingface.co/josh-a/rivet-1b-it/blob/main/TECHNICAL_REPORT.md))
|
| 27 |
+
- A clean, fully-documented provenance chain: every pretraining token is public data or documented
|
| 28 |
+
|
| 29 |
+
## Training lineage
|
| 30 |
+
|
| 31 |
+
1. **v6 pilot** — 6.3B tokens, deliberately undertrained (2x RTX 5090)
|
| 32 |
+
2. **v7 main pretrain** — 283.4B tokens over 7 weeks, eval loss 1.598 (2x RTX 5090)
|
| 33 |
+
3. **v8 context extension** — RoPE ABF (theta 100K → 1e6) to 16K context, +3B long-doc tokens (2x H100)
|
| 34 |
+
4. **v9 "intelligence run"** — +20B tokens reweighted toward reasoning/math/code, eval loss 1.477. **This checkpoint.**
|
| 35 |
+
|
| 36 |
+
Total: ~306B tokens trained from a 387.5B-token pool (composition in [josh-a/rivet-cpt](https://huggingface.co/datasets/josh-a/rivet-cpt)).
|
| 37 |
+
|
| 38 |
+
## Model details
|
| 39 |
+
|
| 40 |
+
| | |
|
| 41 |
+
|---|---|
|
| 42 |
+
| Params | 1,086,422,528 |
|
| 43 |
+
| Architecture | Qwen3ForCausalLM (from-scratch weights) |
|
| 44 |
+
| Hidden / layers | 2048 / 22 |
|
| 45 |
+
| Heads | 16 query / 8 KV (GQA), head_dim 128 |
|
| 46 |
+
| FFN | 5504 (SwiGLU) |
|
| 47 |
+
| Vocab | 32000 (custom SentencePiece) |
|
| 48 |
+
| Context | 16384 (RoPE θ=1e6; YaRN-extrapolable to ~64K) |
|
| 49 |
+
| Tokenizer | custom 32k; `<think>`=4, `</think>`=5, `<|im_start|>`=6, `<|im_end|>`=7 |
|
| 50 |
+
|
| 51 |
+
## Usage
|
| 52 |
+
|
| 53 |
+
```python
|
| 54 |
+
import torch
|
| 55 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 56 |
+
|
| 57 |
+
m = "josh-a/rivet-1b-pt"
|
| 58 |
+
tok = AutoTokenizer.from_pretrained(m)
|
| 59 |
+
model = AutoModelForCausalLM.from_pretrained(m, dtype=torch.bfloat16).to("cuda").eval()
|
| 60 |
+
|
| 61 |
+
ids = tok("The capital of New Zealand is", return_tensors="pt").to("cuda")
|
| 62 |
+
out = model.generate(**ids, max_new_tokens=20, do_sample=False)
|
| 63 |
+
print(tok.decode(out[0][ids["input_ids"].shape[1]:]))
|
| 64 |
+
# -> " Wellington" (as of the v9 intelligence run)
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
## Limitations
|
| 68 |
+
|
| 69 |
+
- This is a **base model**: no instruction following, no chat template behaviour, no refusals, no alignment of any kind.
|
| 70 |
+
- Factually modest (1B parameters); see the technical report for the honest eval picture.
|
| 71 |
+
|
| 72 |
+
## License
|
| 73 |
+
|
| 74 |
+
Apache-2.0. From-scratch weights; no upstream model license applies.
|