Instructions to use 01-ai/Yi-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 01-ai/Yi-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="01-ai/Yi-9B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("01-ai/Yi-9B") model = AutoModelForCausalLM.from_pretrained("01-ai/Yi-9B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use 01-ai/Yi-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "01-ai/Yi-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "01-ai/Yi-9B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/01-ai/Yi-9B
- SGLang
How to use 01-ai/Yi-9B 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 "01-ai/Yi-9B" \ --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": "01-ai/Yi-9B", "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 "01-ai/Yi-9B" \ --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": "01-ai/Yi-9B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use 01-ai/Yi-9B with Docker Model Runner:
docker model run hf.co/01-ai/Yi-9B
Commit History
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/c86f355fefb0b3965e7b29dc4265c1fe7eb28662
yi-01-ai7b7ca5c
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/d4f0881d328643d1d3e85b52f9de4efce40a3895
yi-01-aie38a809
-
Expose metadata link to next version of the model : 01-ai/Yi-1.5-9B (#13)
Verified signature- Expose metadata link to next version of the model : 01-ai/Yi-1.5-9B (d5141bce87c70151d4b10c3a1b61a3b9a8d606dc) Co-authored-by: Daniel van Strien <davanstrien@users.noreply.huggingface.co>ba0bb9c
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/09d246c97195ac87a40d0be35be48cb632e694ea
yi-01-ai373659a
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/50bf141201486a3d3833dce66c07ab1933c196f9
yi-01-aidf7ce34
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/11d140d641d18e1190caad2d5170da3b76c9e4f6
yi-01-ai55e0efc
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/3fceb848f1b996978b5ee718492031ad7576fea5
yi-01-aib4a466d
-
Upload tokenizer.json
Verified signatured78d709
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/7590b4438733986ef3d410e5b0a3241e430c19ac
yi-01-aie2a96db -
Auto Sync from git://github.com/01-ai/Yi.git/commit/9038a0a485b3e82ff841cc1bbb9d84f7b75fa421
yi-01-ai31e8026
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/424329fdcf69b091cde1891dc2424b206f3573b3
yi-01-aifc6aea8
-
Update README.md
Verified signatured34eca4
-
Update README.md
Verified signature5e676ad -
Update README.md
Chen ChongyuVerified signature0680181 -
Update README.md
Chen ChongyuVerified signaturec83ce38
-
Update README.md
Chen ChongyuVerified signature95b8e27
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/845a0ffb37528402199c68687ecbbfb675b039df
yi-01-ai2af40f9
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/517b411e18f4070c56c6ef43a9dc977a709d3b26
yi-01-aic39d8be
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/d89f53c4ca23bbaa062ebe1ab7f2aeff54db8aee
yi-01-aia40e066 -
Auto Sync from git://github.com/01-ai/Yi.git/commit/87ab46f0f3e054c7d161ece1492c77a1789d8b8a
yi-01-ai110d388
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/25f046b33748f9ad4a49c227307dcaffee39af34
yi-01-ai665977a
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/731b2af8583cba38d6544ebf909d7c85545f75a8
yi-01-aid898363
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/b10bf347b810b6ab1a7e73a7e1a1223c757e7326
yi-01-aidd2c85d
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/5ed73fe931e7b95ad6dbd4d8091cd21b199d9bbb
yi-01-aia06d5c1
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/e3e47d27d65641181e2aeb600304181dd2a7230a
yi-01-ai6bebd1c
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/704d5c148e087e9d1c83fb51e02790b197ce1aba
yi-01-aib1064b0
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/c3a9089c9b1cb42de485c1f7e6b36b50fa5763fe
yi-01-ai58cdd0b -
Auto Sync from git://github.com/01-ai/Yi.git/commit/5e1c29a4f2224ca3ba1043347324d9b94f9737f6
yi-01-ai2058f59
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/b5d6c602a213bb9fd4832b188d1457a7da77a09c
yi-01-aif49bef6
-
Update README.md (#7)
Verified signature- Update README.md (bbbe4ceabb3fe4620ac77150936b5330d8067b98) Co-authored-by: Gloria Lee <Gloria12@users.noreply.huggingface.co>f70a5ff -
Auto Sync from git://github.com/01-ai/Yi.git/commit/57b9e9f4e777740875aae331382d394997a97513
yi-01-aib4de3b7 -
Auto Sync from git://github.com/01-ai/Yi.git/commit/b4528f877b729e2d976e711e35a21a8d112019d4
yi-01-ai97f0efe
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/6161f43679e3887a500a4f00aec3cb3090e3a23a
yi-01-aie79bc3a -
Auto Sync from git://github.com/01-ai/Yi.git/commit/7acc118e8ab00dbf223af5549efdf0e3ef972701
yi-01-ai94438cc
-
Auto Sync from git://github.com/01-ai/Yi.git/commit/81dbb7886c95ed0754a6b62805e8fa7bc7db60d8
yi-01-ai6868e97 -
Auto Sync from git://github.com/01-ai/Yi.git/commit/6da0100d379e4446978ab09f10fd58c6cbdc452d
yi-01-ai22e89cf -
rm useless in config.json
cfc0db4 -
Auto Sync from git://github.com/01-ai/Yi.git/commit/971fab7959bbae9113729c5d77f10c3d8dc1e00c
yi-01-ai68adb3e -
Auto Sync from git://github.com/01-ai/Yi.git/commit/f87f24d85edf92b0126e1fc53d5c0cb093801ca9
yi-01-ai8fff5fa -
Auto Sync from git://github.com/01-ai/Yi.git/commit/e994bf8a0c08dd9a9e90f2124a181a696969b578
yi-01-ai438bdf6
-
update weights
71e893a
-
add model weight
7d5b494 -
initial commit
Verified signature2e0091e