Text Generation
Safetensors
GGUF
PyTorch
English
generic
custom
function-calling
tiny-model
edge-ai
tool-use
router
Instructions to use Safeeq/FCtiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Safeeq/FCtiny with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Safeeq/FCtiny # Run inference directly in the terminal: llama cli -hf Safeeq/FCtiny
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Safeeq/FCtiny # Run inference directly in the terminal: llama cli -hf Safeeq/FCtiny
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Safeeq/FCtiny # Run inference directly in the terminal: ./build/bin/llama cli -hf Safeeq/FCtiny
Use Docker
docker model run hf.co/Safeeq/FCtiny
- Llama new
- LM Studio
- Jan
- vLLM
How to use Safeeq/FCtiny with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Safeeq/FCtiny" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Safeeq/FCtiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Safeeq/FCtiny
- Ollama
How to use Safeeq/FCtiny with Ollama:
ollama run hf.co/Safeeq/FCtiny
- Unsloth Desktop
- Docker Model Runner
How to use Safeeq/FCtiny with Docker Model Runner:
docker model run hf.co/Safeeq/FCtiny
- Lemonade
How to use Safeeq/FCtiny with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Safeeq/FCtiny
Run and chat with the model
lemonade run user.FCtiny-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Update TinyLM-FC weights, config, tokenizer, and model card
Browse files- README.md +32 -15
- model.safetensors +1 -1
- tokenizer.json +0 -0
README.md
CHANGED
|
@@ -180,18 +180,35 @@ with torch.no_grad():
|
|
| 180 |
|
| 181 |
## 📊 Benchmarks
|
| 182 |
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
|
| 186 |
-
|
|
| 187 |
-
| **
|
| 188 |
-
| **Routing
|
| 189 |
-
| **
|
| 190 |
-
| **
|
| 191 |
-
| **
|
| 192 |
-
| **
|
| 193 |
-
|
| 194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
|
| 196 |
---
|
| 197 |
|
|
@@ -241,10 +258,10 @@ Full pipeline available at [github.com/Safeeq008/tiny-fc-lm](https://github.com/
|
|
| 241 |
git clone https://github.com/Safeeq008/tiny-fc-lm.git
|
| 242 |
cd tiny-fc-lm && pip install -r requirements.txt
|
| 243 |
|
| 244 |
-
python gen_data.py # 1. Generate 80k synthetic training samples
|
| 245 |
python train_tok.py # 2. Train custom 2048-vocab BPE tokenizer
|
| 246 |
python train.py # 3. Train TinyLM-FC model (~5-10 min, CPU)
|
| 247 |
-
python eval.py # 4. Full benchmark suite
|
| 248 |
python infer.py # 5. Interactive CLI with live DuckDuckGo search
|
| 249 |
python serve.py 8000 # 6. FastAPI server + web UI
|
| 250 |
|
|
@@ -261,7 +278,7 @@ ollama create tinyfc -f Modelfile && ollama run tinyfc
|
|
| 261 |
1. **Single-tool**: Strictly routes `web_search` only — no multi-tool schemas.
|
| 262 |
2. **English only**: Custom BPE tokenizer trained on English synthetic corpus.
|
| 263 |
3. **80-token context window**: Inputs > ~60 user tokens are silently truncated.
|
| 264 |
-
4. **Synthetic training data**: Real-world query distributions are far noisier
|
| 265 |
5. **Constrained decoding required**: Raw greedy decoding may produce malformed outputs; use `infer.py`'s constrained decoder for production.
|
| 266 |
|
| 267 |
---
|
|
|
|
| 180 |
|
| 181 |
## 📊 Benchmarks
|
| 182 |
|
| 183 |
+
Evaluated on 2,000 in-distribution samples (`val.jsonl`), 1,000 held-out phrasing samples (`test_ood.jsonl`), and 1,000 domain-shift samples (`test_ood_domain.jsonl`):
|
| 184 |
+
|
| 185 |
+
| Metric | Val (In-Distribution) | Phrasing OOD (Held-Out Phrasings) | Domain Shift OOD (Novel Entities & Global) |
|
| 186 |
+
| :--- | :---: | :---: | :---: |
|
| 187 |
+
| **Exact Match Accuracy** | **99.90%** | **82.90%** | **0.40%** *(entity vocabulary bounded)* |
|
| 188 |
+
| **Routing Decision Accuracy** | **99.95%** | **89.50%** | **95.40%** |
|
| 189 |
+
| **Routing Precision (Tool)** | **100.00%** | **89.15%** | **100.00%** |
|
| 190 |
+
| **Routing Recall (Tool)** | **99.95%** | **99.40%** | **95.40%** |
|
| 191 |
+
| **Query Slot Exact Match** | **99.90%** | **82.90%** | **0.40%** |
|
| 192 |
+
| **Recency Slot Accuracy** | **99.90%** | **84.90%** | **54.60%** |
|
| 193 |
+
| **Syntactic Validity Rate** | **100.0%** | **99.80%** | **99.30%** |
|
| 194 |
+
| **CPU Inference Latency** | **~23.8 ms** | **~24.0 ms** | **~27.8 ms** |
|
| 195 |
+
|
| 196 |
+
### Per-Intent Performance (Phrasing OOD)
|
| 197 |
+
|
| 198 |
+
Key utility intents have been fortified against phrasing shifts and temporal ambiguity:
|
| 199 |
+
|
| 200 |
+
| Intent Category | Val Exact % | OOD Exact % | OOD Routing % | Status |
|
| 201 |
+
| :--- | :---: | :---: | :---: | :--- |
|
| 202 |
+
| **How-to / Guides** | 100.0% | **100.0%** | 100.0% | **Resolved (was 86.4%)** |
|
| 203 |
+
| **Sports Scores** | 100.0% | **100.0%** | 100.0% | **Resolved (was 88.5%)** |
|
| 204 |
+
| **Product Prices** | 100.0% | **96.2%** | 100.0% | **Resolved (was 84.8%)** |
|
| 205 |
+
| **General Concept** | 100.0% | **98.8%** | 98.8% | High fidelity |
|
| 206 |
+
| **Weather** | 99.4% | **97.4%** | 100.0% | High fidelity |
|
| 207 |
+
| **Stock Quotes** | 100.0% | **96.2%** | 100.0% | High fidelity |
|
| 208 |
+
| **Web Search** | 100.0% | **100.0%** | 100.0% | High fidelity |
|
| 209 |
+
| **Weekly Recap** | 100.0% | **80.3%** | 100.0% | 100% routing fidelity |
|
| 210 |
+
| **News** | 99.7% | **56.4%** | 97.0% | 97% routing fidelity |
|
| 211 |
+
| **Chit-Chat (Abstain)** | 100.0% | **41.0%** | 42.2% | Abstract banter vs tool call |
|
| 212 |
|
| 213 |
---
|
| 214 |
|
|
|
|
| 258 |
git clone https://github.com/Safeeq008/tiny-fc-lm.git
|
| 259 |
cd tiny-fc-lm && pip install -r requirements.txt
|
| 260 |
|
| 261 |
+
python gen_data.py # 1. Generate 80k synthetic training samples (train, val, phrasing OOD, domain OOD)
|
| 262 |
python train_tok.py # 2. Train custom 2048-vocab BPE tokenizer
|
| 263 |
python train.py # 3. Train TinyLM-FC model (~5-10 min, CPU)
|
| 264 |
+
python eval.py # 4. Full benchmark suite across all splits
|
| 265 |
python infer.py # 5. Interactive CLI with live DuckDuckGo search
|
| 266 |
python serve.py 8000 # 6. FastAPI server + web UI
|
| 267 |
|
|
|
|
| 278 |
1. **Single-tool**: Strictly routes `web_search` only — no multi-tool schemas.
|
| 279 |
2. **English only**: Custom BPE tokenizer trained on English synthetic corpus.
|
| 280 |
3. **80-token context window**: Inputs > ~60 user tokens are silently truncated.
|
| 281 |
+
4. **Synthetic training data & domain shift boundary**: Real-world query distributions are far noisier. While **tool routing transfers at 95.40%** to novel domains and unobserved tasks, **exact entity string extraction is bounded by the 0.47M parameter vocabulary** for unseen entities.
|
| 282 |
5. **Constrained decoding required**: Raw greedy decoding may produce malformed outputs; use `infer.py`'s constrained decoder for production.
|
| 283 |
|
| 284 |
---
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1889192
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d21eb215bf98573077ad0a03b1e837878d21729a052b7221cd78abc5eecc26ca
|
| 3 |
size 1889192
|
tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|