Text Generation
Safetensors
English
Chinese
qwen2
awq
sft
dpo
academic
rag
citation
conversational
4-bit precision
Instructions to use bishang520/Lit-VLLM-Agent-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- vLLM
How to use bishang520/Lit-VLLM-Agent-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bishang520/Lit-VLLM-Agent-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bishang520/Lit-VLLM-Agent-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/bishang520/Lit-VLLM-Agent-AWQ
- SGLang
How to use bishang520/Lit-VLLM-Agent-AWQ 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 "bishang520/Lit-VLLM-Agent-AWQ" \ --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": "bishang520/Lit-VLLM-Agent-AWQ", "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 "bishang520/Lit-VLLM-Agent-AWQ" \ --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": "bishang520/Lit-VLLM-Agent-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use bishang520/Lit-VLLM-Agent-AWQ with Docker Model Runner:
docker model run hf.co/bishang520/Lit-VLLM-Agent-AWQ
Configuration Parsing Warning:In config.json: "quantization_config.modules_to_not_convert" must be an array
Lit-VLLM-Agent AWQ
学术文档 Agent 专用模型:基于 Qwen2-7B 经过学术领域词表扩充、SFT 指令微调与 DPO 偏好对齐,再以 AWQ 4-bit 量化压缩,面向科研论文/技术文档的结构化问答与引用溯源场景。
模型概览
| 项 | 值 |
|---|---|
| 基座模型 | Qwen/Qwen2-7B |
| 词表大小 | 151,806(原版 151,643 + 141 个学术领域 token) |
| 量化 | AWQ 4-bit,group_size=128,version=gemm |
| 微调 | SFT(QLoRA + DeepSpeed ZeRO-2)→ DPO 偏好对齐 |
| 输出格式 | 带结构化引用(JSON Schema / Guided Decoding 强约束) |
| 权重 | ~5.2 GB(2 个 safetensors 分片) |
训练与评测要点
- SFT:400 步(约 46 min),train loss 0.197 / eval loss 0.106
- DPO:200 步(约 52 min),偏好准确率 98.75%–100%,平均 margin ≈ 2.8
- 词表扩充:基于 BPE 对 ArXiv 学术语料做领域词表扩展,共 141 个学术 token
- 检索(8,771 chunks,Milvus + BM25 混合):hybrid Recall@5 = 1.00,MRR = 0.99
- RAG 生成:忠实度 0.90、引用召回 0.60 / 精确 0.55、引用-检索对齐 0.80
- 部署:vLLM + PagedAttention + Continuous Batching,支持 JSON 引导解码
快速使用
vLLM(推荐)
vllm serve bishang520/Lit-VLLM-Agent-AWQ \
--task generate \
--quantization awq \
--dtype float16 \
--max-model-len 8192 \
--guided-decoding-backend xgrammar
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"bishang520/Lit-VLLM-Agent-AWQ",
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("bishang520/Lit-VLLM-Agent-AWQ")
说明
- 该模型面向学术文档结构化问答,建议配合混合 RAG(版面解析切块 + Milvus/BM25 + BGE-Reranker + Self-RAG)使用,以提供原文溯源。
- 生成遵循 JSON Schema(引用字段约束为列表),可直接配合 vLLM Guided Decoding / xgrammar 使用。
- 完整系统代码见 github.com/bishang520/Lit-VLLM-Agent。
- Downloads last month
- -
Model tree for bishang520/Lit-VLLM-Agent-AWQ
Base model
Qwen/Qwen2-7B