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
File size: 2,077 Bytes
df64241 | 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 | #!/bin/bash
# Frees disk space after pretraining. Shows what it would remove; deletes only with --go.
# NEVER touches: the two final models (stage1_final, stage2_final), the token data (bin/, stage2/),
# the held-out sets, the code, or anything outside /fsx/ajay-stu/ar-data.
# Usage: ./cleanup.sh (dry run, shows sizes)
# ./cleanup.sh --go (actually delete)
set -uo pipefail
D=${D:-/fsx/ajay-stu/ar-data}
GO=${1:-}
KEEP1=ckpt_571999 # final Stage 1 (also kept in stage1_final)
KEEP2=ckpt_619699 # final Stage 2 (also kept in stage2_final)
# refuse to delete while training is running
if squeue -u "${USER:-$(id -un)}" -h -n ar-real 2>/dev/null | grep -q .; then
echo "STOP: a training job is still running"; exit 1
fi
# build the list: training checkpoints except the two finals, and eval exports
targets=()
for p in "$D"/checkpoints/ckpt_*; do
b=$(basename "$p")
[ -d "$p" ] && [ "$b" != "$KEEP1" ] && [ "$b" != "$KEEP2" ] && targets+=("$p")
done
for p in "$D"/eval/*.pt; do [ -f "$p" ] && targets+=("$p"); done
if [ ${#targets[@]} -eq 0 ]; then
echo "nothing to clean"; df -h /fsx | tail -1; exit 0
fi
# show each item with its real disk use (hard-linked copies count as 0 here)
echo "would remove:"
du -shc --apparent-size "${targets[@]}" 2>/dev/null | tail -1 | sed 's/^/ apparent total: /'
for p in "${targets[@]}"; do printf " %-8s %s\n" "$(du -sh "$p" 2>/dev/null | cut -f1)" "$p"; done
echo "keeping: $D/stage1_final $D/stage2_final $D/bin $D/stage2 $D/heldout"
if [ "$GO" != "--go" ]; then
echo; echo "DRY RUN - nothing deleted. Run './cleanup.sh --go' to delete."; exit 0
fi
# safety: the two final models must exist before anything is removed
for f in "$D/stage1_final/model_stage1_final.pt" "$D/stage2_final/model_stage2_final.pt" \
"$D/stage1_final/$KEEP1/.metadata" "$D/stage2_final/$KEEP2/.metadata"; do
[ -e "$f" ] || { echo "STOP: $f is missing - nothing deleted"; exit 1; }
done
echo "final models verified"
for p in "${targets[@]}"; do rm -rf "$p" && echo "removed $p"; done
df -h /fsx | tail -1
|