Instructions to use Arain119/sophia 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 Arain119/sophia 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 Arain119/sophia:Q4_K_M # Run inference directly in the terminal: llama cli -hf Arain119/sophia:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Arain119/sophia:Q4_K_M # Run inference directly in the terminal: llama cli -hf Arain119/sophia:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Arain119/sophia:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Arain119/sophia:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Arain119/sophia:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Arain119/sophia:Q4_K_M
Use Docker
docker model run hf.co/Arain119/sophia:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use Arain119/sophia with Ollama:
ollama run hf.co/Arain119/sophia:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use Arain119/sophia with Docker Model Runner:
docker model run hf.co/Arain119/sophia:Q4_K_M
- Lemonade
How to use Arain119/sophia with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Arain119/sophia:Q4_K_M
Run and chat with the model
lemonade run user.sophia-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Upload gguf/README.md with huggingface_hub
Browse files- gguf/README.md +32 -0
gguf/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sophia GGUF
|
| 2 |
+
|
| 3 |
+
Sophia's llama.cpp/GGUF build — a ~1B-parameter Chinese chat model (KDA+MLA hybrid, pretrained from scratch on a single RTX 5090).
|
| 4 |
+
|
| 5 |
+
Runs on llama.cpp's `kimi-k3` architecture (Sophia is a fully dense 28-layer instance: [KDA,KDA,KDA,MLA] layer pattern, bounded decay gate, cross-layer attention residuals, SiTU-GLU).
|
| 6 |
+
|
| 7 |
+
## Files
|
| 8 |
+
|
| 9 |
+
| File | Size | Notes |
|
| 10 |
+
|---|---|---|
|
| 11 |
+
| `sophia-bf16.gguf` | 2.1 GB | BF16, best quality |
|
| 12 |
+
| `sophia-Q4_K_M.gguf` | 685 MB | Q4_K_M; precision-sensitive tensors (KDA scalars, norms, conv, res_score) stay high-precision via fallback |
|
| 13 |
+
|
| 14 |
+
## Requirements
|
| 15 |
+
|
| 16 |
+
Needs an llama.cpp build with the `sophia` pre-tokenizer patch (~15 lines, see [Sophia repo](https://github.com/Arain119/Sophia) `tools/gguf/llama_cpp_sophia.patch`). The GGUF embeds `tokenizer.ggml.pre = "sophia"`: Sophia's tokenizer.json serializes its Split patterns as literals that never match, so the effective tokenization is ByteLevel+BPE over the whole input — the pre-tokenizer must not split at all.
|
| 17 |
+
|
| 18 |
+
```bash
|
| 19 |
+
# chat (embedded chat template applies automatically)
|
| 20 |
+
llama-cli -m sophia-Q4_K_M.gguf -st -t 8
|
| 21 |
+
|
| 22 |
+
# server
|
| 23 |
+
llama-server -m sophia-bf16.gguf -c 4096 -t 8 --port 8180
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
## Parity evidence (BF16 / CPU)
|
| 27 |
+
|
| 28 |
+
- Tokenization: **151/151 exact token-id match** vs the HF tokenizer
|
| 29 |
+
- Teacher-forced logits: **145/150 argmax agreement (96.7%)**, mean |Δlogprob| = 0.0137; every divergence is a top-2 near-tie (gap ≤ 0.06)
|
| 30 |
+
- Chat-template generation: byte-identical to the HF reference
|
| 31 |
+
|
| 32 |
+
Converter and reproduction scripts: [Sophia repo](https://github.com/Arain119/Sophia) `tools/gguf/`; details in `docs/gguf_llamacpp.md`.
|