Instructions to use Kuantum-ai1/TinyCode1.1-164M-Python with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kuantum-ai1/TinyCode1.1-164M-Python with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kuantum-ai1/TinyCode1.1-164M-Python")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kuantum-ai1/TinyCode1.1-164M-Python") model = AutoModelForCausalLM.from_pretrained("Kuantum-ai1/TinyCode1.1-164M-Python", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kuantum-ai1/TinyCode1.1-164M-Python with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kuantum-ai1/TinyCode1.1-164M-Python" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kuantum-ai1/TinyCode1.1-164M-Python", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Kuantum-ai1/TinyCode1.1-164M-Python
- SGLang
How to use Kuantum-ai1/TinyCode1.1-164M-Python 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 "Kuantum-ai1/TinyCode1.1-164M-Python" \ --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": "Kuantum-ai1/TinyCode1.1-164M-Python", "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 "Kuantum-ai1/TinyCode1.1-164M-Python" \ --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": "Kuantum-ai1/TinyCode1.1-164M-Python", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Kuantum-ai1/TinyCode1.1-164M-Python with Docker Model Runner:
docker model run hf.co/Kuantum-ai1/TinyCode1.1-164M-Python
File size: 2,686 Bytes
2f209d4 969b4d2 2f209d4 969b4d2 2f209d4 da90bf7 2f209d4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | ---
license: bigcode-openrail-m
language:
- en
library_name: transformers
pipeline_tag: text-generation
base_model: Kuantum-ai1/TinyCode1-164M-Python
tags:
- code
- python
---
# TinyCode1.1-164M-Python
A small Python code-completion model, fine-tuned from [`Kuantum-ai1/TinyCode1-164M-Python`](https://huggingface.co/Kuantum-ai1/TinyCode1-164M-Python) (v1, itself fine-tuned from [`bigcode/tiny_starcoder_py`](https://huggingface.co/bigcode/tiny_starcoder_py)) on 80M tokens of filtered Python code.
## Training
- Base model: `Kuantum-ai1/TinyCode1-164M-Python` (v1)
- Data (80M tokens, single pass): about 10M tokens of instruction-style docstring-to-code pairs (Magicoder-OSS-Instruct, self-oss-instruct-sc2) and the rest from [`jon-tow/starcoderdata-python-edu`](https://huggingface.co/datasets/jon-tow/starcoderdata-python-edu) (educational-quality Python files).
- Filtering: valid Python (`ast.parse`), length and line-length limits, alphabetic-ratio check, exact deduplication, and removal of any sample that shares a normalized line (40+ chars) with HumanEval (prompt, solution, tests) or any MBPP split, or contains an MBPP task description (14 candidate samples removed). The packed data was re-scanned after tokenization as a final check.
- Hardware: 2x NVIDIA T4 (DDP, fp16 mixed precision), sequence length 1024, batch 65k tokens, peak LR 5e-05, cosine schedule
## Evaluation
Greedy decoding, pass@1 (%), identical harness for every model (max 200 new tokens, 10 s timeout per program).
HumanEval uses the standard prompts; MBPP (500 test problems) is zero-shot with a docstring-style prompt containing the task and the first test, so numbers are not directly comparable with few-shot figures reported elsewhere.
| Model | Params | MBPP |
|---|---|---|
| Base: bigcode/tiny_starcoder_py | 164M | 4.8 |
| Kuantum-ai1/TinyCode1.1-164M-Python (v1.1, ours) | 164M | 9.8 |
| Kuantum-ai1/TinyCode1-164M-Python (v1) | 164M | 3.8 |
Compared with v1: MBPP +6.00 (absolute pass@1 points).
Base numbers come from an earlier run of the same harness; v1 and v1.1 were evaluated together in the final run.
## GGUF
no gguf is avaible
## Usage
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("Kuantum-ai1/TinyCode1.1-164M-Python")
model = AutoModelForCausalLM.from_pretrained("Kuantum-ai1/TinyCode1.1-164M-Python")
ids = tok("def fibonacci(n):", return_tensors="pt")
print(tok.decode(model.generate(**ids, max_new_tokens=100)[0]))
```
## Limitations
Small model: it makes frequent mistakes and should not be relied on for production code. Generated code must be reviewed before use.
## License
bigcode-openrail-m
|