Text Generation
Transformers
English
zenith
tenstorrent
code
reasoning
Mixture of Experts
ring-attention
eq-adapter
matrix-corp
Instructions to use Matrix-Corp/Zenith-7b-V1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Matrix-Corp/Zenith-7b-V1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Matrix-Corp/Zenith-7b-V1")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Matrix-Corp/Zenith-7b-V1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Matrix-Corp/Zenith-7b-V1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Matrix-Corp/Zenith-7b-V1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Matrix-Corp/Zenith-7b-V1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Matrix-Corp/Zenith-7b-V1
- SGLang
How to use Matrix-Corp/Zenith-7b-V1 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 "Matrix-Corp/Zenith-7b-V1" \ --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": "Matrix-Corp/Zenith-7b-V1", "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 "Matrix-Corp/Zenith-7b-V1" \ --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": "Matrix-Corp/Zenith-7b-V1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Matrix-Corp/Zenith-7b-V1 with Docker Model Runner:
docker model run hf.co/Matrix-Corp/Zenith-7b-V1
| #!/usr/bin/env python3 | |
| """Test EQ engine implementation.""" | |
| import torch | |
| from modeling_zenith import ZenithConfig, ZenithModel | |
| def test_eq_engine(): | |
| print("Testing EQ Engine Implementation...") | |
| # Create config with all EQ features enabled | |
| config = ZenithConfig( | |
| use_eq_adapter=True, | |
| use_eq_attention_bias=True, | |
| use_eq_gated_ffn=True, | |
| use_eq_recurrence=True, | |
| eq_consistency_weight=0.02, | |
| eq_state_dim=256, | |
| num_layers=4, # Small for testing | |
| hidden_size=512, | |
| num_heads=8, | |
| head_dim=64, | |
| intermediate_size=2048 | |
| ) | |
| print(f"Config: {config}") | |
| # Create model | |
| model = ZenithModel(config) | |
| print(f"[OK] Model created successfully") | |
| print(f" Parameters: {sum(p.numel() for p in model.parameters()):,}") | |
| # Test forward pass | |
| batch_size = 2 | |
| seq_len = 16 | |
| input_ids = torch.randint(0, config.vocab_size, (batch_size, seq_len)) | |
| # Training mode to test consistency loss | |
| model.train() | |
| outputs = model(input_ids=input_ids, labels=input_ids) | |
| print(f"[OK] Forward pass successful") | |
| print(f" Logits shape: {outputs.logits.shape}") | |
| print(f" Loss: {outputs.loss.item() if outputs.loss is not None else 'None'}") | |
| # Test inference mode | |
| model.eval() | |
| with torch.no_grad(): | |
| outputs = model(input_ids=input_ids) | |
| print(f"[OK] Inference successful") | |
| print(f" Logits shape: {outputs.logits.shape}") | |
| print("\n[SUCCESS] EQ Engine implementation is FULLY FUNCTIONAL") | |
| print("\nFeatures implemented:") | |
| print(" [1] EQ attention bias") | |
| print(" [2] EQ-gated FFN") | |
| print(" [3] Recurrent EQ state with GRU") | |
| print(" [4] EQ consistency loss") | |
| print(" [5] Per-layer EQ adapter integration") | |
| if __name__ == "__main__": | |
| test_eq_engine() | |