Text Generation
MLX
Safetensors
Chinese
qwen3_5
qwen3
qwen3.8-27b
credit-scoring
loan-approval
lora
qlora
finance
chinese
multimodal
apple-silicon
conversational
Instructions to use liuchen88/CLA1.0-27B-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use liuchen88/CLA1.0-27B-MLX 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-MLX") 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
- LM Studio
- Pi
How to use liuchen88/CLA1.0-27B-MLX 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-MLX"
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-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use liuchen88/CLA1.0-27B-MLX 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-MLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "liuchen88/CLA1.0-27B-MLX" # 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-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use liuchen88/CLA1.0-27B-MLX 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-MLX"
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-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use liuchen88/CLA1.0-27B-MLX 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-MLX"
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-MLX" \ --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 (MLX)
Commercial Loan Approval v1.0 — 基于 Qwen3.8-27B 通过 QLoRA 微调的企业信贷审批专用大模型,三态输出(批准 / 有条件批准 / 拒绝),支持多模态输入(财报截图、票据、营业执照等图片)。
本仓库为 MLX 原生版(BF16,未量化),适用于 Apple Silicon(LM Studio / mlx-lm)。GGUF 版见同名 CLA1.0-27B-GGUF 仓库。
模型概览
| 项目 | 内容 |
|---|---|
| 模型名称 | CLA 1.0-27B |
| 基座模型 | Qwen3.8-27B (27B 参数, bfloat16 原版) |
| 微调方式 | QLoRA (LoRA rank=32, alpha=1024, dropout=0.2, ckpt-900) |
| 精度 | BF16(无损半精度,未做任何量化) |
| 体积 | ~51 GB (11 个分片) |
| 上下文窗口 | 262,144 tokens |
| 适用平台 | Apple Silicon(LM Studio / mlx-lm) |
架构
- Qwen3_5ForConditionalGeneration:64 层混合注意力(48 层 SSM/线性注意力 + 16 层 Full Attention,间隔 4)
- 隐藏维度 5120,词表 248,320,GQA 24 Q heads + 4 KV heads,head_dim=256
- 视觉塔 Qwen3-VL 编码器(27 层 ViT)+ Merger 投影,张量名保留为
vision_tower.*供 LM Studio Vision 检测
文件清单
| 文件 | 说明 |
|---|---|
model-0000*-of-00011.safetensors (×11) |
模型权重 BF16,文件头含 {"format": "mlx"} |
model.safetensors.index.json |
分片索引 |
config.json / generation_config.json |
模型配置(name: CLA1.0-27B) |
tokenizer.json / tokenizer_config.json / chat_template.jinja |
分词器与对话模板 |
preprocessor_config.json / video_preprocessor_config.json |
图像/视频预处理配置(Vision 必需) |
用法
LM Studio
- 从 LM Studio 搜索
CLA1.0-27B,或本地导入本目录 - 建议开启 Flash Attention,n_ctx 32768 起
- 模型列表显示 Vision 标签,可拖入图片
mlx-lm
pip install mlx-lm
mlx_lm.load --model ./CLA1.0-27B-MLX
训练信息
| 超参数 | 值 |
|---|---|
| LoRA target_modules | q_proj, v_proj, k_proj, o_proj, gate_proj, up_proj, down_proj |
| rank / scale / alpha (PEFT等价) | 32 / 32 / 1024 |
| dropout | 0.2 |
| mask_prompt | true (仅计算 assistant 回复 loss) |
| 学习率 | 1.4e-6 (cosine decay, warmup=50) |
| 序列长度 | 2304 (训练) / 262,144 (推理原生支持) |
| 训练框架 / 平台 | mlx-lm (Apple MLX / Metal), macOS |
示例 Prompt
messages = [
{"role": "system", "content": "你是一位具有20年企业信贷审批经验的商业银行对公信贷审批专家。"},
{"role": "user", "content": "该企业申请授信1000万元,资产负债率65%,流动比率1.3,请给出审批结论。"}
]
限制与免责声明
- 三态分类存在误判风险(尤其边界样本:cond_approve ↔ approve/reject),仅供信贷审批辅助决策参考,不可替代人工审批岗
- 需 ≥64GB 统一内存 (Mac)
- 非中国司法管辖区企业、特殊行业适用性未验证
- 本项目不构成任何金融建议、授信承诺或法律意见
引用与致谢
- Qwen Team: Qwen3.8-27B 基座模型 (Apache-2.0)
- Downloads last month
- 289
Hardware compatibility
Log In to add your hardware
Quantized
Model tree for liuchen88/CLA1.0-27B-MLX
Base model
Qwen/Qwen3.8-27B