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
|
@@ -87,6 +87,30 @@ Aggregated across four safety dimensions (**Safety-4**):
|
|
| 87 |
| Jailbreak Resistance | 0.72 |
|
| 88 |
| **Safety-4 Macro (avg)** | **0.75** |
|
| 89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
---
|
| 92 |
|
|
|
|
| 87 |
| Jailbreak Resistance | 0.72 |
|
| 88 |
| **Safety-4 Macro (avg)** | **0.75** |
|
| 89 |
|
| 90 |
+
---
|
| 91 |
+
# Terms of Use
|
| 92 |
+
|
| 93 |
+
This model is released strictly for **research and educational purposes**.
|
| 94 |
+
By downloading, using, or interacting with this model, you agree to the following conditions:
|
| 95 |
+
|
| 96 |
+
1. **Research Only**
|
| 97 |
+
The model is provided as part of an academic and research project.
|
| 98 |
+
It is **not intended for commercial deployment** or production use without explicit permission.
|
| 99 |
+
|
| 100 |
+
2. **Prohibited Uses**
|
| 101 |
+
You may **not** use this model:
|
| 102 |
+
- For any **illegal, unlawful, or harmful activities**, including but not limited to generating or disseminating malicious content, engaging in fraud, violating privacy, or spreading misinformation.
|
| 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** of any kind.
|
| 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 |
|