Text Generation
Transformers
GGUF
PEFT
grt
lora
toroidal-lora
rotational-transformer
givens-rotations
clifford-algebra
sophia-torus
matterwave
Instructions to use MatterWaveAI/grt-30m-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MatterWaveAI/grt-30m-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MatterWaveAI/grt-30m-lora")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MatterWaveAI/grt-30m-lora", device_map="auto") - PEFT
How to use MatterWaveAI/grt-30m-lora with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use MatterWaveAI/grt-30m-lora 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 MatterWaveAI/grt-30m-lora:F16 # Run inference directly in the terminal: llama cli -hf MatterWaveAI/grt-30m-lora:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf MatterWaveAI/grt-30m-lora:F16 # Run inference directly in the terminal: llama cli -hf MatterWaveAI/grt-30m-lora:F16
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 MatterWaveAI/grt-30m-lora:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf MatterWaveAI/grt-30m-lora:F16
Use Docker
docker model run hf.co/MatterWaveAI/grt-30m-lora:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use MatterWaveAI/grt-30m-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MatterWaveAI/grt-30m-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MatterWaveAI/grt-30m-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MatterWaveAI/grt-30m-lora:F16
- SGLang
How to use MatterWaveAI/grt-30m-lora 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 "MatterWaveAI/grt-30m-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MatterWaveAI/grt-30m-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "MatterWaveAI/grt-30m-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MatterWaveAI/grt-30m-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use MatterWaveAI/grt-30m-lora with Ollama:
ollama run hf.co/MatterWaveAI/grt-30m-lora:F16
- Unsloth Desktop
- Docker Model Runner
How to use MatterWaveAI/grt-30m-lora with Docker Model Runner:
docker model run hf.co/MatterWaveAI/grt-30m-lora:F16
- Lemonade
How to use MatterWaveAI/grt-30m-lora with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MatterWaveAI/grt-30m-lora:F16
Run and chat with the model
lemonade run user.grt-30m-lora-F16
List all available models
lemonade list
- Atomic Chat
Release MatterWaveAI/grt-30m-lora with GGUF & SHA256SUMS (T-018 / T-019)
Browse filesFiles changed (12)
- .gitattributes+4
- GRT_Whitepaper.pdfAdded+3
- PROVENANCE.mdAdded+9
- README.mdAdded+129
- SHA256SUMSAdded+9
- eval_results.jsonAdded+32
- grt-30m-lora-f16.ggufAdded+3
- grt-30m-lora-f32.ggufAdded+3
- grt_lora_adapter.safetensorsAdded+3
- grt_lora_config.jsonAdded+40
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+30
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353637383932 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textgrt-30m-lora-f16.gguf filter=lfs diff=lfs merge=lfs -textgrt-30m-lora-f32.gguf filter=lfs diff=lfs merge=lfs -textGRT_Whitepaper.pdf filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
123version https://git-lfs.github.com/spec/v1oid sha256:79219257df919cc598a75f7ae0968988ed0d33ffc1777469f9a9da39a558819dsize 1034984123456789# Provenance: `MatterWaveAI/grt-30m-lora`
- **Base Model**: `MatterWaveAI/grt-30m` (`release/30m/model.safetensors`)
- **Adapter Class**: `GRTRotationalLoRA` (`r=8`, `lora_alpha=16.0`, `tune_scales=True`)
- **Optimizer**: `HessianPairAdam` (`Sophia-Torus`, `lr=1.5e-2`, `80` steps)
- **Build Script**: `release/build_30m_lora.py`
- **Before Adaptation**: loss `6.172`, perplexity `479.1388`
- **After Adaptation**: loss `4.7464`, perplexity `115.1645`
- **Merge Equivalence**: `max_abs_diff = 0.0e+00` (`0` `nn.Linear`, `0` `nn.Conv1d`)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129---
license: apache-2.0
library_name: transformers
pipeline_tag: text-generation
tags:
- grt
- lora
- peft
- toroidal-lora
- rotational-transformer
- givens-rotations
- clifford-algebra
- sophia-torus
- matterwave
base_model: MatterWaveAI/grt-30m
---
# GRT-30M-LoRA (`MatterWaveAI/grt-30m-lora`)
**GRT-30M-LoRA** is the canonical **Toroidal Low-Rank Adaptation (`GRTRotationalLoRA`)** release for [`MatterWaveAI/grt-30m`](https://huggingface.co/MatterWaveAI/grt-30m) (`29,305,498` base parameters, **`0` `nn.Linear` layers**, **`0` `nn.Conv1d` layers**).
Because every projection in a Geometric Rotation Transformer is parameterized by phase angles on the flat torus $\mathbb{T}^P = (S^1)^P$ and radial scales rather than dense Euclidean weight matrices, standard linear LoRA ($W + BA$) cannot be applied without violating orthogonal/unitary manifold invariants. **`GRTRotationalLoRA`** instead attaches low-rank phase-shift matrices `lora_A` and `lora_B` directly to the butterfly rotation angle tensors:
$$\theta = \left(\theta_{\text{base}} + \frac{\alpha}{r}\, A B\right) \bmod 2\pi$$
At inference time, `merge_grt_lora(model)` folds $\Delta\theta = \frac{\alpha}{r} A B$ directly into $\theta_{\text{base}}$ with **bit-exact equivalence** (`max_abs_diff = 0.0`) and **zero runtime latency or parameter overhead**.
---
## Key Highlights & Metrics
| Metric | Value |
| :--- | :--- |
| **Adapter Class** | `GRTRotationalLoRA` (`transformers.models.grt.lora_grt`) |
| **Base Checkpoint** | [`MatterWaveAI/grt-30m`](https://huggingface.co/MatterWaveAI/grt-30m) (`29,305,498` params) |
| **LoRA Rank ($r$) / Alpha ($\alpha$)** | `r = 8`, `lora_alpha = 16.0` (`scaling = 2.0`) |
| **Trainable LoRA + Scale Parameters** | **`140,741`** (`0.48%` of base model) |
| **Adapter Checkpoint Size** | **`573.3 KB`** (`grt_lora_adapter.safetensors`) |
| **`nn.Linear` / `nn.Conv1d` Layers** | **`0` / `0` (100% Rotational Purity)** |
| **Optimizer** | `HessianPairAdam` (`Sophia-Torus` analytic Gauss-Newton curvature) |
| **Domain Assistant Loss (Before $\rightarrow$ After)** | `6.1720` $\rightarrow$ **`4.7464`** |
| **Domain Perplexity (Before $\rightarrow$ After)** | `479.14` $\rightarrow$ **`115.16`** |
| **Token Accuracy (Before $\rightarrow$ After)** | `19.5%` $\rightarrow$ **`28.8%`** |
| **Pre-Merge vs. Post-Merge `max_abs_diff`** | **`0.0e+00`** (bit-exact) |
---
## Quickstart (`transformers`)
### 1. Load & Merge `MatterWaveAI/grt-30m-lora` into `MatterWaveAI/grt-30m`
```python
import torch
from huggingface_hub import snapshot_download
from transformers import AutoTokenizer
from transformers.models.grt import GRTForCausalLM, load_grt_lora_pretrained
base_id = "MatterWaveAI/grt-30m"
adapter_dir = snapshot_download("MatterWaveAI/grt-30m-lora")
tokenizer = AutoTokenizer.from_pretrained(base_id)
model = GRTForCausalLM.from_pretrained(base_id, torch_dtype=torch.float32)
# Attach and fold the toroidal LoRA phase shifts into base_angles (0 inference overhead)
load_grt_lora_pretrained(model, adapter_dir, merge=True)
prompt = "<|im_start|>user\nExplain how GRTRotationalLoRA adapts a Geometric Rotation Transformer without linear layers.<|im_end|>\n<|im_start|>assistant\n"
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
out_ids = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(out_ids[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
```
### 2. Train Your Own Toroidal LoRA Adapter
```python
from transformers.models.grt import (
GRTForCausalLM,
attach_grt_lora,
build_grt_optimizer,
merge_grt_lora,
save_grt_lora_pretrained,
)
model = GRTForCausalLM.from_pretrained("MatterWaveAI/grt-30m")
attach_grt_lora(model, r=8, lora_alpha=16.0, tune_scales=True)
optimizer = build_grt_optimizer(model, lr=1e-2, weight_decay=0.0, hessian_mode=True)
# ... training loop ...
save_grt_lora_pretrained(model, "./my-grt-lora")
merge_grt_lora(model) # zero-overhead merged inference
```
---
## Complete `MatterWaveAI/grt-30m*` Research Suite on Hugging Face
1. **Base Causal LM**: [`MatterWaveAI/grt-30m`](https://huggingface.co/MatterWaveAI/grt-30m)
2. **Chat Fine-Tune**: [`MatterWaveAI/grt-30m-chat`](https://huggingface.co/MatterWaveAI/grt-30m-chat)
3. **4-Expert Mixture-of-Rotations (`MoR`)**: [`MatterWaveAI/grt-30m-mor`](https://huggingface.co/MatterWaveAI/grt-30m-mor)
4. **Circular-Pooled Sentence Embedding**: [`MatterWaveAI/grt-30m-embedding`](https://huggingface.co/MatterWaveAI/grt-30m-embedding)
5. **Cross-Encoder Reranker**: [`MatterWaveAI/grt-30m-reranker`](https://huggingface.co/MatterWaveAI/grt-30m-reranker)
6. **Vision-Language (`GRTVL`)**: [`MatterWaveAI/grt-30m-vl`](https://huggingface.co/MatterWaveAI/grt-30m-vl)
7. **Canonical Tokenizer & Polar Embedding Bank**: [`MatterWaveAI/grt-30m-tokenizer`](https://huggingface.co/MatterWaveAI/grt-30m-tokenizer)
8. **Rotational Text-to-Speech (`GRTTTS`)**: [`MatterWaveAI/grt-30m-tts`](https://huggingface.co/MatterWaveAI/grt-30m-tts)
9. **Multimodal Vision-Audio-Language-Speech (`GRTOmni`)**: [`MatterWaveAI/grt-30m-omni`](https://huggingface.co/MatterWaveAI/grt-30m-omni)
10. **Toroidal Rotational LoRA (`GRTRotationalLoRA`)**: [`MatterWaveAI/grt-30m-lora`](https://huggingface.co/MatterWaveAI/grt-30m-lora)
11. **Rotational Speech-to-Text ASR (`GRTASR`)**: [`MatterWaveAI/grt-30m-asr`](https://huggingface.co/MatterWaveAI/grt-30m-asr)
- **Whitepaper**: [**The Geometric Rotation Transformer (GRT): A Purely Rotational Foundation Architecture (`GRT_Whitepaper.pdf`)**](https://huggingface.co/MatterWaveAI/grt-30m/resolve/main/GRT_Whitepaper.pdf)
---
## License
Apache 2.0
---
## Citation
```bibtex
@techreport{householter2026grt,
title = {The Geometric Rotation Transformer: A Purely Rotational Foundation Architecture},
author = {Householter, David},
institution = {MatterWave AI},
year = {2026},
url = {https://matterwave.ai}
}
```12345678990d026638fdf7b4cc1269e64c391b9000cbe2fa2c356a0684378d6fac7119460 eval_results.json
000bafd40f80aeddca312d8afea332b4a8f2bb73e3421339474974e6a027cfb6 grt-30m-lora-f16.gguf
72ae91fdcb81d98e9deff84930baf9f937cbd7c5c8ae577c4544d05f11677711 grt-30m-lora-f32.gguf
6f82a2c5487a9b7b002e0809f8b9f6ec045b69051671ca6ae72d094a633c5a00 grt_lora_adapter.safetensors
e36913871e23ca265f3d780677eda89d6a216d7b48356964875bc7b071d54ad2 grt_lora_config.json
79219257df919cc598a75f7ae0968988ed0d33ffc1777469f9a9da39a558819d GRT_Whitepaper.pdf
8b78063b3dd750d7b6b33513b7e1f49a1e88019e74097f1282d1a48e11894653 README.md
be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506 tokenizer.json
b0b05688d53eec97348d23f9a203772fa28f12bdc8a0f6f5401f41568ec6ca31 tokenizer_config.json1234567891011121314151617181920212223242526272829303132{
"model_id": "MatterWaveAI/grt-30m-lora",
"adapter_class": "GRTRotationalLoRA",
"base_model": "MatterWaveAI/grt-30m",
"optimizer": "HessianPairAdam (Sophia-Torus)",
"base_parameters": 29305498,
"trainable_parameters": 140741,
"total_parameters_with_lora": 29436730,
"trainable_pct": 0.4803,
"lora_rank": 8,
"lora_alpha": 16.0,
"lora_scaling": 2.0,
"nn_linear_layers": 0,
"nn_conv1d_layers": 0,
"step0_identity_max_abs_diff": 0.0,
"merge_max_abs_diff": 0.0,
"reload_max_abs_diff": 0.0,
"adapter_file_bytes": 587108,
"training_steps": 80,
"before_adaptation": {
"assistant_loss": 6.172,
"perplexity": 479.1388,
"token_accuracy": 0.1954
},
"after_adaptation": {
"assistant_loss": 4.7464,
"perplexity": 115.1645,
"token_accuracy": 0.2883
},
"sample_prompt": "Explain how GRTRotationalLoRA adapts a Geometric Rotation Transformer without linear layers.",
"sample_response": "In each 2. equal 2^12^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^"
}123version https://git-lfs.github.com/spec/v1oid sha256:000bafd40f80aeddca312d8afea332b4a8f2bb73e3421339474974e6a027cfb6size 64554240123version https://git-lfs.github.com/spec/v1oid sha256:72ae91fdcb81d98e9deff84930baf9f937cbd7c5c8ae577c4544d05f11677711size 356546592123version https://git-lfs.github.com/spec/v1oid sha256:6f82a2c5487a9b7b002e0809f8b9f6ec045b69051671ca6ae72d094a633c5a00size 58710812345678910111213141516171819202122232425262728293031323334353637383940{
"peft_type": "GRT_ROTATIONAL_LORA",
"adapter_type": "GRTRotationalLoRA",
"auto_mapping": {
"base_model_class": "GRTForCausalLM"
},
"base_model_name_or_path": "MatterWaveAI/grt-30m",
"r": 8,
"lora_alpha": 16.0,
"scaling": 2.0,
"lora_dropout": 0.0,
"target_modules": [
"q_angles",
"k_angles",
"v_angles",
"o_angles",
"expand_angles",
"contract_angles",
"coupling_angles"
],
"tune_scales": true,
"manifold": "T^P = (S^1)^P",
"formula": "theta = (base_angles + (lora_alpha / r) * (lora_A @ lora_B)) mod 2*pi",
"zero_linear_layers": true,
"num_adapter_tensors": 242,
"num_adapter_parameters": 140741,
"model_id": "MatterWaveAI/grt-30m-lora",
"optimizer": "HessianPairAdam (Sophia-Torus)",
"training_steps": 80,
"before_adaptation": {
"assistant_loss": 6.172,
"perplexity": 479.1388,
"token_accuracy": 0.1954
},
"after_adaptation": {
"assistant_loss": 4.7464,
"perplexity": 115.1645,
"token_accuracy": 0.2883
}
}123version https://git-lfs.github.com/spec/v1oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506size 11422650123456789101112131415161718192021222324252627282930{
"add_prefix_space": false,
"backend": "tokenizers",
"bos_token": null,
"clean_up_tokenization_spaces": false,
"eos_token": "<|endoftext|>",
"errors": "replace",
"extra_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"is_local": true,
"local_files_only": false,
"model_max_length": 131072,
"pad_token": "<|endoftext|>",
"split_special_tokens": false,
"tokenizer_class": "Qwen2Tokenizer",
"unk_token": null
}.gitattributes+4
GRT_Whitepaper.pdfAdded+3
PROVENANCE.mdAdded+9
README.mdAdded+129
SHA256SUMSAdded+9
eval_results.jsonAdded+32
grt-30m-lora-f16.ggufAdded+3
grt-30m-lora-f32.ggufAdded+3
grt_lora_adapter.safetensorsAdded+3
grt_lora_config.jsonAdded+40
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+30