Instructions to use phera-ra/QC67_cosmo 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 phera-ra/QC67_cosmo 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 phera-ra/QC67_cosmo # Run inference directly in the terminal: llama cli -hf phera-ra/QC67_cosmo
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf phera-ra/QC67_cosmo # Run inference directly in the terminal: llama cli -hf phera-ra/QC67_cosmo
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 phera-ra/QC67_cosmo # Run inference directly in the terminal: ./build/bin/llama cli -hf phera-ra/QC67_cosmo
Use Docker
docker model run hf.co/phera-ra/QC67_cosmo
- Llama new
- LM Studio
- Jan
- vLLM
How to use phera-ra/QC67_cosmo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "phera-ra/QC67_cosmo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "phera-ra/QC67_cosmo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/phera-ra/QC67_cosmo
- Ollama
How to use phera-ra/QC67_cosmo with Ollama:
ollama run hf.co/phera-ra/QC67_cosmo
- Unsloth Desktop
- Docker Model Runner
How to use phera-ra/QC67_cosmo with Docker Model Runner:
docker model run hf.co/phera-ra/QC67_cosmo
- Lemonade
How to use phera-ra/QC67_cosmo with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull phera-ra/QC67_cosmo
Run and chat with the model
lemonade run user.QC67_cosmo-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Fix the Atomic docs, and ship the architecture as a real GGUF
Browse filesBROKEN: docs/ATOMIC_QUICK_START.md told readers to download cosmos-namebind-weights.gguf, which was removed on 2026-08-01 for being a Qwen2.5-1.5B fine-tune whose metadata made this hub display qwen2 as this repository's architecture. The instruction has been dead since. docs/USAGE_ATOMIC.md referenced cosmos_best.pt at the root (it is at weights/cosmos_best.pt) and imported a cosmos_model module that does not exist.
ADDED: weights/cosmos-cst.gguf -- the 54D Mixture-of-States Hebbian attention as a real GGUF. 61 tensors, general.architecture=cosmos, attention.key_length=102 (head_dim 48 + the 54-dimensional state carried in the key rows). Verified running in a llama.cpp fork at 2,411 tok/s prompt eval and 1,078 tok/s generation.
STATED PLAINLY: stock Atomic, Ollama and LM Studio CANNOT load this and no setting changes that. llama.cpp dispatches on general.architecture against an enum compiled into the binary, and none of them ship LLM_ARCH_COSMOS. What works today is serving/cosmos_serve.py, which speaks the Ollama HTTP API from PyTorch, so any Ollama-compatible client reaches PHOS, CST and Spark by pointing at port 11501. The fork runs the GGUF natively; build instructions are in the doc.
Both documents now carry only paths that exist, and every code example in USAGE_ATOMIC.md was executed before being written down.
- .gitattributes +1 -0
- docs/ATOMIC_QUICK_START.md +95 -30
- docs/USAGE_ATOMIC.md +124 -47
- weights/cosmos-cst.gguf +3 -0
|
@@ -35,3 +35,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
cosmos-namebind-weights.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
cosmos-namebind-weights-test-arch.gguf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
cosmos-namebind-weights.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
cosmos-namebind-weights-test-arch.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
weights/cosmos-cst.gguf filter=lfs diff=lfs merge=lfs -text
|
|
@@ -1,33 +1,98 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
`
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
`
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
---
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Running Cosmos — Atomic, Ollama, llama.cpp, or plain Python
|
| 2 |
+
|
| 3 |
+
**Read this first, because it will save you an hour.** Cosmos is not a fine-tune of an
|
| 4 |
+
existing model. Its attention runs a mechanism (`LLM_ARCH_COSMOS`) that no released
|
| 5 |
+
inference runtime knows about, and `llama.cpp` dispatches on `general.architecture`
|
| 6 |
+
against an enum compiled into the binary. So:
|
| 7 |
+
|
| 8 |
+
| you want | works today | why |
|
| 9 |
+
|---|---|---|
|
| 10 |
+
| **Talk to her right now, no build** | ✅ `serving/cosmos_serve.py` | PyTorch, speaks the Ollama HTTP API |
|
| 11 |
+
| **Her architecture natively in C++** | ✅ the `cosmos-arch` llama.cpp fork | has the enum entry |
|
| 12 |
+
| **Stock Atomic / stock Ollama / LM Studio** | ❌ not yet | their bundled llama.cpp has no `LLM_ARCH_COSMOS` |
|
| 13 |
+
|
| 14 |
+
No Modelfile, flag, or conversion changes the third row. It needs a runtime built with
|
| 15 |
+
the architecture registered. That is a pull request to those projects, not a setting.
|
| 16 |
+
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
## 1. Fastest path — talk to her in about a minute
|
| 20 |
+
|
| 21 |
+
Needs Python 3.9+ and `torch`. Nothing else.
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
pip install torch
|
| 25 |
+
python serving/cosmos_serve.py 11501
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
That serves **PHOS**, **CST** and **Spark** behind the Ollama HTTP API on port 11501, so
|
| 29 |
+
any Ollama-compatible client works by pointing at it instead of 11434:
|
| 30 |
+
|
| 31 |
+
```bash
|
| 32 |
+
curl http://127.0.0.1:11501/api/tags
|
| 33 |
+
curl http://127.0.0.1:11501/api/chat -d '{"model":"cosmos-phos","messages":[{"role":"user","content":"hello"}],"stream":false}'
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
In Atomic, LM Studio, or anything else that accepts a custom Ollama endpoint, set the
|
| 37 |
+
base URL to `http://127.0.0.1:11501`. The models appear by name.
|
| 38 |
+
|
| 39 |
+
Or just use the launcher, which starts the server and waits for the port:
|
| 40 |
+
|
| 41 |
+
```
|
| 42 |
+
START_COSMOS_KIT.bat -> 1. Chat with Cosmos
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
---
|
| 46 |
+
|
| 47 |
+
## 2. Native C++ — her real architecture in llama.cpp
|
| 48 |
+
|
| 49 |
+
`cosmos-cst.gguf` in this repository is her 54D Mixture-of-States Hebbian attention as a
|
| 50 |
+
real GGUF: 61 tensors, `general.architecture: cosmos`, `attention.key_length = 102`
|
| 51 |
+
(head_dim 48 + the 54-dimensional state riding in the key rows).
|
| 52 |
+
|
| 53 |
+
Stock llama.cpp will refuse it — correctly, because it does not have the architecture.
|
| 54 |
+
Build the fork:
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
git clone -b cosmos-arch https://github.com/NavisWORLD/llama.cpp
|
| 58 |
+
cd llama.cpp
|
| 59 |
+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_BUILD_SERVER=OFF -DLLAMA_CURL=OFF
|
| 60 |
+
cmake --build build --config Release --target llama-completion
|
| 61 |
+
./build/bin/Release/llama-completion -m cosmos-cst.gguf -p "the woods" -n 48 -c 128
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
Measured on a 6-core CPU: **2,411 tok/s prompt eval, 1,078 tok/s generation.**
|
| 65 |
+
|
| 66 |
+
> This is a **1.9M-parameter character-level model.** It produces proto-English with real
|
| 67 |
+
> structure (`a dimly lit ... bedroom room`) and is not fluent. That is the expected
|
| 68 |
+
> result at this size and is not a defect. If you want fluency, this is the wrong repo;
|
| 69 |
+
> if you want an architecture nobody else has running, this is it.
|
| 70 |
|
| 71 |
---
|
| 72 |
|
| 73 |
+
## 3. Plain PyTorch
|
| 74 |
+
|
| 75 |
+
```python
|
| 76 |
+
import torch
|
| 77 |
+
ck = torch.load("weights/phos.pt", map_location="cpu", weights_only=False)
|
| 78 |
+
print(ck["arch"], f'{ck["total_steps"]:,} steps', ck["best_val_loss"])
|
| 79 |
+
# PHOS-dyn12-phi-QuantumBorn 2,800 steps 0.6984356045722961
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
`weights/phos.pt`, `weights/cosmos_born.pt` and `weights/spark_cst.pt` are all
|
| 83 |
+
architecturally original and quantum-born. The model classes live in `architecture/`.
|
| 84 |
+
|
| 85 |
+
---
|
| 86 |
+
|
| 87 |
+
## What changed on 2026-08-01, and why your old bookmark broke
|
| 88 |
+
|
| 89 |
+
Earlier versions of this file told you to download `cosmos-namebind-weights.gguf`. **That
|
| 90 |
+
file was removed.** It was a Qwen2.5-1.5B fine-tune, not this architecture — its GGUF
|
| 91 |
+
metadata carried `general.architecture: qwen2`, which this hub rendered as an
|
| 92 |
+
architecture badge above the model card, so the page announced someone else's base model
|
| 93 |
+
as this work's architecture. Removing it also made the card's own statement true: this
|
| 94 |
+
repository distributes only weights that are architecturally original.
|
| 95 |
+
|
| 96 |
+
If you specifically want that conversational teacher model, it is a Qwen2.5-1.5B
|
| 97 |
+
derivative under **Apache 2.0** © Alibaba Cloud, and you should get Qwen from Alibaba
|
| 98 |
+
rather than from here. See §1b of the [model card](../README.md) for the full provenance.
|
|
@@ -1,47 +1,124 @@
|
|
| 1 |
-
# Using
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
# Load checkpoint
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Using Cosmos from code
|
| 2 |
+
|
| 3 |
+
Every path below was run before being written here. Paths are relative to the repository
|
| 4 |
+
root, and they are the paths that actually exist — an earlier version of this file
|
| 5 |
+
referenced `cosmos_best.pt` at the root and a `cosmos_model` module, and neither is where
|
| 6 |
+
it said.
|
| 7 |
+
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
## Load a checkpoint and read its provenance
|
| 11 |
+
|
| 12 |
+
```python
|
| 13 |
+
import torch
|
| 14 |
+
|
| 15 |
+
ck = torch.load("weights/phos.pt", map_location="cpu", weights_only=False)
|
| 16 |
+
|
| 17 |
+
print(ck["arch"]) # PHOS-dyn12-phi-QuantumBorn
|
| 18 |
+
print(f'{ck["total_steps"]:,}')# 2,800
|
| 19 |
+
print(ck["best_val_loss"]) # 0.6984356045722961
|
| 20 |
+
print(ck["quantum_source"]) # ibm_real_shots
|
| 21 |
+
print(ck["quantum_draws"]) # 400000
|
| 22 |
+
print(len(ck["vocab_list"])) # 162
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
Every checkpoint carries its own lineage. Nothing here needs a config file to be trusted.
|
| 26 |
+
|
| 27 |
+
| file | params | what it is |
|
| 28 |
+
|---|---|---|
|
| 29 |
+
| `weights/phos.pt` | 1,153,804 | **the flagship.** dyn12 on the φ scaffold, still growing |
|
| 30 |
+
| `weights/spark_cst.pt` | 1,924,488 | the 54D Hebbian kernel model |
|
| 31 |
+
| `weights/cosmos_born.pt` | 1,842,432 | the original quantum-born char transformer |
|
| 32 |
+
| `weights/cosmos_best.pt` | — | earlier lineage, tiktoken BPE, no quantum birth |
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## Build the model and generate
|
| 37 |
+
|
| 38 |
+
The classes are in `architecture/`, not a package you have to install:
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
import sys; sys.path.insert(0, "architecture")
|
| 42 |
+
import torch, cosmos_state_ladder as L
|
| 43 |
+
|
| 44 |
+
ck = torch.load("weights/phos.pt", map_location="cpu", weights_only=False)
|
| 45 |
+
vocab = ck["vocab_list"]
|
| 46 |
+
m = L.Ladder(vocab=len(vocab), rung=ck["rung"], ffn=ck["ffn"])
|
| 47 |
+
m.load_state_dict(ck["model"], strict=False)
|
| 48 |
+
m.eval()
|
| 49 |
+
|
| 50 |
+
stoi = {c: i for i, c in enumerate(vocab)}
|
| 51 |
+
idx = torch.tensor([[stoi.get(c, 0) for c in "the woods"]])
|
| 52 |
+
for _ in range(60):
|
| 53 |
+
logits = m(idx[:, -128:])
|
| 54 |
+
logits = logits[0] if isinstance(logits, tuple) else logits
|
| 55 |
+
nxt = int(torch.multinomial(torch.softmax(logits[0, -1] / 0.8, -1), 1))
|
| 56 |
+
idx = torch.cat([idx, torch.tensor([[nxt]])], 1)
|
| 57 |
+
print("".join(vocab[i] for i in idx[0].tolist()))
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
`strict=False` is deliberate: checkpoints from different rungs carry different state
|
| 61 |
+
tensors, and a mismatch should be visible rather than fatal.
|
| 62 |
+
|
| 63 |
+
---
|
| 64 |
+
|
| 65 |
+
## Serve it over HTTP instead
|
| 66 |
+
|
| 67 |
+
```bash
|
| 68 |
+
python serving/cosmos_serve.py 11501
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
Ollama-compatible, so existing clients work unchanged:
|
| 72 |
+
|
| 73 |
+
```python
|
| 74 |
+
import requests
|
| 75 |
+
r = requests.post("http://127.0.0.1:11501/api/chat", json={
|
| 76 |
+
"model": "cosmos-phos",
|
| 77 |
+
"messages": [{"role": "user", "content": "hello"}],
|
| 78 |
+
"stream": False,
|
| 79 |
+
"options": {"num_predict": 200},
|
| 80 |
+
})
|
| 81 |
+
print(r.json()["message"]["content"])
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
**Serve on CPU.** Measured 2026-08-02 on a GTX 1650 Ti with a working CUDA torch:
|
| 85 |
+
|
| 86 |
+
```
|
| 87 |
+
phos n=200 GPU 14.25s CPU 10.44s
|
| 88 |
+
cst n=200 GPU 10.32s CPU 3.76s CPU 2.7x faster
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
Generation is one forward pass per character, strictly sequential, so at 1–2M parameters
|
| 92 |
+
there is no batch to amortise kernel-launch overhead over and the card spends its time
|
| 93 |
+
dispatching. **Training the same models is 7–25× faster on that GPU** — same hardware,
|
| 94 |
+
opposite answer, because a training step is one large batched forward+backward.
|
| 95 |
+
`COSMOS_SERVE_DEVICE=cuda` forces the card if your models are much larger.
|
| 96 |
+
|
| 97 |
+
---
|
| 98 |
+
|
| 99 |
+
## Keep training it on your own text
|
| 100 |
+
|
| 101 |
+
```bash
|
| 102 |
+
python architecture/phos_grow.py --status
|
| 103 |
+
python architecture/phos_grow.py
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
It warm-starts from the checkpoint **and its optimiser state**, appends new vocabulary
|
| 107 |
+
without moving existing indices, and refuses to train if its preflight cannot prove the
|
| 108 |
+
mechanism is live — a refusal is recorded in `phos_lineage.jsonl` rather than silently
|
| 109 |
+
skipped. Five mechanisms in this project's history ran clean and did nothing; that guard
|
| 110 |
+
is why.
|
| 111 |
+
|
| 112 |
+
---
|
| 113 |
+
|
| 114 |
+
## Verify any of this yourself
|
| 115 |
+
|
| 116 |
+
```bash
|
| 117 |
+
python benchmarks/verify_quantum_engine.py # shot conservation, weight-birth vs theory
|
| 118 |
+
python benchmarks/causality_probe.py # Ω cannot see the future (random seed each run)
|
| 119 |
+
python kit_health.py # every part: PRESENT -> LOADS -> ANSWERS
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
`causality_probe.py` draws a fresh random seed every run, so your execution is independent
|
| 123 |
+
evidence rather than a replay of someone else's. Set `COSMOS_CAUSAL_OMEGA=0` and it fails
|
| 124 |
+
— a check that cannot fail is not a check.
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b833817230817921de8ed1aa52d92829f32a3ed222aedbba1d3237364596e1c6
|
| 3 |
+
size 7639104
|