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
-
Upload config.json with huggingface_hub
Verified signature4fea139 -
Upload config.json with huggingface_hub
Verified signature04ff36c -
Upload config.json with huggingface_hub
Verified signature2b7b441 -
Upload config.json with huggingface_hub
Verified signatureb201a74 -
Upload config.json with huggingface_hub
Verified signaturedc0a5fb -
Upload config.json with huggingface_hub
Verified signature2da5274 -
Upload config.json with huggingface_hub
Verified signaturec865bf3 -
Upload config.json with huggingface_hub
Verified signature543d7a1 -
Upload config.json with huggingface_hub
Verified signatured9263ad -
Upload config.json with huggingface_hub
Verified signature8e88a8b -
Upload config.json with huggingface_hub
Verified signature7ce17cc -
Upload config.json with huggingface_hub
Verified signatured06b4de -
Upload config.json with huggingface_hub
Verified signature93d14da -
Upload config.json with huggingface_hub
Verified signatured50cf26 -
Upload config.json with huggingface_hub
Verified signaturecf1a5cb -
Upload config.json with huggingface_hub
Verified signatureba79f4e -
Upload config.json with huggingface_hub
Verified signaturee3abb0b -
Upload config.json with huggingface_hub
Verified signature56022f2 -
Upload config.json with huggingface_hub
Verified signature306a610 -
Upload config.json with huggingface_hub
Verified signature995d5ad -
Upload config.json with huggingface_hub
Verified signatureb2585db -
Upload config.json with huggingface_hub
Verified signature6aac323 -
Upload config.json with huggingface_hub
Verified signaturea8dc661 -
Upload config.json with huggingface_hub
Verified signature967751f -
Upload config.json with huggingface_hub
Verified signature2c413da -
Upload config.json with huggingface_hub
Verified signaturef77f7cc -
Upload config.json with huggingface_hub
Verified signaturec858717 -
Upload config.json with huggingface_hub
Verified signature74b27ec -
Upload config.json with huggingface_hub
Verified signaturee31f997 -
Upload config.json with huggingface_hub
Verified signature258b8af -
Upload config.json with huggingface_hub
Verified signature2a1dbdd -
Upload config.json with huggingface_hub
Verified signaturedf4fec5 -
Upload config.json with huggingface_hub
Verified signature8ecf9f6 -
Upload config.json with huggingface_hub
Verified signature71f8073 -
Upload config.json with huggingface_hub
Verified signaturec5fd617 -
Upload config.json with huggingface_hub
Verified signatureb826fab
-
Rename k2-evals-tweet-2.png to k2_table_of_tables.png
Verified signature6bd9398 -
Upload k2-evals-tweet-2.png
Verified signature766443b -
Delete k2_table_of_tables.png
Verified signature164d086 -
Update README.md
Verified signaturec6096a9 -
Update README.md
Verified signaturebc98f54 -
Update README.md
Verified signature1a82a23 -
Update README.md
Verified signature452b014 -
Update README.md
Verified signaturee0ff8da -
Update README.md
Verified signature9d36b85 -
Rename k2_table_of_table.png to k2_table_of_tables.png
Verified signatureb664e7f -
Upload k2_table_of_table.png
Verified signaturee028d9d -
Delete k2_table_of_tables.png
Verified signatured2a84b7 -
Update README.md
Verified signature5e0fd38
-
Update README.md
Verified signature8aec4ce