Text Generation
Transformers
Safetensors
English
qwen3_5
image-text-to-text
code
tool-output
pruning
coding-agents
extraction
conversational
Instructions to use KRLabsOrg/squeez-2b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KRLabsOrg/squeez-2b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KRLabsOrg/squeez-2b") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("KRLabsOrg/squeez-2b") model = AutoModelForImageTextToText.from_pretrained("KRLabsOrg/squeez-2b") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use KRLabsOrg/squeez-2b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KRLabsOrg/squeez-2b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KRLabsOrg/squeez-2b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/KRLabsOrg/squeez-2b
- SGLang
How to use KRLabsOrg/squeez-2b 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 "KRLabsOrg/squeez-2b" \ --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": "KRLabsOrg/squeez-2b", "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 "KRLabsOrg/squeez-2b" \ --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": "KRLabsOrg/squeez-2b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use KRLabsOrg/squeez-2b with Docker Model Runner:
docker model run hf.co/KRLabsOrg/squeez-2b
Add library_name to metadata
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,17 +1,18 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
| 3 |
language:
|
| 4 |
- en
|
|
|
|
|
|
|
|
|
|
| 5 |
tags:
|
| 6 |
- code
|
| 7 |
- tool-output
|
| 8 |
- pruning
|
| 9 |
- coding-agents
|
| 10 |
- extraction
|
| 11 |
-
datasets:
|
| 12 |
-
- KRLabsOrg/tool-output-extraction-swebench
|
| 13 |
-
base_model: Qwen/Qwen3.5-2B
|
| 14 |
-
pipeline_tag: text-generation
|
| 15 |
thumbnail: https://raw.githubusercontent.com/KRLabsOrg/squeez/main/assets/squeez_mascot.png
|
| 16 |
---
|
| 17 |
|
|
@@ -115,11 +116,18 @@ messages = [
|
|
| 115 |
"Do not rewrite, summarize, or invent lines."
|
| 116 |
)},
|
| 117 |
{"role": "user", "content": (
|
| 118 |
-
"<query>
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
"</tool_output>"
|
| 124 |
)},
|
| 125 |
]
|
|
@@ -141,7 +149,8 @@ print(response)
|
|
| 141 |
|
| 142 |
**Input** — Chat messages with system prompt:
|
| 143 |
- System: extraction instructions (see above)
|
| 144 |
-
- User: `<query>{task}</query>
|
|
|
|
| 145 |
|
| 146 |
**Output** — Verbatim lines in XML tags:
|
| 147 |
```
|
|
@@ -205,4 +214,4 @@ Apache 2.0
|
|
| 205 |
primaryClass={cs.SE},
|
| 206 |
url={https://arxiv.org/abs/2604.04979},
|
| 207 |
}
|
| 208 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: Qwen/Qwen3.5-2B
|
| 3 |
+
datasets:
|
| 4 |
+
- KRLabsOrg/tool-output-extraction-swebench
|
| 5 |
language:
|
| 6 |
- en
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
+
library_name: transformers
|
| 10 |
tags:
|
| 11 |
- code
|
| 12 |
- tool-output
|
| 13 |
- pruning
|
| 14 |
- coding-agents
|
| 15 |
- extraction
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
thumbnail: https://raw.githubusercontent.com/KRLabsOrg/squeez/main/assets/squeez_mascot.png
|
| 17 |
---
|
| 18 |
|
|
|
|
| 116 |
"Do not rewrite, summarize, or invent lines."
|
| 117 |
)},
|
| 118 |
{"role": "user", "content": (
|
| 119 |
+
"<query>
|
| 120 |
+
Find the failing authentication test
|
| 121 |
+
</query>
|
| 122 |
+
"
|
| 123 |
+
"<tool_output>
|
| 124 |
+
"
|
| 125 |
+
"PASSED tests/test_login.py::test_valid_credentials
|
| 126 |
+
"
|
| 127 |
+
"FAILED tests/test_login.py::test_token_refresh - AssertionError: expected 200 got 401
|
| 128 |
+
"
|
| 129 |
+
"PASSED tests/test_login.py::test_logout
|
| 130 |
+
"
|
| 131 |
"</tool_output>"
|
| 132 |
)},
|
| 133 |
]
|
|
|
|
| 149 |
|
| 150 |
**Input** — Chat messages with system prompt:
|
| 151 |
- System: extraction instructions (see above)
|
| 152 |
+
- User: `<query>{task}</query>
|
| 153 |
+
<tool_output>{raw_output}</tool_output>`
|
| 154 |
|
| 155 |
**Output** — Verbatim lines in XML tags:
|
| 156 |
```
|
|
|
|
| 214 |
primaryClass={cs.SE},
|
| 215 |
url={https://arxiv.org/abs/2604.04979},
|
| 216 |
}
|
| 217 |
+
```
|