Text Generation
Transformers
English
Hindi
sarus
viuai
sarus-500m
reasoning
cot
deepseek-r1
cognitive-monologue
hindi
english
causal-lm
Instructions to use ViuAI/ViuAI-500M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ViuAI/ViuAI-500M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ViuAI/ViuAI-500M")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ViuAI/ViuAI-500M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ViuAI/ViuAI-500M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ViuAI/ViuAI-500M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ViuAI/ViuAI-500M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ViuAI/ViuAI-500M
- SGLang
How to use ViuAI/ViuAI-500M 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 "ViuAI/ViuAI-500M" \ --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": "ViuAI/ViuAI-500M", "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 "ViuAI/ViuAI-500M" \ --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": "ViuAI/ViuAI-500M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ViuAI/ViuAI-500M with Docker Model Runner:
docker model run hf.co/ViuAI/ViuAI-500M
| from dataclasses import dataclass | |
| class ViuAIConfig: | |
| vocab_size: int = 64003 | |
| d_model: int = 1280 | |
| n_layers: int = 24 | |
| n_heads: int = 20 | |
| n_kv_heads: int = 4 | |
| ffn_hidden: int = 3456 | |
| context_length: int = 2048 | |
| rope_theta: float = 10000.0 | |
| norm_eps: float = 1e-5 | |
| z_loss_weight: float = 0.0 # 0.0 default for SFT/Inference (use 1e-4 for pretraining) | |
| use_checkpoint: bool = True | |
| attn_dropout: float = 0.05 # 0.0 for pretraining, 0.05 for SFT | |
| resid_dropout: float = 0.05 # 0.0 for pretraining, 0.05 for SFT | |
| neftune_alpha: float = 5.0 # NEFTune noise scale for SFT quality boost | |
| def pretrain(cls, **kwargs): | |
| """Standard configuration for base pretraining (no dropout, 1e-4 z-loss).""" | |
| defaults = dict(z_loss_weight=1e-4, attn_dropout=0.0, resid_dropout=0.0, neftune_alpha=0.0) | |
| defaults.update(kwargs) | |
| return cls(**defaults) | |
| def sft(cls, **kwargs): | |
| """Optimized configuration for Supervised Fine-Tuning.""" | |
| defaults = dict(z_loss_weight=0.0, attn_dropout=0.05, resid_dropout=0.05, neftune_alpha=5.0) | |
| defaults.update(kwargs) | |
| return cls(**defaults) | |
| # Compatibility Alias | |
| ModelArgs = ViuAIConfig | |