Instructions to use IFM/K2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IFM/K2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IFM/K2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("IFM/K2") model = AutoModelForCausalLM.from_pretrained("IFM/K2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IFM/K2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IFM/K2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IFM/K2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/IFM/K2
- SGLang
How to use IFM/K2 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 "IFM/K2" \ --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": "IFM/K2", "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 "IFM/K2" \ --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": "IFM/K2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use IFM/K2 with Docker Model Runner:
docker model run hf.co/IFM/K2
Commit History
-
Update README.md
Verified signature400af6c
-
Update README.md
Verified signatureupdate author list4857ea8
-
Update config.json
Verified signatureef6007e
-
Fix broken bibtex (#3)
Verified signature- Fix broken bibtex (b281a12fef5c1cfc8d0443289428733ab5c85a32) Co-authored-by: Leshem Choshen <borgr@users.noreply.huggingface.co>c3e2f4f
-
Update README.md
Verified signature49d159b -
Update README.md
Verified signature56c74c5 -
Update README.md
Verified signature58cff80
-
Update config.json
Verified signature0afab42
-
Upload config.json with huggingface_hub
Verified signaturef083389 -
Upload config.json with huggingface_hub
Verified signature7b92dfd -
Upload config.json with huggingface_hub
Verified signature12289b8 -
Upload config.json with huggingface_hub
Verified signature67b5bd2 -
Upload config.json with huggingface_hub
Verified signaturef0ce822 -
Upload config.json with huggingface_hub
Verified signature9cb6f36 -
Upload config.json with huggingface_hub
Verified signature7d0afbb -
Upload config.json with huggingface_hub
Verified signatureb86d90e -
Upload config.json with huggingface_hub
Verified signature26d8b5c -
Upload config.json with huggingface_hub
Verified signaturee1ca4af -
Upload config.json with huggingface_hub
Verified signature2836801 -
Upload config.json with huggingface_hub
Verified signatureab2afdf -
Upload config.json with huggingface_hub
Verified signature23901c5 -
Upload config.json with huggingface_hub
Verified signaturecb21469 -
Upload config.json with huggingface_hub
Verified signature60f27a4 -
Upload config.json with huggingface_hub
Verified signature419b748 -
Upload config.json with huggingface_hub
Verified signatureb7c0611 -
Upload config.json with huggingface_hub
Verified signature0189857 -
Upload config.json with huggingface_hub
Verified signature55b17bc -
Upload config.json with huggingface_hub
Verified signaturee4b68df -
Upload config.json with huggingface_hub
Verified signaturef0b07b5 -
Upload config.json with huggingface_hub
Verified signatureeb29078 -
Upload config.json with huggingface_hub
Verified signature21a991c -
Upload config.json with huggingface_hub
Verified signature46cd9e7 -
Upload config.json with huggingface_hub
Verified signature8d948db -
Upload config.json with huggingface_hub
Verified signature719fd32 -
Upload config.json with huggingface_hub
Verified signature387797e -
Upload config.json with huggingface_hub
Verified signaturea586ea7 -
Upload config.json with huggingface_hub
Verified signature3021954 -
Upload config.json with huggingface_hub
Verified signature5f91f2b -
Upload config.json with huggingface_hub
Verified signatureb9bcdb1 -
Upload config.json with huggingface_hub
Verified signaturec34f669 -
Upload config.json with huggingface_hub
Verified signature9f53eb6 -
Upload config.json with huggingface_hub
Verified signaturec4ce561 -
Upload config.json with huggingface_hub
Verified signature0f05343 -
Upload config.json with huggingface_hub
Verified signature27b1bda -
Upload config.json with huggingface_hub
Verified signature31ba5e0 -
Upload config.json with huggingface_hub
Verified signature1214ec6 -
Upload config.json with huggingface_hub
Verified signature7206e96 -
Upload config.json with huggingface_hub
Verified signature33df3a4 -
Upload config.json with huggingface_hub
Verified signature10859d5 -
Upload config.json with huggingface_hub
Verified signature5fadaea