Instructions to use VertexAGI/quartz-micro-preview-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VertexAGI/quartz-micro-preview-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="VertexAGI/quartz-micro-preview-base", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("VertexAGI/quartz-micro-preview-base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use VertexAGI/quartz-micro-preview-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "VertexAGI/quartz-micro-preview-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VertexAGI/quartz-micro-preview-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/VertexAGI/quartz-micro-preview-base
- SGLang
How to use VertexAGI/quartz-micro-preview-base 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 "VertexAGI/quartz-micro-preview-base" \ --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": "VertexAGI/quartz-micro-preview-base", "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 "VertexAGI/quartz-micro-preview-base" \ --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": "VertexAGI/quartz-micro-preview-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use VertexAGI/quartz-micro-preview-base with Docker Model Runner:
docker model run hf.co/VertexAGI/quartz-micro-preview-base
Quartz Micro Preview Base
A ~1B-parameter mixture-of-experts language model, trained completely from scratch β randomly-initialized weights, no distillation, no fine-tune of an existing checkpoint β on a single consumer GPU (NVIDIA GTX 1660 Ti, 6GB VRAM). No cluster, no cloud credits.
This is the base checkpoint: raw pretrain output, published as-is. It has no instruction-following behavior β it completes text, it does not follow instructions or hold a conversation. An instruction-tuned release (full-parameter SFT, not LoRA) is in progress; see vertexagi.vercel.app/research for live status.
"Micro" because it's deliberately small. "Preview" because this first run is a proof of concept for training a real MoE from scratch on hardware anyone can buy β not the final word on how far the approach can go.
Architecture
DeepSeek-style fine-grained mixture-of-experts:
| Total parameters | 1,031.0M (~1.03B) |
| Active parameters / token | 394.0M |
| Hidden size | 1,024 |
| Layers | 20 (first 2 dense, rest MoE) |
| Attention | 16 query heads / 4 KV heads (GQA), head dim 64 |
| Context length | 2,048 tokens |
| Routed experts | 24 (6 active per token) |
| Shared experts | 2 (always active) |
| Expert FFN size | 640 (fine-grained segmentation) |
| Router | top-6 of 24, 0.01-weighted load-balancing loss |
| Vocabulary | 32,000 tokens |
| Tied embeddings | yes |
Training
- 100,003,832 tokens of packed training data β 70% FineWeb-Edu, 20% Wikipedia, 10% CodeParrot-clean
- 24,414 optimizer steps, 4,096 tokens/step (batch size Γ gradient accumulation Γ sequence length)
- FP16 mixed precision (autocast + GradScaler)
- 8-bit AdamW (bitsandbytes) to keep optimizer state small
- Full gradient checkpointing, gradient accumulation
- A from-scratch 32K-vocab byte-level BPE tokenizer, trained on a sample of the same corpus (included in this repo under
tokenizer/) - Single NVIDIA GTX 1660 Ti, 6GB VRAM, Windows desktop β survived two full power/network outages, resumed cleanly from checkpoint both times
Files
model.safetensorsβ model weights (optimizer state dropped; not needed for inference or further tuning from this checkpoint)configuration_quartz.py,modeling_quartz.pyβtransformers-compatiblePretrainedConfig/PreTrainedModelwrapper (QuartzMoEConfig,QuartzForCausalLM), wired up viaauto_mapinconfig.jsonsoAutoConfig/AutoModelForCausalLM(trust_remote_code=True)load this repo directly β verified bit-exact against the plain-PyTorch path below.model.py,config.pyβ the original plain-PyTorch model class and architecture config (MoELanguageModel,MoEConfig), used byload_model.py. Functionally identical architecture tomodeling_quartz.py, just without thetransformersscaffolding.config.jsonβ architecture config in HF's expected format, read by both loading paths.tokenizer.json,tokenizer_config.json,special_tokens_map.jsonβ a standardtransformersfast tokenizer (AutoTokenizer.from_pretrained(...)), built from the same vocab/merges below.tokenizer/vocab.json,tokenizer/merges.txtβ the custom tokenizer's raw vocab/merges, used byload_model.py's plain-PyTorch path. It is only compatible with this model; no other tokenizer will produce correct token ids for these weights, and vice versa.load_model.pyβ minimal working example using the plain-PyTorch path (load + generate)
Usage
Via transformers (recommended):
pip install transformers torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"VertexAGI/quartz-micro-preview-base", trust_remote_code=True
)
tok = AutoTokenizer.from_pretrained("VertexAGI/quartz-micro-preview-base")
ids = tok("The history of the Roman Empire", return_tensors="pt")
out = model.generate(**ids, max_new_tokens=80, do_sample=True, temperature=0.8)
print(tok.decode(out[0], skip_special_tokens=True))
trust_remote_code=True is required β this is a bespoke architecture (DeepSeek-style fine-grained MoE), not one of transformers' built-in model types, so it ships its own code (configuration_quartz.py, modeling_quartz.py). No KV-cache support yet, so generate() recomputes attention over the full sequence each step β fine at this model's size, just not as fast as a cached model.
Plain PyTorch (no transformers dependency):
pip install torch safetensors tokenizers
python load_model.py
from load_model import load, generate
model, tok = load()
print(generate(model, tok, "The history of the Roman Empire"))
Limitations
This is a base model from a single ~100M-token training run on a 6GB consumer GPU β small on every axis by design. Expect base-model behavior (text completion, not instruction-following), factual unreliability, and meaningfully weaker general knowledge than models trained on far larger corpora. No safety fine-tuning has been applied. Treat outputs accordingly.
No evaluation numbers are published for this checkpoint specifically β the held-out base-vs-tuned comparison happens once the instruction-tuned release is ready, per our usual practice of never publishing an eval that can't be directly compared against a real baseline.
Built by Vertex AGI. Every model we ship β weights, not just claims.
- Downloads last month
- 349