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-Gen1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PelaAI/KnowLine-9B-Gen1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="PelaAI/KnowLine-9B-Gen1") 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-Gen1") model = AutoModelForMultimodalLM.from_pretrained("PelaAI/KnowLine-9B-Gen1", 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-Gen1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PelaAI/KnowLine-9B-Gen1" # 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-Gen1", "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-Gen1
- SGLang
How to use PelaAI/KnowLine-9B-Gen1 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-Gen1" \ --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-Gen1", "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-Gen1" \ --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-Gen1", "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-Gen1 with Docker Model Runner:
docker model run hf.co/PelaAI/KnowLine-9B-Gen1
File size: 5,246 Bytes
f214278 a421fc4 f214278 a421fc4 f214278 a421fc4 f214278 | 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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | ---
license: apache-2.0
library_name: transformers
base_model: Qwen/Qwen3.5-9B
base_model_relation: finetune
pipeline_tag: image-text-to-text
language:
- en
- zh
tags:
- qwen3.5
- decision-model
- structured-prediction
- text-classification
- image-text-to-text
---
# KnowLine-9B-Gen1
KnowLine-9B-Gen1 是基于 Qwen3.5-9B 的 9B 决策模型。它接收结构化 state 和一个或多个类型化问题,返回给定选项上的概率。支持选择题、是/否题和有序评分题;决策读出阶段不生成自由文本推理。
这是合并后的 bf16 权重。视觉组件保持 Qwen3.5-9B 底座状态;本版本主要面向文本决策任务,9B Gen1 的训练混合中没有图像训练,图像能力应视为零样本结果。
## 能力
- 最多 255 个命名选项的选择题;
- 是/否题;
- 有序评分题;
- 读出温度已折入语言模型 norm;
- 短文本请求默认读两遍。
## 快速开始
安装兼容的 PyTorch/CUDA 环境和 SGLang,然后启动随包提供的前端:
```bash
bash serve_knowline.sh /path/to/KnowLine-9B-Gen1 0 8080
```
前端提供 `/v1/systemone` 接口。随包提供的 `knowline_server.py`、`knowline_engine.py` 和 `knowline_layout.py` 实现了评测使用的打分路径。默认前端对短文本请求读两遍,并直接读取选项标签的概率。
## Gen1 的制作方式
- 底座模型:[Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B)。
- 训练:LoRA 监督微调,一个 epoch,rank 32、alpha 64,只训练语言模型线性层,bf16。
- 训练数据:清洗后的 mixU Qwen3.5 决策数据,共 1,143,656 行渲染后的训练样本。
- 最大训练序列长度:12,288 token。
- 最终 checkpoint 是 9B-U 训练后的 WiSE 0.90 候选。
- 读出温度 `T=1.18` 已折入 `model.language_model.norm.weight`,详见 `CALIBRATION.json`。
训练数据不包含在本仓库中。本仓库包含 checkpoint、tokenizer、chat template、推理前端和校验和。
## 评测
### 完整公开 Decision Index 0.3
2026-10-25 使用发布权重与修正后的 bf16 前端实测,开启读两遍:
| 指标 | 结果 |
|---|---:|
| 公开 Decision Index | **65.67** |
| 公开 raw index | 73.88 |
| 请求数 / 可计分请求数 | 140,620 / 140,178 |
| 可计分请求成功 / 错误 / 不支持 | 140,178 / 0 / 0 |
| 单请求串行延迟,中位数 / 均值 | 96.7 / 207.7 ms |
完整套件新跑于两张H20,16个客户端分片。首轮两条HTTP 504传输错误在不改请求、权重和推理设置的情况下重试;没有按答案正确与否重试成功请求。官方评分排除442个请求,无输入截断。另用300个请求串行复测,与本模型自己的完整运行比较477个答案:476个相同,唯一差异是近似平局(两次margin为0.006和0.021)。这些是H20测量值,不是榜单硬件延迟或私有Full分。
### 先前内部候选比较
下表是FP8-at-load的子样本及代理指标,用于比较9B候选;不是完整公开运行或官方私有榜单分。
| 候选 | Decision Index 公开子样本 | S | O noproc | 预测榜单 Full | NDT5 headline |
|---|---:|---:|---:|---:|---:|
| KnowLine-9B-Gen1 WiSE 0.90 | 65.68 | 60.10 | 43.80 | **59.55** | 62.4 |
| kf9b 基线 | 67.88 | 60.84 | 40.80 | 58.52 | 59.3 |
预测榜单 Full 使用内部 9B 对比口径 `full_noproc + 1.0`。该候选低于当前 9B 榜单参考 elephant-1 的 60.26,不作为榜单领先模型宣传。
mix T 试点评测在六组配对口径开发集上都显示出稳定收益。这证明的是数据干预有效,不是榜单排名声明。
## 训练暴露说明
1,143,656行混合由873,134行or1d、241,781行or1d未包含的Kf样本、16,824行新增注入不变性样本和11,917行配对口径试点组成。包含公开基准的训练切分,以及程序和教师生成的决策样本。构建报告按DI格式口径统计为32.1%(其中1.2%是其他格式副本);训练暴露不止通用指令数据。
整份混合对照公开DI套件和项目评测根做了standard与strict去污。执行过滤及规定的注入恢复规则后,从1,160,834行减至1,143,656行,其中包括最后删除的10行残留影子探针命中。这不代表Qwen3.5预训练没有接触过相关数据。六个试点开发集未进入训练;WiSE比例通过内部评测选择。
## 校准
`CALIBRATION.json` 记录了折入权重的读出温度。由于温度已经折入 norm,前端按温度 1 读取,不要再次重复应用同一个温度。
## 局限
- 9B Gen1 的训练混合小于目前最大的公开决策模型数据混合;
- 本版本没有图像训练,图像能力是零样本;
- 本模型没有训练 block-bidirectional attention;
- 长请求受模型和服务端上下文限制,前端不会静默截断请求;
- 本模型不是通用聊天助手,而是结构化决策读出模型。
## 文件与许可
模型权重和代码按 Apache 2.0 发布。`SHA256SUMS` 覆盖本仓库全部文件。Qwen3.5-9B 底座仍适用其自身许可证和使用条款。
## 引用
```bibtex
@misc{knowline9bgen1,
title = {KnowLine-9B-Gen1},
author = {PelaAI},
year = {2026},
howpublished = {Hugging Face model repository}
}
```
|