Text Generation
Transformers
English
codva1
IT
chat
LLM
code
coding
math
Mixture of Experts
instruction-tuned
gqa
rope
custom-architecture
custom_code
Instructions to use Smilyai-labs/CodVa-1-Small-IT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Smilyai-labs/CodVa-1-Small-IT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Smilyai-labs/CodVa-1-Small-IT", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Smilyai-labs/CodVa-1-Small-IT", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Smilyai-labs/CodVa-1-Small-IT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Smilyai-labs/CodVa-1-Small-IT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Smilyai-labs/CodVa-1-Small-IT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Smilyai-labs/CodVa-1-Small-IT
- SGLang
How to use Smilyai-labs/CodVa-1-Small-IT 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 "Smilyai-labs/CodVa-1-Small-IT" \ --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": "Smilyai-labs/CodVa-1-Small-IT", "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 "Smilyai-labs/CodVa-1-Small-IT" \ --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": "Smilyai-labs/CodVa-1-Small-IT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Smilyai-labs/CodVa-1-Small-IT with Docker Model Runner:
docker model run hf.co/Smilyai-labs/CodVa-1-Small-IT
| language: | |
| - en | |
| base_model: | |
| - Smilyai-labs/CodVa-1-Small | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| license: other | |
| license_name: codva-community-license | |
| license_link: https://huggingface.co/Smilyai-labs/CodVa-1-Small-IT/blob/main/LICENSE.txt | |
| tags: | |
| - IT | |
| - chat | |
| - LLM | |
| - code | |
| - coding | |
| - math | |
| - moe | |
| - instruction-tuned | |
| - gqa | |
| - rope | |
| - custom-architecture | |
| # CodVa-1-Small-IT Model Card | |
| --- | |
| ## Model Overview | |
| **CodVa-1-Small-IT** is an instruction-tuned Large Language Model developed by **Smilyai-labs** β a team of high-school students passionate about AI research and development. This model is the instruction-tuned (IT) variant of our base model, [CodVa-1-Small](https://huggingface.co/Smilyai-labs/CodVa-1-Small), fine-tuned to follow instructions, answer questions, and assist with coding and mathematical reasoning tasks. | |
| --- | |
| ## Key Features | |
| - π§ **Custom Architecture** β Built on our in-house architecture designed from the ground up to maximise performance on code and math benchmarks | |
| - β‘ **Mixture of Experts (MoE) FFN** β Sparse MoE feed-forward layers with shared experts, giving a large parameter count while keeping per-token compute low | |
| - π **Grouped Query Attention (GQA)** β Reduces KV-cache memory footprint significantly compared to standard multi-head attention, enabling longer context at inference time | |
| - π **RoPE with Extended Theta** β Rotary positional embeddings with a high theta value (5,000,000) for improved length generalisation beyond the training context window | |
| - π§ **QK Norm** β Per-head RMS normalisation on queries and keys for more stable attention across long sequences | |
| - π¬ **Instruction Tuned** β Fine-tuned on a curated dataset of code, math, and general instruction-following examples to produce a helpful, chat-capable assistant | |
| --- | |
| ## Architecture Details | |
| | Component | Configuration | | |
| |---|---| | |
| | Architecture | Custom Decoder-Only Transformer | | |
| | Hidden Dimension | 1536 | | |
| | Layers | 28 | | |
| | Attention Heads | 24 (Query) / 6 (KV) | | |
| | Attention Type | Grouped Query Attention (GQA) | | |
| | Positional Encoding | RoPE (ΞΈ = 5,000,000) | | |
| | FFN Type | Dense SwiGLU + Sparse MoE | | |
| | MoE Experts | 16 routed + 2 shared | | |
| | MoE Top-K | 2 routed experts per token | | |
| | MoE Hidden Dim | 1024 | | |
| | MoE Frequency | Every 2 layers | | |
| | Context Length | 4096 tokens | | |
| | Vocabulary Size | 32,000 (+ special tokens) | | |
| | Normalisation | RMSNorm throughout | | |
| | QK Norm | β Enabled | | |
| | Structural Bias | β Enabled (4 relation types) | | |
| | Precision | BFloat16 | | |
| --- | |
| ## Training Details | |
| ### Pre-Training (CodVa-1-Small Base) | |
| The base model was pre-trained from scratch on a large corpus of code and mathematical text, optimised for strong reasoning and programming capabilities. | |
| ### Instruction Fine-Tuning (This Model) | |
| **CodVa-1-Small-IT** was produced by supervised fine-tuning (SFT) of the base model on a curated instruction dataset. | |
| | Setting | Value | | |
| |---|---| | |
| | Fine-tuning Method | Supervised Fine-Tuning (SFT) | | |
| | Dataset | [Bc-AI/codva-it-data-v5.1](https://huggingface.co/datasets/Bc-AI/codva-it-data-v5.1) | | |
| | Sequence Length | 4096 tokens | | |
| | Optimizer | AdamW (8-bit where available) | | |
| | Learning Rate | 2e-5 | | |
| | LR Schedule | Cosine decay with warmup | | |
| | Weight Decay | 0.01 | | |
| | Gradient Clipping | 1.0 | | |
| | Precision | BFloat16 | | |
| --- | |
| ## Intended Use | |
| **CodVa-1-Small-IT** is intended for: | |
| - π» **Code generation and completion** β Writing functions, classes, scripts, and full programs across a range of programming languages | |
| - π **Code explanation and debugging** β Understanding existing code, identifying bugs, and suggesting fixes | |
| - π **Mathematical reasoning** β Step-by-step problem solving, symbolic reasoning, and numerical computation | |
| - π€ **General instruction following** β Answering questions, summarising text, and following natural language instructions | |
| - π§ͺ **Research and experimentation** β Exploring small-scale LLM behaviour, fine-tuning further, or using as a base for downstream tasks | |
| --- | |
| ## Limitations | |
| As with all language models β particularly smaller ones β there are important limitations to be aware of: | |
| - **Factual accuracy** β The model may confidently produce incorrect information. Always verify outputs for any critical use case | |
| - **Context length** β Performance may degrade on inputs approaching the 4096-token context limit | |
| - **Mathematical reliability** β While the architecture is optimised for math, the model can still make arithmetic and reasoning errors, especially on complex multi-step problems | |
| - **Safety** β This model has not undergone extensive red-teaming or safety fine-tuning. It should not be deployed in production applications without additional safety measures | |
| - **Scale** β As a small model, it will be outperformed by larger models on complex tasks. It is best suited for lightweight deployment, experimentation, and research | |
| --- | |
| ## About Smilyai-labs | |
| **Smilyai-labs** is a team of high-school students who are passionate about AI research. We design and train our own model architectures from scratch, rather than fine-tuning existing open-source models, with the goal of learning every part of the deep learning stack β from architecture design and custom CUDA kernels to dataset curation and training infrastructure. | |
| CodVa is our flagship model series, focused on code and mathematical reasoning. | |
| > We are students building real models. Feedback, collaboration offers, and questions are very welcome. | |
| --- | |
| ## Citation | |
| If you use CodVa-1-Small-IT in your research or projects, please consider citing or crediting the Smilyai-labs team: | |
| ``` | |
| @misc{codva1small, | |
| author = {Smilyai-labs}, | |
| title = {CodVa-1-Small-IT: An Instruction-Tuned Code and Math Language Model}, | |
| year = {2025}, | |
| howpublished = {\url{https://huggingface.co/Smilyai-labs/CodVa-1-Small-IT}}, | |
| } | |
| ``` | |
| --- | |
| ## License | |
| Please refer to the repository's license file for terms of use. If you intend to use this model for commercial purposes, please contact the Smilyai-labs team directly. |