Instructions to use AjayRangoji/AR-4B-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AjayRangoji/AR-4B-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AjayRangoji/AR-4B-base", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("AjayRangoji/AR-4B-base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AjayRangoji/AR-4B-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AjayRangoji/AR-4B-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AjayRangoji/AR-4B-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AjayRangoji/AR-4B-base
- SGLang
How to use AjayRangoji/AR-4B-base 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 "AjayRangoji/AR-4B-base" \ --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": "AjayRangoji/AR-4B-base", "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 "AjayRangoji/AR-4B-base" \ --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": "AjayRangoji/AR-4B-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AjayRangoji/AR-4B-base with Docker Model Runner:
docker model run hf.co/AjayRangoji/AR-4B-base
|
Download training_code/PROGRESS.md from AjayRangoji/AR-4B-base: direct link, hf CLI and curl.
- Browser
- Download file 1.9 kB
-
https://huggingface.co/AjayRangoji/AR-4B-base/resolve/main/training_code/PROGRESS.md
- Command line
-
hf download hf://AjayRangoji/AR-4B-base/training_code/PROGRESS.md
-
curl -L -o PROGRESS.md https://huggingface.co/AjayRangoji/AR-4B-base/resolve/main/training_code/PROGRESS.md
1.9 kB
| # AR progress | |
| ## Done | |
| - Milestone 1: data pipeline (tokenizer, prepare_data, dataset) — 10M FineWeb tokens at /fsx/ajay-stu/ar-data/bin/fineweb.bin | |
| - Milestone 2: model architecture — 4.022B params, replicates Qwen3-4B | |
| - Milestone 3: single-GPU training loop — loss drops 12 -> 7.2 on 0.5B test. WORKS. | |
| - Fixed: weight init bug (logits were exploding to std~32; added small-normal + residual scaling) | |
| ## Next: Milestone 4 — scale to 8 GPUs (FSDP) | |
| ## Open issues | |
| - Storage: /fsx is 100% full. Need /fsxb write access from admin for real run. | |
| - TODO: intra-document masking (option 2) before real training | |
| - TODO: full 4B needs FSDP + bf16 + grad checkpointing (single GPU OOMs) | |
| ## Run that works | |
| python -m ar.train.train --bin /fsx/ajay-stu/ar-data/bin/fineweb.bin --model_size small --max_steps 200 --batch_size 2 --seq_len 1024 --warmup_steps 20 | |
| ## Session 2 update | |
| - Milestone 4 DONE: FSDP2 multi-GPU works. Full 4B trains across 8 H100s (was OOM on 1 GPU). | |
| - train_fsdp.py is the multi-GPU script. Launch: torchrun --nproc_per_node=8 -m ar.train.train_fsdp ... | |
| - Verified: 2-GPU (0.5B) and 8-GPU (full 4B) both run, loss at correct 11.9 baseline. | |
| ## BLOCKER for real training: storage + data | |
| - Only have 10M tokens (40MB, english only) — too small, would overfit. | |
| - Need: (1) /fsxb access or other big storage, (2) prep real multi-source dataset (200B+ tokens for strong base) | |
| - Storage frees up in mornings when others aren't using cluster. | |
| ## Next session (morning) | |
| 1. Sort storage (check /fsxb, /fsx free space) | |
| 2. Prep real dataset: all 3 sources, target 200B+ tokens (uint32 = ~800GB, so storage matters) | |
| 3. THEN launch real training run (this is the overnight-worthy job) | |
| ## Minor TODOs | |
| - torch.manual_seed() in setup to silence DTensor RNG warning | |
| - intra-document masking (option 2) before real run | |
| - Milestones remaining: M5 multi-node, M6 efficiency, M7 sampling/eval | |