Text Generation
Transformers
Safetensors
grt
code
python
tool-calling
function-calling
rotational-transformer
givens-rotations
clifford-algebra
matterwave
Instructions to use MatterWaveAI/grt-30m-code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MatterWaveAI/grt-30m-code with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MatterWaveAI/grt-30m-code")# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("MatterWaveAI/grt-30m-code", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MatterWaveAI/grt-30m-code with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MatterWaveAI/grt-30m-code" # 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-code", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MatterWaveAI/grt-30m-code
- SGLang
How to use MatterWaveAI/grt-30m-code 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-code" \ --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-code", "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-code" \ --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-code", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MatterWaveAI/grt-30m-code with Docker Model Runner:
docker model run hf.co/MatterWaveAI/grt-30m-code
Fix model card formatting (replace raw LaTeX with clean Unicode and code spans)
Browse files
README.md
CHANGED
|
@@ -25,12 +25,12 @@ It specializes the 12-layer Givens Rotational Transformer backbone for:
|
|
| 25 |
|
| 26 |
## Code & Tool-Calling Alignment Metrics
|
| 27 |
|
| 28 |
-
- **Held-Out Code & Tool-Call Validation Perplexity**: `54.93` (`val_loss = 4.0061` base)
|
| 29 |
-
- **Held-Out Python Code Token Top-1 Accuracy**: `46.80%`
|
| 30 |
-
- **Held-Out Python AST Syntax Validity (`ast.parse`)**: `0.00%`
|
| 31 |
-
- **Held-Out Structured Tool-Call Token Top-1 Accuracy**: `36.44%`
|
| 32 |
-
- **Held-Out JSON Tool-Call Schema Match Rate**: `0.00%`
|
| 33 |
-
- **Code Signature/Docstring Conditioning Margin (
|
| 34 |
|
| 35 |
---
|
| 36 |
|
|
@@ -38,7 +38,7 @@ It specializes the 12-layer Givens Rotational Transformer backbone for:
|
|
| 38 |
|
| 39 |
We benchmarked all 8 classical geometric, Riemannian, conic, symplectic, gyroscopic, and synchronization optimizers from `transformers.models.grt.optimization_grt` on `MatterWaveAI/grt-30m-code` (`200` SFT steps on `blocks[11:12]` + `final_norm` + `<|im_end|>` polar phase calibration, `811,907` trainable parameters, `batch_size = 16`, `lr = 6.5e-3`, `max_angular_step = 0.12`, `seed = 42`):
|
| 40 |
|
| 41 |
-
| Rank | Optimizer (`optimizer_type`) | Final Train Loss | Val Loss | Val PPL | Code Token Acc (%) | Tool-Call Token Acc (%) | JSON Schema Match (%) | Python AST Valid (%) | Conditioning Margin (
|
| 42 |
| :---: | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
| 43 |
| **1** | **`HuygensAdam` (`huygens_adam`)** | **`1.0882`** | **`0.5672`** | **`1.7632`** | **`99.07%`** | **`90.69%`** | **`83.33%`** | **`91.67%`** | `1.5152` | `138.63s` |
|
| 44 |
| **2** | **`PairAdam` (`pair_adam`)** | `1.0994` | `0.6018` | `1.8253` | `97.60%` | **`90.69%`** | **`83.33%`** | `50.00%` | **`1.6597`** | `278.80s` |
|
|
|
|
| 25 |
|
| 26 |
## Code & Tool-Calling Alignment Metrics
|
| 27 |
|
| 28 |
+
- **Held-Out Code & Tool-Call Validation Perplexity**: `54.93` (`val_loss = 4.0061` base) → **`1.7632`** (`val_loss = 0.5672` w/ `HuygensAdam`; `1.8253` w/ `PairAdam`, `1.8619` w/ `GyricAdam`)
|
| 29 |
+
- **Held-Out Python Code Token Top-1 Accuracy**: `46.80%` → **`99.07%`** (`HuygensAdam`; `98.93%` w/ `CyclideAdam`, `98.53%` w/ `GyricAdam`)
|
| 30 |
+
- **Held-Out Python AST Syntax Validity (`ast.parse`)**: `0.00%` → **`91.67%`** (`HuygensAdam`; `83.33%` w/ `CyclideAdam`)
|
| 31 |
+
- **Held-Out Structured Tool-Call Token Top-1 Accuracy**: `36.44%` → **`90.69%`** (`HuygensAdam` & `PairAdam`; `89.50%` w/ `CyclideAdam`)
|
| 32 |
+
- **Held-Out JSON Tool-Call Schema Match Rate**: `0.00%` → **`83.33%`** (`HuygensAdam` & `PairAdam`; `75.00%` w/ `CyclideAdam`, `GyricAdam`, `HuygensSymplecticAdam`)
|
| 33 |
+
- **Code Signature/Docstring Conditioning Margin (`ΔL`)**: `0.8998` → **`1.6597` nats/tok** (`PairAdam`) / **`1.5766` nats/tok** (`SymplecticAdam`)
|
| 34 |
|
| 35 |
---
|
| 36 |
|
|
|
|
| 38 |
|
| 39 |
We benchmarked all 8 classical geometric, Riemannian, conic, symplectic, gyroscopic, and synchronization optimizers from `transformers.models.grt.optimization_grt` on `MatterWaveAI/grt-30m-code` (`200` SFT steps on `blocks[11:12]` + `final_norm` + `<|im_end|>` polar phase calibration, `811,907` trainable parameters, `batch_size = 16`, `lr = 6.5e-3`, `max_angular_step = 0.12`, `seed = 42`):
|
| 40 |
|
| 41 |
+
| Rank | Optimizer (`optimizer_type`) | Final Train Loss | Val Loss | Val PPL | Code Token Acc (%) | Tool-Call Token Acc (%) | JSON Schema Match (%) | Python AST Valid (%) | Conditioning Margin (`ΔL`) | Wall Time (s) |
|
| 42 |
| :---: | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
| 43 |
| **1** | **`HuygensAdam` (`huygens_adam`)** | **`1.0882`** | **`0.5672`** | **`1.7632`** | **`99.07%`** | **`90.69%`** | **`83.33%`** | **`91.67%`** | `1.5152` | `138.63s` |
|
| 44 |
| **2** | **`PairAdam` (`pair_adam`)** | `1.0994` | `0.6018` | `1.8253` | `97.60%` | **`90.69%`** | **`83.33%`** | `50.00%` | **`1.6597`** | `278.80s` |
|