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 tokenizer_config.json with huggingface_hub
Verified signature39950d3 -
Upload config.json with huggingface_hub
Verified signature3ba0bf7 -
Rename table of tables - k2.png to k2_table_of_tables.png
Verified signature54ffd68 -
Upload table of tables - k2.png
Verified signature210b522 -
Delete k2_table_of_tables.png
Verified signature801886e -
Rename table of tables - k2.png to k2_table_of_tables.png
Verified signatureb733a31 -
Upload table of tables - k2.png
Verified signaturea5fb388 -
Delete k2_table_of_tables.png
Verified signature7e19781 -
Delete pytorch_model.bin.index.json with huggingface_hub
Verified signature82eb12f -
Delete pytorch_model-00001-of-00027.bin with huggingface_hub
Verified signature671ca45 -
Delete pytorch_model-00027-of-00027.bin with huggingface_hub
Verified signature3d7dc96 -
Delete pytorch_model-00026-of-00027.bin with huggingface_hub
Verified signaturebdf0065 -
Delete pytorch_model-00025-of-00027.bin with huggingface_hub
Verified signature1ab171d -
Delete pytorch_model-00024-of-00027.bin with huggingface_hub
Verified signature4ede504 -
Delete pytorch_model-00023-of-00027.bin with huggingface_hub
Verified signaturef0685ea -
Delete pytorch_model-00022-of-00027.bin with huggingface_hub
Verified signaturee3b9ff2 -
Delete pytorch_model-00021-of-00027.bin with huggingface_hub
Verified signature03f8b40 -
Delete pytorch_model-00020-of-00027.bin with huggingface_hub
Verified signaturee30c087 -
Delete pytorch_model-00019-of-00027.bin with huggingface_hub
Verified signature96ef37a -
Delete pytorch_model-00018-of-00027.bin with huggingface_hub
Verified signatureaa9fa64 -
Delete pytorch_model-00017-of-00027.bin with huggingface_hub
Verified signatured530ca2 -
Delete pytorch_model-00016-of-00027.bin with huggingface_hub
Verified signature0dfe988 -
Delete pytorch_model-00015-of-00027.bin with huggingface_hub
Verified signature3d08fcc -
Delete pytorch_model-00014-of-00027.bin with huggingface_hub
Verified signature9afe8cb -
Delete pytorch_model-00013-of-00027.bin with huggingface_hub
Verified signaturea2b74b8 -
Delete pytorch_model-00012-of-00027.bin with huggingface_hub
Verified signature8f0f6c0 -
Delete pytorch_model-00011-of-00027.bin with huggingface_hub
Verified signature777a5e5 -
Delete pytorch_model-00010-of-00027.bin with huggingface_hub
Verified signature643320e -
Delete pytorch_model-00009-of-00027.bin with huggingface_hub
Verified signature42cf380 -
Delete pytorch_model-00008-of-00027.bin with huggingface_hub
Verified signature2a413bd -
Delete pytorch_model-00007-of-00027.bin with huggingface_hub
Verified signature3ea20fa -
Delete pytorch_model-00006-of-00027.bin with huggingface_hub
Verified signaturef02af79 -
Delete pytorch_model-00005-of-00027.bin with huggingface_hub
Verified signaturec954923 -
Delete pytorch_model-00004-of-00027.bin with huggingface_hub
Verified signature9e32c84 -
Delete pytorch_model-00003-of-00027.bin with huggingface_hub
Verified signaturea712905 -
Delete pytorch_model-00002-of-00027.bin with huggingface_hub
Verified signature3d083cd -
Delete folder models--LLM360--K2 with huggingface_hub
Verified signature9d855e0 -
Update README.md
Verified signaturea918de5 -
Rename Screen Shot 2024-05-28 at 10.46.53 AM.png to k2_eval_table.png
Verified signature13b24f1 -
Upload Screen Shot 2024-05-28 at 10.46.53 AM.png
Verified signature735415a -
Delete k2_eval_table.png
Verified signaturee91d78e -
Upload folder using huggingface_hub
Verified signature97629d2 -
Update README.md
Verified signature99b19ab -
Update README.md
Verified signature26acde1 -
Upload folder using huggingface_hub
Verified signatureccd3ced
-
Update README.md
Verified signaturea3880e9 -
Update README.md
Verified signature857ca0b -
Update README.md
Verified signature766544a -
Rename Screen Shot 2024-05-25 at 1.15.28 PM.png to k2_table_of_tables.png
Verified signatured5e75d5 -
Upload Screen Shot 2024-05-25 at 1.15.28 PM.png
Verified signature85d588e