Image-Text-to-Text
Transformers
Safetensors
English
Chinese
qwen3_5
qwen3.5
decision-model
structured-prediction
text-classification
conversational
Instructions to use PelaAI/KnowLine-9B-Gen2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PelaAI/KnowLine-9B-Gen2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="PelaAI/KnowLine-9B-Gen2") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("PelaAI/KnowLine-9B-Gen2") model = AutoModelForMultimodalLM.from_pretrained("PelaAI/KnowLine-9B-Gen2", device_map="auto") 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PelaAI/KnowLine-9B-Gen2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PelaAI/KnowLine-9B-Gen2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PelaAI/KnowLine-9B-Gen2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/PelaAI/KnowLine-9B-Gen2
- SGLang
How to use PelaAI/KnowLine-9B-Gen2 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 "PelaAI/KnowLine-9B-Gen2" \ --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": "PelaAI/KnowLine-9B-Gen2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "PelaAI/KnowLine-9B-Gen2" \ --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": "PelaAI/KnowLine-9B-Gen2", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use PelaAI/KnowLine-9B-Gen2 with Docker Model Runner:
docker model run hf.co/PelaAI/KnowLine-9B-Gen2
File size: 3,931 Bytes
e285bd4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | # KnowLine-9B-Gen2: inference and Decision Index reproduction
## Model and readout
- Base model: [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B).
- bf16 weights, approximately 19.3 GB.
- Readout temperature T = 1.63 is folded into the final language-model norm.
- The front-end temperature is 1. `temperatures.json` supplies `{"score": 0.6135}`, so score questions use an effective temperature of approximately 1.0; choice and yes/no questions retain T = 1.63.
- Each question is scored in one prefill by reading option-label probabilities, with no generated reasoning.
- Text-only requests whose one-pass length is at most 3,000 tokens are read twice. Longer requests and image requests are read once. Question headers and referenced-fields layout are disabled.
- Limits: 64 questions per request and 255 options per question. Requests are not truncated.
## Software
The evaluation used SGLang 0.5.21, Transformers 5.12.1, Torch 2.13.0 and requests 2.34.2.
Keep `serve_knowline.sh`, `knowline_server.py`, `knowline_layout.py`, `knowline_engine.py` and `temperatures.json` together in the model directory.
## Start the server
From the downloaded model directory:
```bash
pip install "sglang==0.5.21" "transformers==5.12.1" "requests==2.34.2"
sha256sum -c SHA256SUMS
MEM=0.90 bash serve_knowline.sh . 0 8080
```
The launcher starts a bf16 SGLang server on port 9080 and the `/v1/systemone` front end on port 8080. It uses one GPU, tensor parallel size 1, an fp32 LM head, 16 front-end workers and the model's `temperatures.json`. The box prompt and coordinate settings are `locate / xyxy`. The SGLang launcher also uses `--mamba-radix-cache-strategy extra_buffer`.
`MEM=0.90` matches the full public evaluation. Without an override, the launcher defaults to 0.85. `HOST` defaults to `127.0.0.1`.
```bash
curl -s http://127.0.0.1:8080/v1/systemone -H 'Content-Type: application/json' -d '{
"model": "m",
"state": "Customer: my order arrived broken, I want my money back.",
"questions": {"refund": {"type": "noul", "instructions": "Should the agent offer a refund?"}}
}'
```
## Reproduce the public evaluation
The official Decision Index kit is pinned to `62d2f51de34a2de64906345b6bc3e98e27ff55c7`. Rebuild the public 0.3 suite locally following the [kit instructions](https://github.com/apolinario/decision-index#quickstart-local); the benchmark inputs are not distributed with this model.
With the model server running and the rebuilt `suite-0.3` directory available in the kit checkout:
```bash
git clone https://github.com/apolinario/decision-index
cd decision-index
git checkout 62d2f51de34a2de64906345b6bc3e98e27ff55c7
pip install -e .
python -m decision_index pipeline --edition 0.3 --engine http \
--option base_url=http://127.0.0.1:8080 --option model=m \
--out runs/KnowLine-9B-Gen2
```
The submitted run used two NVIDIA H20 96 GB GPUs, one identical server per GPU, with 16 round-robin client shards in total. It was a fresh full run with no results carried over from another model or run. Every request succeeded in the first pass; no retries were needed.
- Public index: **69.00**; raw index: **76.40**.
- Requests: 140,620; scoreable: 140,178 after the 442 official exclusions.
- All scoreable requests were answered; no errors or unsupported requests; `complete: true`.
- Runner SHA256: `f4c9f36c4c557f537f1d8184db7bf00c5a84d9f4f0aa67f8c06198cead25818d`.
- Results: [PelaAI/KnowLine-9B-Gen2-decision-index](https://huggingface.co/datasets/PelaAI/KnowLine-9B-Gen2-decision-index/tree/main/runs/KnowLine-9B-Gen2).
To re-score the downloaded results with the same suite:
```bash
python -m decision_index score --edition 0.3 \
--suite-dir suite-0.3 --results /path/to/results.jsonl.gz \
--engine http --out rescore
```
`SHA256SUMS` records the model package's file hashes. The public index is separate from the private Full score, which is run by the Decision Index maintainers.
|