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/nodecheck.sh from AjayRangoji/AR-4B-base: direct link, hf CLI and curl.
- Browser
- Download file 908 Bytes
-
https://huggingface.co/AjayRangoji/AR-4B-base/resolve/main/training_code/nodecheck.sh
- Command line
-
hf download hf://AjayRangoji/AR-4B-base/training_code/nodecheck.sh
-
curl -L -o nodecheck.sh https://huggingface.co/AjayRangoji/AR-4B-base/resolve/main/training_code/nodecheck.sh
908 Bytes
| # One-line health report of THIS node (run inside a short Slurm job on that node). | |
| gpus=$(nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits 2>/dev/null | wc -l) | |
| gused=$(nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits 2>/dev/null | awk '{s+=$1} END {print s+0}') | |
| ram=$(free -g | awk '/Mem:/ {print $7}') | |
| swap=$(free -g | awk '/Swap:/ {print $3}') | |
| load=$(cut -d' ' -f1 /proc/loadavg) | |
| # real people (uid >= 1000) other than us with processes on this node | |
| others=$(ps -eo uid=,user= | awk '$1 >= 1000 && $1 != 65534 {print $2}' | sort -u | grep -vx ajay-stu | wc -l) | |
| # read 512 MB from /fsx at a random spot | |
| mbs=$(dd if=/fsx/ajay-stu/ar-data/bin/finemath.bin of=/dev/null bs=1M count=512 skip=$((RANDOM % 30000)) 2>&1 \ | |
| | awk '/copied/ {v=$(NF-1); if ($NF=="GB/s") v*=1000; print int(v)}') | |
| echo "$(hostname) $gpus $gused $ram ${swap:-0} $load $others ${mbs:-0}" | |