Text Generation
Transformers
Safetensors
GGUF
qwen3
code
luau
roblox
lua
web
ui
react
tailwind
reasoning
conversational
text-generation-inference
Instructions to use KSTRLAI/Colossus-2.2-Code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KSTRLAI/Colossus-2.2-Code with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KSTRLAI/Colossus-2.2-Code") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("KSTRLAI/Colossus-2.2-Code") model = AutoModelForCausalLM.from_pretrained("KSTRLAI/Colossus-2.2-Code", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use KSTRLAI/Colossus-2.2-Code with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf KSTRLAI/Colossus-2.2-Code:Q4_K_M # Run inference directly in the terminal: llama cli -hf KSTRLAI/Colossus-2.2-Code:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf KSTRLAI/Colossus-2.2-Code:Q4_K_M # Run inference directly in the terminal: llama cli -hf KSTRLAI/Colossus-2.2-Code:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf KSTRLAI/Colossus-2.2-Code:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf KSTRLAI/Colossus-2.2-Code:Q4_K_M
Use Docker
docker model run hf.co/KSTRLAI/Colossus-2.2-Code:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use KSTRLAI/Colossus-2.2-Code with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KSTRLAI/Colossus-2.2-Code" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KSTRLAI/Colossus-2.2-Code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/KSTRLAI/Colossus-2.2-Code:Q4_K_M
- SGLang
How to use KSTRLAI/Colossus-2.2-Code 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 "KSTRLAI/Colossus-2.2-Code" \ --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": "KSTRLAI/Colossus-2.2-Code", "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 "KSTRLAI/Colossus-2.2-Code" \ --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": "KSTRLAI/Colossus-2.2-Code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use KSTRLAI/Colossus-2.2-Code with Ollama:
ollama run hf.co/KSTRLAI/Colossus-2.2-Code:Q4_K_M
- Unsloth Desktop
- Pi
How to use KSTRLAI/Colossus-2.2-Code with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KSTRLAI/Colossus-2.2-Code:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "KSTRLAI/Colossus-2.2-Code:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use KSTRLAI/Colossus-2.2-Code with Docker Model Runner:
docker model run hf.co/KSTRLAI/Colossus-2.2-Code:Q4_K_M
- Lemonade
How to use KSTRLAI/Colossus-2.2-Code with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull KSTRLAI/Colossus-2.2-Code:Q4_K_M
Run and chat with the model
lemonade run user.Colossus-2.2-Code-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use KSTRLAI/Colossus-2.2-Code with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KSTRLAI/Colossus-2.2-Code:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default KSTRLAI/Colossus-2.2-Code:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use KSTRLAI/Colossus-2.2-Code with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KSTRLAI/Colossus-2.2-Code:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "KSTRLAI/Colossus-2.2-Code:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Improve model card
Browse files
README.md
CHANGED
|
@@ -1,27 +1,131 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
tags:
|
| 6 |
-
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
-
|
| 13 |
-
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- code
|
| 7 |
+
- luau
|
| 8 |
+
- roblox
|
| 9 |
+
- lua
|
| 10 |
+
- web
|
| 11 |
+
- ui
|
| 12 |
+
- react
|
| 13 |
+
- tailwind
|
| 14 |
+
- reasoning
|
| 15 |
+
- gguf
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# Colossus 2.2 Code
|
| 19 |
+
|
| 20 |
+
Colossus 2.2 Code is a concise, direct coding assistant. It is especially strong at Roblox Luau — scripts, ModuleScripts, GUIs, DataStores, networking, Fusion, and React-Lua — and at building web UI with HTML, CSS, JavaScript, React, and Tailwind. It also writes code in many other languages. On harder problems it thinks step by step inside a `<think>` block before answering; simple messages get a direct reply. It is made by KSTRL.
|
| 21 |
+
|
| 22 |
+
## Identity
|
| 23 |
+
|
| 24 |
+
The model gives its name (Colossus) only when asked. It says it was made by KSTRL only when asked who made it.
|
| 25 |
+
|
| 26 |
+
## Files
|
| 27 |
+
|
| 28 |
+
| Path | Type | Size | Notes |
|
| 29 |
+
| --- | --- | --- | --- |
|
| 30 |
+
| `model-00001-of-00002.safetensors`, `model-00002-of-00002.safetensors` | Merged 16-bit (bf16) | 8.0 GB | Transformers weights in the repo root |
|
| 31 |
+
| `Colossus-2.2-Code-Q4_K_M.gguf` | GGUF Q4_K_M | 2.5 GB | Faster local use |
|
| 32 |
+
| `Colossus-2.2-Code-Q8_0.gguf` | GGUF Q8_0 | 4.3 GB | Higher-fidelity local use |
|
| 33 |
+
| `tokenizer.json`, `tokenizer_config.json`, `chat_template.jinja` | Tokenizer and chat template | — | Use these with the 16-bit weights |
|
| 34 |
+
|
| 35 |
+
## Recommended hardware
|
| 36 |
+
|
| 37 |
+
- **Q4_K_M (2.5 GB)** fits comfortably on an 8 GB GPU, with room for a useful context window.
|
| 38 |
+
- **Q8_0 (4.3 GB)** also fits on an 8 GB GPU.
|
| 39 |
+
- **16-bit (8.0 GB)** is tight on 8 GB of VRAM. Short prompts may work; longer context usually needs offload or more memory.
|
| 40 |
+
|
| 41 |
+
Use a context window of 16K or more when you are working with long files. The model config allows up to 262,144 tokens if you have the memory.
|
| 42 |
+
|
| 43 |
+
## Chat format
|
| 44 |
+
|
| 45 |
+
Use the chat template that ships with the model. Messages use the usual `system`, `user`, and `assistant` roles. In Transformers, call `tokenizer.apply_chat_template(...)`. In llama.cpp, pass `--jinja` so the bundled template is applied and thinking can be shown separately from the final answer.
|
| 46 |
+
|
| 47 |
+
When the model reasons, the reply may include a `<think> ... </think>` block followed by the answer.
|
| 48 |
+
|
| 49 |
+
## Usage
|
| 50 |
+
|
| 51 |
+
### Transformers
|
| 52 |
+
|
| 53 |
+
```python
|
| 54 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 55 |
+
|
| 56 |
+
repo = "KSTRLAI/Colossus-2.2-Code"
|
| 57 |
+
tokenizer = AutoTokenizer.from_pretrained(repo)
|
| 58 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 59 |
+
repo,
|
| 60 |
+
torch_dtype="auto",
|
| 61 |
+
device_map="auto",
|
| 62 |
+
)
|
| 63 |
+
|
| 64 |
+
messages = [
|
| 65 |
+
{"role": "user", "content": "Write a Roblox ModuleScript that caches DataStore reads with a short TTL."},
|
| 66 |
+
]
|
| 67 |
+
inputs = tokenizer.apply_chat_template(
|
| 68 |
+
messages,
|
| 69 |
+
add_generation_prompt=True,
|
| 70 |
+
tokenize=True,
|
| 71 |
+
return_dict=True,
|
| 72 |
+
return_tensors="pt",
|
| 73 |
+
)
|
| 74 |
+
inputs = {k: v.to(model.device) for k, v in inputs.items()}
|
| 75 |
+
|
| 76 |
+
output = model.generate(
|
| 77 |
+
**inputs,
|
| 78 |
+
max_new_tokens=2048,
|
| 79 |
+
temperature=0.3,
|
| 80 |
+
top_p=0.95,
|
| 81 |
+
)
|
| 82 |
+
print(tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
Temperature `0.6` and `top_p` `0.95` work well in general. For code, a lower temperature such as `0.3` usually gives more consistent results.
|
| 86 |
+
|
| 87 |
+
### llama.cpp
|
| 88 |
+
|
| 89 |
+
```bash
|
| 90 |
+
hf download KSTRLAI/Colossus-2.2-Code --include "*.gguf" --local-dir Colossus-2.2-Code
|
| 91 |
+
|
| 92 |
+
llama-cli \
|
| 93 |
+
-m Colossus-2.2-Code/Colossus-2.2-Code-Q4_K_M.gguf \
|
| 94 |
+
--jinja -ngl 99 -c 16384 \
|
| 95 |
+
--temp 0.3 --top-p 0.95 \
|
| 96 |
+
-p "Write a React component that renders a responsive navbar with Tailwind."
|
| 97 |
+
|
| 98 |
+
llama-server \
|
| 99 |
+
-m Colossus-2.2-Code/Colossus-2.2-Code-Q4_K_M.gguf \
|
| 100 |
+
--jinja -ngl 99 -c 16384
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
### Ollama
|
| 104 |
+
|
| 105 |
+
Create a `Modelfile`:
|
| 106 |
+
|
| 107 |
+
```
|
| 108 |
+
FROM ./Colossus-2.2-Code-Q4_K_M.gguf
|
| 109 |
+
PARAMETER num_ctx 16384
|
| 110 |
+
PARAMETER temperature 0.3
|
| 111 |
+
PARAMETER top_p 0.95
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
Then:
|
| 115 |
+
|
| 116 |
+
```bash
|
| 117 |
+
ollama create colossus-2.2-code -f Modelfile
|
| 118 |
+
ollama run colossus-2.2-code
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
### LM Studio
|
| 122 |
+
|
| 123 |
+
Download a GGUF from this repo into your LM Studio models folder and load it in the app. Set context length to at least 16K. Q4_K_M is the better starting point on 8 GB GPUs; switch to Q8_0 if you want higher fidelity and have the headroom.
|
| 124 |
+
|
| 125 |
+
## Limitations
|
| 126 |
+
|
| 127 |
+
Generated code can contain bugs, outdated APIs, or insecure patterns. Read and test everything before you ship it. The thinking block is a reasoning draft, not a guarantee of a correct solution.
|
| 128 |
+
|
| 129 |
+
## License
|
| 130 |
+
|
| 131 |
+
Apache License 2.0.
|