# 搜索模型(支持 all / ollama / huggingface / modelscope)
export HF_ENDPOINT=https://hf-mirror.com
./build/las model search qwen3
./build/las model search qwen3 --source huggingface --limit 20
# 下载模型
./build/las model download qwen3-coder:30b
./build/las model download unsloth/Qwen3-Coder-Next-GGUF
./build/las model download unsloth/Qwen3-Coder-Next-GGUF --file Q4_K_M.gguf
# 列出已下载模型
./build/las model list
# 修复模型缺失的 tokenizer/config 文件
./build/las model repair ByteDance/Ouro-2.6B-Thinking
# 删除模型
./build/las model rm qwen3-coder:30b --force
3.5 运行模型(model run)
# 运行 GGUF(llama.cpp)
./build/las model run unsloth/Qwen3-Coder-Next-GGUF
# 指定运行参数
./build/las model run unsloth/Qwen3-Coder-Next-GGUF \
--ctx-size 65536 \
--threads 16 \
--n-gpu-layers 40
# 自动 batch 调优 + 仅打印命令
./build/las model run unsloth/Qwen3-Coder-Next-GGUF \
--auto-batch --dry-run
# smart-run(使用 LLM 做参数建议)
./build/las model run unsloth/Qwen3-Coder-Next-GGUF \
--smart-run --smart-run-debug --dry-run
# smart-run 强制刷新(忽略本地缓存,重新询问 LLM)
./build/las model run unsloth/Qwen3-Coder-Next-GGUF \
--smart-run --smart-run-refresh --smart-run-debug --dry-run
# 查看 smart-run 缓存
./build/las model smart-run-cache list
./build/las model smart-run-cache list unsloth/Qwen3-Coder-Next-GGUF
# 删除某个模型的 smart-run 缓存
./build/las model smart-run-cache rm unsloth/Qwen3-Coder-Next-GGUF
# smart-run 严格模式
./build/las model run unsloth/Qwen3-Coder-Next-GGUF \
--smart-run --smart-run-strict --dry-run
# 运行 safetensors(vLLM)
./build/las model run ByteDance/Ouro-2.6B-Thinking \
--vllm-max-model-len 8192 \
--vllm-gpu-memory-utilization 0.9
3.6 Provider 与服务管理
# 查看可用 LLM provider
./build/las provider list
# 服务管理
./build/las service start ollama
./build/las service status ollama
./build/las service stop ollama
3.7 失败处理闭环(failure)
# 列出最近失败记录
./build/las failure list --limit 20
# 按阶段或分类过滤
./build/las failure list --phase smart_run --category timeout
# JSON 输出
./build/las failure list --output json --limit 5
# 查看单条失败详情与修复建议
./build/las failure show <event-id>
LocalAIStack 是一个开放、模块化的软件栈,用于构建和运营本地 AI 工作站。
它提供统一的控制层,用于在本地硬件上安装、管理、升级并运行 AI 开发环境、推理运行时、模型和应用,无需依赖云服务或厂商专有平台。
LocalAIStack 旨在做到硬件感知、可复现、可扩展,作为本地 AI 计算的长期基础。
LocalAIStack
English README
LocalAIStack 是一个开放、模块化的软件栈,用于构建和运营本地 AI 工作站。
它提供统一的控制层,用于在本地硬件上安装、管理、升级并运行 AI 开发环境、推理运行时、模型和应用,无需依赖云服务或厂商专有平台。
LocalAIStack 旨在做到硬件感知、可复现、可扩展,作为本地 AI 计算的长期基础。
为什么选择 LocalAIStack
本地运行 AI 工作负载不再是小众需求,但本地 AI 软件生态仍然高度碎片化:
LocalAIStack 通过将本地 AI 工作站本身视为基础设施来解决这些问题。
设计目标
LocalAIStack 围绕以下原则构建:
LocalAIStack 提供什么
LocalAIStack 不是单一应用,而是一个由多层协同组成的堆叠式系统。
1. 系统与环境管理
2. 编程语言环境
按需支持以下语言环境:
所有语言环境均为可选、隔离、可升级,并可在不污染系统的情况下移除。
3. 本地 AI 推理运行时
支持的推理引擎包括:
可用性会根据硬件能力自动限制。例如安装
llama.cpp时,会评估是否存在 GPU 及其型号;若没有 GPU,则安装仅依赖 CPU 的版本。4. AI 开发框架
框架版本与已安装运行时和 CUDA 配置保持一致。当前仓库已经提供
unsloth模块,默认按官方 Linuxpython3 -m pip install --user unsloth路径安装,并要求Python < 3.14。5. 数据与基础设施服务
用于 AI 开发和 RAG 工作流的可选本地服务:
所有服务支持:
6. AI 应用
精选的开源 AI 应用,以受管服务形式部署:
每个应用包含:
7. 开发者工具
工具已集成但非强制使用。
8. 模型管理
LocalAIStack 提供统一的模型管理层:
硬件能力感知
LocalAIStack 将硬件划分为能力等级,并自动适配可用功能。
示例等级:
<=14B推理)30B推理)>=70B、多 GPU、NVLink)系统会尽量避免安装其硬件无法可靠运行的软件。
用户界面
LocalAIStack 提供:
国际化
架构概览
典型使用场景
项目状态
LocalAIStack 正在积极开发中。
当前初期重点为:
30B)本地推理流程随着项目演进,将发布路线图与里程碑。
快速开始
最简使用步骤:下载代码,编译,然后使用构建出的 CLI。
命令约定:
./build/las和./build/las-server.\build\las.exe和.\build\las-server.exe1. 下载代码
2. 编译
编译产物:
./build/las(CLI)、./build/las-server(服务端).\build\las.exe(CLI)、.\build\las-server.exe(服务端)3. 使用 CLI
以下示例默认使用 Linux/macOS 写法;在 Windows PowerShell 中请将
./build/las替换为.\build\las.exe。你可以先看总览:
3.1 初始化与系统信息
效果:
$HOME/.localaistack/config.yamltencent/Hunyuan-MT-7Bdeepseek-ai/DeepSeek-V3.2(可修改)base_info.json,用于 install planner、config planner、smart-run3.2 模块管理(
module)当前仓库内已接入的模块包含推理运行时(如
ollama、llama.cpp、vllm)、模型工具(如hf、modelscope)、训练/微调框架unsloth,以及本地 Web UI 应用unsloth-studio。其中
obeaver模块已支持通过./build/las module install obeaver安装上游 microsoft/obeaver。该模块会在 Windows 上自动检查并安装 Foundry Local(winget install Microsoft.FoundryLocal),在 macOS 上自动检查并安装 Foundry Local(brew install microsoft/foundrylocal/foundrylocal);Linux 不支持 Foundry Local,应使用obeaver run --engine ort <本地 ONNX 模型目录>。3.3 安装后配置规划(
module config-plan)3.4 模型管理(
model)3.5 运行模型(
model run)3.6 Provider 与服务管理
3.7 失败处理闭环(
failure)可选调试开关:
失败时会额外输出:
phase/category/retryable/log_path/suggestion。3.8 Shell 补全
3.9 全局参数
3.10 命令总览
下面这份树形清单对应当前 CLI 已注册的命令入口,适合快速查找:
补充说明:
init同时注册在根命令和system init下,两者等价module还有别名:modulesmodel repair还有别名:model fix3.11 速查表
./build/las init./build/las init --language zh-CN --api-key "sk-xxxx"./build/las system initinit等价的系统初始化入口./build/las system init./build/las system detect./build/las system detect./build/las system info./build/las system info./build/las module list./build/las module list./build/las module install <module>./build/las module install ollama./build/las module update <module>./build/las module update llama.cpp./build/las module uninstall <module>./build/las module uninstall vllm./build/las module purge <module>./build/las module purge ollama./build/las module check <module>./build/las module check comfyui./build/las module setting <module> ..../build/las module setting comfyui Comfy-Org_z_image_turbo./build/las module config-plan <module>./build/las module config-plan vllm --planner-debug --dry-run./build/las service start <service>./build/las service start ollama./build/las service stop <service>./build/las service stop ollama./build/las service status <service>./build/las service status ollama./build/las provider list./build/las provider list./build/las model search <query>./build/las model search qwen3 --source huggingface --limit 20./build/las model download <model-id>./build/las model download unsloth/Qwen3-Coder-Next-GGUF --file Q4_K_M.gguf./build/las model list./build/las model list./build/las model repair <model-id>./build/las model repair ByteDance/Ouro-2.6B-Thinking./build/las model rm <model-id>./build/las model rm qwen3-coder:30b --force./build/las model run <model-id>./build/las model run unsloth/Qwen3-Coder-Next-GGUF --ctx-size 65536 --threads 16./build/las model run <model-id> --auto-batch./build/las model run unsloth/Qwen3-Coder-Next-GGUF --auto-batch --dry-run./build/las model run <model-id> --smart-run./build/las model run unsloth/Qwen3-Coder-Next-GGUF --smart-run --smart-run-debug./build/las model run <model-id> --smart-run-refresh./build/las model run unsloth/Qwen3-Coder-Next-GGUF --smart-run --smart-run-refresh --dry-run./build/las model smart-run-cache list./build/las model smart-run-cache list unsloth/Qwen3-Coder-Next-GGUF./build/las model smart-run-cache rm <model-id>./build/las model smart-run-cache rm unsloth/Qwen3-Coder-Next-GGUF./build/las failure list./build/las failure list --phase smart_run --category timeout./build/las failure show <event-id>./build/las failure show evt-xxxx3.12 命令参考
根命令
./build/las --help:查看完整帮助--config <path>:指定配置文件路径--verbose:打开详细输出init/system init用途:
~/.localaistack/config.yaml~/.localaistack/base_info.json常用标志:
--config-path <path>:指定配置文件输出位置--api-key <key>:设置 SiliconFlow API key--language <lang>:设置交互语言,例如zh-CN、en--assistant-provider <name>/--assistant-model <id>:设置智能助手模型--assistant-base-url <url>/--assistant-timeout-seconds <n>:设置智能助手访问参数--translation-provider <name>/--translation-model <id>:设置翻译模型--translation-base-url <url>/--translation-timeout-seconds <n>:设置翻译访问参数module用途:
子命令:
module list:列出仓库内可管理模块,并显示是否已安装module install <module>:安装模块module update <module>:升级模块module uninstall <module>:卸载模块module purge <module>:深度清理模块module check <module>:校验模块是否可用module setting <module> <setting-args...>:调用模块自定义设置逻辑module config-plan <module>:为模块生成配置规划module config-plan常用标志:--model <model-id>:将模型 ID 一起纳入规划上下文--apply:保存到~/.localaistack/config-plans/<module>.json--dry-run:仅输出,不保存--planner-debug:打印规划来源与原因--planner-strict:规划失败时直接报错--output text|json:设置输出格式service用途:
子命令:
service start <service>service stop <service>service status <service>适合管理由 LocalAIStack 接管的后台服务,例如
ollama。model用途:
子命令:
model search <query>--source, -s all|ollama|huggingface|modelscope--limit, -n <N>model download <model-id> [file]--source, -s <source>--file, -f <filename>model listmodel rm <model-id>--force, -f--source, -s <source>model repair <model-id>--source, -s <source>model run <model-id> [gguf-file-or-quant]GGUF -> llama.cpp,safetensors -> vLLMmodel run常用标志:--source, -s <source>--file, -f <gguf-file>--threads--ctx-size--n-gpu-layers--tensor-split--batch-size--ubatch-size--auto-batch--temperature--top-p--top-k--min-p--presence-penalty--repeat-penalty--chat-template-kwargs--vllm-max-model-len--vllm-gpu-memory-utilization--vllm-trust-remote-code--host--port--dry-run与 smart-run 相关的标志:
--smart-run:启用基于硬件和模型上下文的智能参数建议--smart-run-debug:输出参数来源与回退原因--smart-run-refresh:忽略本地缓存并强制重新询问 LLM--smart-run-strict:如果 smart-run 失败,则命令直接失败smart-run 参数持久化:
~/.localaistack/smart-run/model smart-run-cache用途:
子命令:
model smart-run-cache list [model-id]--runtime llama.cpp|vllmmodel smart-run-cache rm <model-id>--runtime llama.cpp|vllmprovider用途:
子命令:
provider listfailure用途:
子命令:
failure list--limit <N>--phase <phase>--category <category>--output text|jsonfailure show <event-id>常见
phase:install_plannerconfig_plannersmart_runmodule_installmodel_runsystem用途:
子命令:
system init:与根命令init等价system detect:硬件检测入口system info:系统信息入口开源
LocalAIStack 是一个开源项目。
文档
更多文档位于
docs/目录:理念
LocalAIStack 将本地 AI 计算视为基础设施,而不是一组工具。
它希望让本地 AI 系统做到: