Instructions to use liuchen88/CLA1.0-27B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use liuchen88/CLA1.0-27B with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("liuchen88/CLA1.0-27B") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use liuchen88/CLA1.0-27B 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 liuchen88/CLA1.0-27B:F16 # Run inference directly in the terminal: llama cli -hf liuchen88/CLA1.0-27B:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf liuchen88/CLA1.0-27B:F16 # Run inference directly in the terminal: llama cli -hf liuchen88/CLA1.0-27B:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf liuchen88/CLA1.0-27B:F16 # Run inference directly in the terminal: ./llama-cli -hf liuchen88/CLA1.0-27B:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf liuchen88/CLA1.0-27B:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf liuchen88/CLA1.0-27B:F16
Use Docker
docker model run hf.co/liuchen88/CLA1.0-27B:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use liuchen88/CLA1.0-27B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "liuchen88/CLA1.0-27B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "liuchen88/CLA1.0-27B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/liuchen88/CLA1.0-27B:F16
- Ollama
How to use liuchen88/CLA1.0-27B with Ollama:
ollama run hf.co/liuchen88/CLA1.0-27B:F16
- Unsloth Desktop
- Pi
How to use liuchen88/CLA1.0-27B with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "liuchen88/CLA1.0-27B"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "liuchen88/CLA1.0-27B" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use liuchen88/CLA1.0-27B with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "liuchen88/CLA1.0-27B"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "liuchen88/CLA1.0-27B" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "liuchen88/CLA1.0-27B", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use liuchen88/CLA1.0-27B with Docker Model Runner:
docker model run hf.co/liuchen88/CLA1.0-27B:F16
- Lemonade
How to use liuchen88/CLA1.0-27B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull liuchen88/CLA1.0-27B:F16
Run and chat with the model
lemonade run user.CLA1.0-27B-F16
List all available models
lemonade list
- Hermes Agent
How to use liuchen88/CLA1.0-27B with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "liuchen88/CLA1.0-27B"
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:8080/v1 hermes config set model.default liuchen88/CLA1.0-27B
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use liuchen88/CLA1.0-27B with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "liuchen88/CLA1.0-27B"
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:8080/v1 \ --custom-model-id "liuchen88/CLA1.0-27B" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
CLA 1.0-27B
Commercial Loan Approval v1.0 — 基于 Qwen3.8-27B (27B 参数, bfloat16 原版) 通过 QLoRA 微调的企业信贷审批专用大模型,支持多模态输入(财报截图、票据、营业执照等图片)。
本仓库提供 GGUF 多模态版:CLA1.0-27B-f16.gguf(文本塔 F16)+ mmproj-CLA1.0-27B-f16.gguf(视觉投影塔)+ preprocessor_config.json + video_preprocessor_config.json,适用于 llama.cpp / Ollama / LM Studio。
模型概览
| 项目 | 内容 |
|---|---|
| 模型名称 | CLA 1.0-27B |
| 基座模型 | Qwen3.8-27B (27B 参数, bfloat16 原版) |
| 微调方式 | QLoRA (LoRA rank=32, alpha=1024, dropout=0.2, ckpt-900) |
| 上下文窗口 | 262,144 tokens |
| 量化精度 | F16 (文本塔) / BF16 (视觉塔) |
| 适用平台 | llama.cpp / Ollama / LM Studio / MLX |
模型架构
| 项目 | 规格 |
|---|---|
| 架构 | Qwen3_5ForCausalLM (混合注意力) |
| 参数量 | 27B (bfloat16 约 54 GB, F16 导出约 53.8 GB) |
| 隐藏维度 | 5120 |
| 层数 | 64 (48 SSM/线性注意力 + 16 Full Attention) |
| 词表大小 | 248,320 |
| 注意力头 | 24 Q heads + 4 KV heads (GQA), head_dim=256 |
| MLP 中间层 | 17,408 (SwiGLU) |
| RoPE | θ=10,000,000, mrope sections=[11,11,10,0] |
| 上下文长度 | 262,144 tokens (原生支持) |
| 视觉塔 | Qwen3-VL 编码器 (27 层 ViT, 1152 dim, patch 16, merge 2) |
| 投影器 | Qwen3VL Merger (2 层 MLP, 4608→5120) |
混合注意力机制
- 48 层 SSM/线性注意力:无 KV cache,推理恒定内存
- **16 层 Full Attention (每 4 层 1 层)**:标准因果注意力,需 KV cache
- 实际 KV cache 仅 16 层:llama.cpp 读取
qwen35.attention.recurrent_layers自动跳过 SSM 层
GGUF 文件
| 文件 | 大小 | SHA256 | 说明 |
|---|---|---|---|
CLA1.0-27B-f16.gguf |
~50 GB | d4fccf5e1ed19ba371110960fb08513ef2050ef1d72ed4594feb6811d14c2ffa |
文本塔 F16,含 64 层混合注意力权重 |
mmproj-CLA1.0-27B-f16.gguf |
~888 MB | 00938ed61d6825bd9955ef023075e49768aee86eb463beccca63b72454410577 |
视觉投影塔 BF16,含 ViT 编码器 + Merger |
关键元数据(自动写入,无需手动配置)
qwen35.block_count = 64
qwen35.full_attention_interval = 4
qwen35.attention.recurrent_layers = [True, True, True, False, ...] # 48 True + 16 False
general.architecture = qwen35
general.file_type = 1 (F16)
general.quantization_version = 2
内存需求估算(F16 + 262K ctx)
| 组件 | 大小 |
|---|---|
| 模型权重 | ~53.8 GB |
| KV cache = 16 层 × 4 KV heads(GQA) × 256 head_dim × 2(K+V) × 2 bytes(f16) × 262,144 | ~17.2 GB |
| 总计 (Flash Attention 开启) | ~71 GB |
| 总计 (Flash Attention 关闭, f32 KV) | ~137 GB (guardrail 显示值,非实际占用) |
LM Studio 显示 ~137 GB 是估算器 Bug,实际运行仅需 ~71 GB。解决:开 Flash Attention 或降 n_ctx。
训练信息
| 超参数 | 值 |
|---|---|
| LoRA target_modules | q_proj, v_proj, k_proj, o_proj, gate_proj, up_proj, down_proj (7 类投影层) |
| rank / scale (MLX) / alpha (PEFT等价) | 32 / 32 / 1024 |
| dropout | 0.2 |
| mask_prompt | true (仅计算 assistant 回复 loss) |
| 学习率 | 1.4e-6 (cosine decay, warmup=50 steps) |
| 序列长度 | 2304 (训练) / 262,144 (推理原生支持) |
| 训练框架 | mlx-lm (Apple MLX / Metal) |
| 平台 | macOS (Apple Silicon) |
| 混合精度 | bfloat16 (训练) / F16 (导出) |
损失函数
- 标准因果语言建模 loss (cross-entropy)
mask_prompt=true:system + user 部分 loss 置零,仅反传 assistant token
多模态用法
能力范围
- 财报截图/PDF 渲染页 → 表格结构化提取
- 营业执照/许可证 → 关键字段识别
- 银行回单/票据 → 金额、日期、付款方核验
- 诉讼文书/判决书 → 案由、金额、当事人抽取
加载要求(三件套缺一不可)
CLA1.0-27B-f16.gguf # 文本塔
mmproj-CLA1.0-27B-f16.gguf # 视觉投影
preprocessor_config.json # 图片预处理配置
video_preprocessor_config.json # 视频预处理配置
示例 Prompt
# 图片 + 文本混合输入
messages = [
{"role": "system", "content": "你是一位具有20年企业信贷审批经验的商业银行对公信贷审批专家。"},
{"role": "user", "content": [
{"type": "image", "image": "financial_statement.png"},
{"type": "text", "text": "该企业申请授信1000万元,请结合财报图片给出审批结论。"}
]}
]
部署指引
llama.cpp (CPU/Metal)
# 仅文本
./llama-cli -m CLA1.0-27B-f16.gguf -c 32768 -p "..." -n 2048
# 多模态 (需 --mmproj)
./llama-cli \
-m CLA1.0-27B-f16.gguf \
--mmproj mmproj-CLA1.0-27B-f16.gguf \
-c 32768 \
-p "你是信贷专家...企业申请授信..." \
-n 2048
Ollama
# Modelfile
FROM ./CLA1.0-27B-f16.gguf
TEMPLATE "{{ .System }}\n\n{{ .Prompt }}\n\n{{ .Response }}"
PARAMETER num_ctx 32768
PARAMETER num_gpu 99
ollama create cla-27b -f Modelfile
ollama run cla-27b "企业申请授信500万,资产负债率65%,流动比率1.3,利息保障倍数2.1,无不良记录。"
LM Studio
- 将四个文件放入同一目录
- 点击 "Add Model" 选择
CLA1.0-27B-f16.gguf - 关键设置(Settings → Model → GPU Offload):
- ✅ Flash Attention (KV cache f16,内存减半)
- n_ctx:
32768(生产建议,估算进一步下降) - GPU Offload:
全层(Metal 统一内存)
- 模型列表会显示 Vision 标签,支持拖入图片
限制与免责声明
数据局限
- 非中国司法管辖区企业、特殊行业(金融/军工/烟草等)适用性未验证
- 宏观周期、政策突变等外生冲击未显式建模
模型局限
- 三态分类存在误判风险(尤其边界样本:cond_approve ↔ approve/reject)
- 长上下文(>32K)推理注意力稀疏化可能遗漏关键细节
- 视觉塔仅支持定长 patch,超长报表需分页/切片
部署局限
- 需 ≥64GB 统一内存 (Mac) 或 ≥80GB VRAM (NVIDIA F16)
- GGUF 面向 llama.cpp 生态,推理引擎支持 CPU/Metal/CUDA/Vulkan;原生 PyTorch 推理需转回 HF safetensors 格式
- 多模态需完整三件套,缺一不可
合规声明
- 本模型仅供信贷审批辅助决策参考,不可替代人工审批岗
- 审批结论存在误判风险,请结合尽调报告、实地走访、行业研判综合决策
- 使用者须遵守《商业银行资本管理办法》《流动资金贷款管理办法》等监管要求
- 本项目不构成任何金融建议、授信承诺或法律意见
引用与致谢
- Qwen Team: Qwen3.8-27B 基座模型 (Apache-2.0)
- Downloads last month
- 74
16-bit
Model tree for liuchen88/CLA1.0-27B
Base model
Qwen/Qwen3.8-27B