How to use from
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 whcl412/LycheeAI-coder-1.7b-GGUF:Q4_K_M
# Run inference directly in the terminal:
llama cli -hf whcl412/LycheeAI-coder-1.7b-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf whcl412/LycheeAI-coder-1.7b-GGUF:Q4_K_M
# Run inference directly in the terminal:
llama cli -hf whcl412/LycheeAI-coder-1.7b-GGUF:Q4_K_M
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 whcl412/LycheeAI-coder-1.7b-GGUF:Q4_K_M
# Run inference directly in the terminal:
./llama-cli -hf whcl412/LycheeAI-coder-1.7b-GGUF:Q4_K_M
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 whcl412/LycheeAI-coder-1.7b-GGUF:Q4_K_M
# Run inference directly in the terminal:
./build/bin/llama-cli -hf whcl412/LycheeAI-coder-1.7b-GGUF:Q4_K_M
Use Docker
docker model run hf.co/whcl412/LycheeAI-coder-1.7b-GGUF:Q4_K_M
Quick Links

LycheeAI-coder-1.7b-GGUF

当前版本:V13(开关思考版)

LycheeAI-coder-1.7bGGUF 量化版本,基于 Qwen3-1.7B 通过 QLoRA(4-bit)微调,代码优先、支持中/英/粤三语对话、情感共情、可开关思考。V13 实现了可开关思考(难题自动思考、/no_think 直接作答、按难度调深度)。

🙏 关于本项目:这是一个个人开发者初次尝试的开源项目,模型由 1.7B 小参数基座微调而来,能力有限——复杂代码、多步推理可能出错,思考输出偶有格式瑕疵。它更适合作为轻量本地助手,不适合作为生产级编程工具。

本仓库提供 GGUF 格式(跨平台,Ollama / llama.cpp / LM Studio 通用)。如需 Apple Silicon 的 MLX 版本,见 mlx-LycheeAI-coder-1.7b

可用文件

文件 大小 量化 说明
mlx-LycheeAI-coder-1.7b-q4_k_m.gguf 1.05GB Q4_K_M 推荐,平衡质量与大小

使用方式

Ollama

# 1. 下载 q4_k_m 版本后,创建 Modelfile(或直接用仓库内 Modelfile)
ollama create lychee-coder -f Modelfile
# 2. 运行
ollama run lychee-coder "用 Python 写一个快速排序"

llama.cpp

llama-cli -m mlx-LycheeAI-coder-1.7b-q4_k_m.gguf -p "写一个二分查找" -n 256

训练信息

  • 基座模型:Qwen3-1.7B
  • 微调方法:QLoRA(4-bit + LoRA rank 16)
  • 第一轮:CodeAlpaca-20k 代码指令 3500 + 中文 800 + 英语 800 + 粤语 600 + 身份问答 24(共 5724 条,lr 1e-4,4000 步)
  • 第二轮(增量微调):日常对话 60 条(中32/英16/粤12),短问短答,让日常聊天简短自然、不啰嗦(从第一轮续训,lr 5e-5,60 步)
  • 第三轮(增量微调):多语言小型项目 90 条(Python/C/C++/C#/HTML/Java/JS/Swift/Go)+ 场景感知对话 60 条,学会看场景决定说多说少、适度用 emoji(从第二轮续训,lr 5e-5,150 步)
  • 第四轮(增量微调):情感共情 40 + 格式感知 21 + 多轮 10 + 复合逻辑 11 + 纯代码 18 + 锚点 20,修复复合逻辑出错/乱用代码块/缺共情/缺多轮四个短板(从第三轮续训,lr 5e-5,120 步)
  • 第五轮(增量微调):正确代码 79(9语言)+ bug 修复 20 + 分场合安慰 20,提升代码正确性、学会分场合安慰(从第四轮续训,lr 5e-5)
  • 第六轮(可开关思考):思考模式 80(<think> 推理)+ 直答 49(/no_think)+ 锚点 30,学会可开关思考(从第五轮续训,lr 5e-5,160 步)
  • 第七轮(纠偏):常识纠偏+网络用语 25 + 身份区分 10 + 诚实兜底 6 + 按难度思考 30 + 网络上下文 10 + 锚点 15,修复身份过拟合(从第六轮续训,lr 5e-5,100 步)
  • 第八轮(代码拉回):完整代码项目 39 + 调试 15 + 思考 10 + 纠偏 10 + 锚点 15,修复代码退化(从第七轮续训,lr 5e-5,90 步)
  • 第九轮(最终均衡 V10):200 条 = 代码 75 + 情感 25 + 日常 20 + 常识 20 + 思考 15 + 多语言 15 + 网络 10 + 身份 10 + 诚实 10(从第八轮续训,lr 5e-5,200 步)
  • 第十轮(均衡加强思考 V11):250 条 = 代码 50 + 调试 15(思考)+ 难题思考 35 + 简单题直答 25 + 情感 25 + 日常 25 + 多语言 20 + 常识 20 + 身份 15 + 网络 10 + 诚实 10(从 v10 续训,lr 5e-5,250 步)
  • 第十一轮(思考修复 V12):150 条 = 真实推理思考题 60 + 锚点 90,思考占比 20%→36.7%,修复 GGUF 版思考退化(从 v11 续训,lr 5e-5,150 步)
  • 第十二轮(开关思考 V13):300 条 = 打开思考 200(各类型带 <think>,按难度调深度)+ 关闭思考 100(各类型 /no_think 直答),实现 A+B 思考开关 + 统一思考链模板 + 写代码先讲思路(从 v12 续训,lr 5e-5,300 步)
  • 身份:通过 system prompt + 身份问答样本,固定为「LycheeAI-coder-1.7b,由 Qwen3-1.7B 微调而来」
  • 许可:Apache 2.0(跟随基座)

关注作者

📺 Bilibili:欢迎关注我的 B 站账号 https://space.bilibili.com/3493128967293256,不定期分享 AI 模型训练与折腾记录。

Downloads last month
655
GGUF
Model size
2B params
Architecture
qwen3
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for whcl412/LycheeAI-coder-1.7b-GGUF

Finetuned
Qwen/Qwen3-1.7B
Finetuned
(1040)
this model

Datasets used to train whcl412/LycheeAI-coder-1.7b-GGUF