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
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -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/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -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
- 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
Download scripts/download_data.py from mrsandip/Alfa-Code: direct link, hf CLI and curl.
- Browser
- Download file 2.34 kB
-
https://huggingface.co/mrsandip/Alfa-Code/resolve/main/scripts/download_data.py
- Command line
-
hf download hf://mrsandip/Alfa-Code/scripts/download_data.py
-
curl -L -o download_data.py https://huggingface.co/mrsandip/Alfa-Code/resolve/main/scripts/download_data.py
2.34 kB
| """Download + normalize HF datasets to data/processed/train.jsonl""" | |
| import argparse, json, os | |
| from pathlib import Path | |
| from datasets import load_dataset | |
| MAP = { | |
| "code_small_test": ("HuggingFaceH4/CodeAlpaca_20K", None, None), # public, no login needed | |
| "code_pretrain": ("bigcode/the-stack-v2", None, None), # gated, needs HF_TOKEN | |
| "code_instruct": ("bigcode/self-oss-instruct", None, None), | |
| "reasoning": ("Open-Orca/OpenOrca", None, None), | |
| "image_to_code": ("HuggingFaceM4/websight", None, None), | |
| } | |
| OUT = Path("data/processed/train.jsonl") | |
| OUT.parent.mkdir(parents=True, exist_ok=True) | |
| def normalize_code_instruct(row): | |
| # self-oss-instruct fields vary; keep raw + unified prompt | |
| prompt = row.get("instruction") or row.get("prompt") or row.get("question") or "" | |
| answer = row.get("output") or row.get("response") or row.get("answer") or "" | |
| return {"modality": "code+reasoning", "prompt": prompt, "think": "", "answer": answer} | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--dataset", default="code_small_test", choices=list(MAP.keys())) | |
| ap.add_argument("--max-rows", type=int, default=500) | |
| ap.add_argument("--streaming", action="store_true", help="stream for large sets like the-stack-v2") | |
| args = ap.parse_args() | |
| ds_id, subset, text_col = MAP[args.dataset] | |
| print(f"Loading {ds_id} ...") | |
| ds = load_dataset(ds_id, subset, split="train", streaming=args.streaming) | |
| if args.streaming: | |
| it = iter(ds) | |
| rows = [next(it) for _ in range(args.max_rows)] | |
| else: | |
| ds = ds.select(range(min(args.max_rows, len(ds)))) | |
| rows = list(ds) | |
| with open(OUT, "a", encoding="utf-8") as f: | |
| for r in rows: | |
| if args.dataset == "code_small_test": | |
| # CodeAlpaca_20K: {prompt, completion} | |
| obj = {"modality": "code+reasoning", "prompt": r.get("prompt", "")[:4000], "think": "", "answer": r.get("completion", "")[:8000]} | |
| elif args.dataset in ("code_instruct", "reasoning"): | |
| obj = normalize_code_instruct(r) | |
| else: | |
| obj = {"modality": "image", "prompt": str(r)[:4000], "think": "", "answer": ""} | |
| f.write(json.dumps(obj, ensure_ascii=False) + "\n") | |
| print(f"Wrote {len(rows)} rows -> {OUT}") | |
| if __name__ == "__main__": | |
| main() | |