Instructions to use dnakov/nanochat-d20 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dnakov/nanochat-d20 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dnakov/nanochat-d20")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dnakov/nanochat-d20") model = AutoModelForCausalLM.from_pretrained("dnakov/nanochat-d20", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dnakov/nanochat-d20 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dnakov/nanochat-d20" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dnakov/nanochat-d20", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dnakov/nanochat-d20
- SGLang
How to use dnakov/nanochat-d20 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 "dnakov/nanochat-d20" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dnakov/nanochat-d20", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "dnakov/nanochat-d20" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dnakov/nanochat-d20", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dnakov/nanochat-d20 with Docker Model Runner:
docker model run hf.co/dnakov/nanochat-d20
Download tiktoken/tokenizer.model from dnakov/nanochat-d20: direct link, hf CLI and curl.
- Browser
- Download file 1.14 MB
-
https://huggingface.co/dnakov/nanochat-d20/resolve/main/tiktoken/tokenizer.model
- Command line
-
hf download hf://dnakov/nanochat-d20/tiktoken/tokenizer.model
-
curl -L -o tokenizer.model https://huggingface.co/dnakov/nanochat-d20/resolve/main/tiktoken/tokenizer.model
1.14 MB
- Size of remote file:
- 1.14 MB
- SHA256:
- 22b70a034f8864b798f8349672ee348cbc519406fc71af52ee54f0eb83b1eece
·
Git Large File Storage (LFS) replaces large files with text pointers inside Git, while storing the file contents on a remote server. More info.