Instructions to use LLM360/K2-Think with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LLM360/K2-Think with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LLM360/K2-Think") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LLM360/K2-Think") model = AutoModelForCausalLM.from_pretrained("LLM360/K2-Think") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use LLM360/K2-Think with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LLM360/K2-Think" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LLM360/K2-Think", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LLM360/K2-Think
- SGLang
How to use LLM360/K2-Think 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 "LLM360/K2-Think" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LLM360/K2-Think", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "LLM360/K2-Think" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LLM360/K2-Think", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LLM360/K2-Think with Docker Model Runner:
docker model run hf.co/LLM360/K2-Think
Update README.md
Browse files
README.md
CHANGED
|
@@ -88,30 +88,20 @@ Aggregated across four safety dimensions (**Safety-4**):
|
|
| 88 |
| **Safety-4 Macro (avg)** | **0.75** |
|
| 89 |
|
| 90 |
---
|
|
|
|
| 91 |
# Terms of Use
|
| 92 |
|
| 93 |
-
|
| 94 |
-
By downloading, using, or interacting with this model, you agree to the following conditions:
|
| 95 |
|
| 96 |
-
1. **
|
| 97 |
-
|
| 98 |
-
It is **not intended for commercial deployment** or production use without explicit permission.
|
| 99 |
|
| 100 |
-
2. **
|
| 101 |
-
You
|
| 102 |
-
-
|
| 103 |
-
- In applications that could directly cause **harm, injury, or safety risks** to individuals or society.
|
| 104 |
|
| 105 |
3. **No Warranty**
|
| 106 |
-
The model is provided **“as is” without warranties
|
| 107 |
-
The authors and institutions involved bear no responsibility for consequences arising from its use.
|
| 108 |
-
|
| 109 |
-
4. **Attribution**
|
| 110 |
-
When using or referencing the model in research, publications, or derivative works, proper **citation and attribution** to the authors and project must be given.
|
| 111 |
-
|
| 112 |
-
5. **Compliance**
|
| 113 |
-
You are responsible for ensuring that your use of the model complies with all **applicable laws, regulations, and ethical guidelines** in your jurisdiction.
|
| 114 |
-
|
| 115 |
---
|
| 116 |
|
| 117 |
# Citation
|
|
|
|
| 88 |
| **Safety-4 Macro (avg)** | **0.75** |
|
| 89 |
|
| 90 |
---
|
| 91 |
+
|
| 92 |
# Terms of Use
|
| 93 |
|
| 94 |
+
We have employed various techniques to reduce bias, harmful outputs, and other risks in the model. While these efforts help improve safety and reliability, the model, like all Large Language Models, may still generate inaccurate, misleading, biased, or otherwise undesirable content. By downloading, using, or interacting with this model, you acknowledge these limitations and agree to the following:
|
|
|
|
| 95 |
|
| 96 |
+
1. **Prohibited Uses**
|
| 97 |
+
- You may **not** use this model for any **illegal, unlawful, or harmful activities**, including but not limited to fraud, abuse, harassment, privacy violations, or the creation/dissemination of malicious content.
|
|
|
|
| 98 |
|
| 99 |
+
2. **User Responsibility**
|
| 100 |
+
- You are solely responsible for how you use the model and for any outcomes that result from its use.
|
| 101 |
+
- The authors and institutions involved in releasing this model do **not** accept liability for any consequences arising from its use.
|
|
|
|
| 102 |
|
| 103 |
3. **No Warranty**
|
| 104 |
+
- The model is provided **“as is” without any warranties or guarantees**.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
---
|
| 106 |
|
| 107 |
# Citation
|