Text Generation
Transformers
Safetensors
GGUF
English
code
code-generation
multimodal
llama
conversational
Instructions to use mrsandip/Alfa-Code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mrsandip/Alfa-Code with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mrsandip/Alfa-Code")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mrsandip/Alfa-Code", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use mrsandip/Alfa-Code with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf mrsandip/Alfa-Code:Q4_0 # Run inference directly in the terminal: llama cli -hf mrsandip/Alfa-Code:Q4_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf mrsandip/Alfa-Code:Q4_0 # Run inference directly in the terminal: llama cli -hf mrsandip/Alfa-Code:Q4_0
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf mrsandip/Alfa-Code:Q4_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf mrsandip/Alfa-Code:Q4_0
Use Docker
docker model run hf.co/mrsandip/Alfa-Code:Q4_0
- Llama new
- LM Studio
- Jan
- vLLM
How to use mrsandip/Alfa-Code with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mrsandip/Alfa-Code" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mrsandip/Alfa-Code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mrsandip/Alfa-Code:Q4_0
- SGLang
How to use mrsandip/Alfa-Code 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 "mrsandip/Alfa-Code" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mrsandip/Alfa-Code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "mrsandip/Alfa-Code" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mrsandip/Alfa-Code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use mrsandip/Alfa-Code with Ollama:
ollama run hf.co/mrsandip/Alfa-Code:Q4_0
- Unsloth Desktop
- Docker Model Runner
How to use mrsandip/Alfa-Code with Docker Model Runner:
docker model run hf.co/mrsandip/Alfa-Code:Q4_0
- Lemonade
How to use mrsandip/Alfa-Code with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull mrsandip/Alfa-Code:Q4_0
Run and chat with the model
lemonade run user.Alfa-Code-Q4_0
List all available models
lemonade list
- Atomic Chat
docs: readme v0.0.2 — gguf table
Browse files
README.md
CHANGED
|
@@ -15,25 +15,54 @@ datasets:
|
|
| 15 |
metrics:
|
| 16 |
- code_eval
|
| 17 |
- perplexity
|
| 18 |
-
version: 0.
|
| 19 |
---
|
| 20 |
|
| 21 |
# Alfa Code - Multimodal Coding GGUF
|
| 22 |
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
## 1. Data
|
| 26 |
`python scripts/download_data.py --dataset code_small_test --max-rows 500`
|
| 27 |
Output: `data/processed/train.jsonl` {modality,prompt,think,answer}
|
| 28 |
|
| 29 |
## 2. Tokenizer + Train
|
| 30 |
-
`python scripts/train_tokenizer.py` -> `tokenizers/alfa-32k.json` (
|
| 31 |
`pip install torch --index-url https://download.pytorch.org/whl/cu121`
|
| 32 |
`python scripts/train.py` -> `outputs/tiny-50M`
|
| 33 |
|
| 34 |
-
|
| 35 |
-
`
|
| 36 |
-
`python scripts/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
## 4. UI (reasoning live->collapsed + image/file/video)
|
| 39 |
`python app/ui.py` -> http://127.0.0.1:7860
|
|
|
|
| 15 |
metrics:
|
| 16 |
- code_eval
|
| 17 |
- perplexity
|
| 18 |
+
version: 0.0.2
|
| 19 |
---
|
| 20 |
|
| 21 |
# Alfa Code - Multimodal Coding GGUF
|
| 22 |
|
| 23 |
+
Llama-based code models, trained on Kaggle T4. Ready-to-run GGUF weights below.
|
| 24 |
+
|
| 25 |
+
## Download (ready weights)
|
| 26 |
+
|
| 27 |
+
**GitHub release:** https://github.com/mrsandipmandal/alfa-code/releases/tag/v0.0.2
|
| 28 |
+
**HuggingFace:** https://huggingface.co/mrsandip/Alfa-Code/tree/main/gguf
|
| 29 |
+
|
| 30 |
+
| Model | Q8_0 (best) | Q4_0 (small) | Context |
|
| 31 |
+
|---|---|---|---|
|
| 32 |
+
| tiny-50M (56M) | tiny-50M-q8.gguf (60 MB) | tiny-50M-q4.gguf (32 MB) | 2048 |
|
| 33 |
+
| base-1B (1.1B) | base-1B-q8.gguf (1.19 GB) | base-1B-q4.gguf (632 MB) | 2048 |
|
| 34 |
+
| code-100k (1.39B) | ⏳ Kaggle upload pending | ⏳ | 8192 (YaRN → 131k) |
|
| 35 |
+
|
| 36 |
+
```bash
|
| 37 |
+
llama-server -m base-1B-q4.gguf -c 2048
|
| 38 |
+
llama-server -m tiny-50M-q8.gguf -c 2048
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
Tokenizer (32k BPE): `tokenizers/alfa-32k.json` — also in the v0.0.2 release assets.
|
| 42 |
|
| 43 |
## 1. Data
|
| 44 |
`python scripts/download_data.py --dataset code_small_test --max-rows 500`
|
| 45 |
Output: `data/processed/train.jsonl` {modality,prompt,think,answer}
|
| 46 |
|
| 47 |
## 2. Tokenizer + Train
|
| 48 |
+
`python scripts/train_tokenizer.py` -> `tokenizers/alfa-32k.json` (32000 vocab, ~419KB)
|
| 49 |
`pip install torch --index-url https://download.pytorch.org/whl/cu121`
|
| 50 |
`python scripts/train.py` -> `outputs/tiny-50M`
|
| 51 |
|
| 52 |
+
Scale-up (Colab T4, ~2-4h): 5000+ rows, chat tuning, 3-5 epochs:
|
| 53 |
+
`python scripts/download_data.py --dataset multimodal_mix --max-rows 5000 --overwrite`
|
| 54 |
+
`python scripts/download_data.py --dataset chat_qa --max-rows 2000` (appends Q&A rows)
|
| 55 |
+
`python scripts/train_hf.py --data data/processed/train.jsonl --out /content/outputs/tiny-50M --epochs 3 --config configs/tiny-50M.yaml --max-seq-len 2048 --batch-size 1`
|
| 56 |
+
|
| 57 |
+
1B model (16GB+ GPU only, not RTX 3050 4GB): same commands with `--config configs/base-1B.yaml --out /content/outputs/base-1B` (1.12B params, ~2.2GB fp16).
|
| 58 |
+
|
| 59 |
+
## 3. GGUF (no llama.cpp clone needed)
|
| 60 |
+
`pip install gguf safetensors torch transformers`
|
| 61 |
+
`python scripts/convert_to_gguf.py --ckpt outputs/tiny-50M --quant Q8_0` (Q8_0 ~55MB, Q4_0 ~32MB, F16 ~105MB)
|
| 62 |
+
K-quants (Q4_K_M) need standard dims + `llama-quantize` binary — not offered (intermediate 1376).
|
| 63 |
+
|
| 64 |
+
Run local (RTX 3050 4GB):
|
| 65 |
+
`llama-server -m outputs/tiny-50M.gguf -c 2048` or Ollama Modelfile (`FROM ./outputs/tiny-50M.gguf`).
|
| 66 |
|
| 67 |
## 4. UI (reasoning live->collapsed + image/file/video)
|
| 68 |
`python app/ui.py` -> http://127.0.0.1:7860
|