Instructions to use marekzel/mz-model-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use marekzel/mz-model-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="marekzel/mz-model-v1")# pip install -U transformers accelerate # Load model directly from transformers import MzModelV1 model = MzModelV1.from_pretrained("marekzel/mz-model-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use marekzel/mz-model-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "marekzel/mz-model-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "marekzel/mz-model-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/marekzel/mz-model-v1
- SGLang
How to use marekzel/mz-model-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 "marekzel/mz-model-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": "marekzel/mz-model-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 "marekzel/mz-model-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": "marekzel/mz-model-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use marekzel/mz-model-v1 with Docker Model Runner:
docker model run hf.co/marekzel/mz-model-v1
Model Description
MzModelV1 is a decoder-only Transformer language model built from scratch using PyTorch and Hugging Face Transformers. It was created as an experiment to explore language model training on consumer hardware in a home lab environment.
The project demonstrates that it is possible to train a language model with approximately 110 million parameters on a single consumer GPU.
Model Details
| Property | Value |
|---|---|
| Model name | MzModelV1 |
| Architecture | Decoder-only Transformer |
| Model type | mz_model_v1 |
| Parameters | 109.65 million |
| Hidden size | 768 |
| Number of layers | 12 |
| Attention heads | 12 |
| Feed-forward dimension | 3,072 |
| Vocabulary size | 32,000 |
| Maximum sequence length | 512 tokens |
| Positional encoding | Learned positional embeddings |
| Attention mechanism | Causal multi-head self-attention |
| Activation function | GELU |
| Normalization | LayerNorm |
| Weight tying | Input embeddings and output projection |
| Training hardware | NVIDIA RTX 5060 Ti (16 GB VRAM) |
| Training time | Approximately 38 hours |
| Pretraining dataset | Wikipedia Structured (7.6 million articles) |
| Fine-tuning dataset | SmolTalk (20,000 samples) |
| Framework | PyTorch, Hugging Face Transformers |
Training
The model was trained on a single NVIDIA RTX 5060 Ti with 16 GB of VRAM in approximately 38 hours.
The training process consisted of two stages:
- Pretraining: Wikipedia Structured dataset containing approximately 7.6 million articles.
- Fine-tuning: 20,000 samples from the SmolTalk dataset to improve the model's conversational abilities.
The goal of this project is to demonstrate that training a language model from scratch and fine-tuning it afterward is achievable in a home lab, without enterprise-grade hardware or a large GPU cluster.
MzModelV1 is an experimental project focused on learning, experimentation, and making language model development more accessible on consumer hardware.
Inference
Use inference script with GUI from https://github.com/marekzel/mz-model-v1
Disclaimer
This model is experimental and provided "as is" for research purposes only. The authors make no guarantees regarding its performance, safety, or accuracy. Use at your own risk.
- Downloads last month
- -