PSA: unsloth/GLM-5.2-GGUF 正在上传

Reddit r/LocalLLaMA 模型

摘要

unsloth 已将 GLM-5.2 的 GGUF 版本上传至 Hugging Face,为 llama.cpp、vLLM 和 SGLang 等多种推理引擎提供了可直接使用的模型文件。

暂无内容
查看原文
查看缓存全文

缓存时间: 2026/06/17 19:19

unsloth/GLM-5.2-GGUF · Hugging Face 来源:https://huggingface.co/unsloth/GLM-5.2-GGUF 库Transformers (https://huggingface.co/unsloth/GLM-5.2-GGUF?library=transformers)如何将 unsloth/GLM-5.2-GGUF 与 Transformers 结合使用: # 作为高级辅助工具使用 pipeline from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/GLM-5.2-GGUF") messages = [ {"role": "user", "content": "你是谁?"}, ] pipe(messages) # 直接从模型加载 from transformers import AutoModel model = AutoModel.from_pretrained("unsloth/GLM-5.2-GGUF", dtype="auto") llama-cpp-python (https://huggingface.co/unsloth/GLM-5.2-GGUF?library=llama-cpp-python)如何将 unsloth/GLM-5.2-GGUF 与 llama-cpp-python 结合使用: # !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="unsloth/GLM-5.2-GGUF", filename="Q8_0/GLM-5.2-Q8_0-00001-of-00017.gguf", ) llm.create_chat_completion( messages = [ { "role": "user", "content": "法国的首都是哪里?" } ] ) 笔记本Google Colab (https://huggingface.co/unsloth/GLM-5.2-GGUF/colab)Kaggle (https://huggingface.co/unsloth/GLM-5.2-GGUF/kaggle)本地应用设置 (https://huggingface.co/settings/local-apps)llama.cpp (https://huggingface.co/unsloth/GLM-5.2-GGUF?local-app=llama.cpp)如何将 unsloth/GLM-5.2-GGUF 与 llama.cpp 结合使用: ##### 通过 brew 安装 brew install llama.cpp # 启动一个兼容 OpenAI 的本地服务器,并带有 Web UI: llama-server -hf unsloth/GLM-5.2-GGUF:Q8_0 # 直接在终端中运行推理: llama-cli -hf unsloth/GLM-5.2-GGUF:Q8_0 ##### 通过 WinGet (Windows) 安装 winget install llama.cpp # 启动一个兼容 OpenAI 的本地服务器,并带有 Web UI: llama-server -hf unsloth/GLM-5.2-GGUF:Q8_0 # 直接在终端中运行推理: llama-cli -hf unsloth/GLM-5.2-GGUF:Q8_0 ##### 使用预构建二进制文件 # 从以下地址下载预构建二进制文件: # https://github.com/ggerganov/llama.cpp/releases # 启动一个兼容 OpenAI 的本地服务器,并带有 Web UI: ./llama-server -hf unsloth/GLM-5.2-GGUF:Q8_0 # 直接在终端中运行推理: ./llama-cli -hf unsloth/GLM-5.2-GGUF:Q8_0 ##### 从源代码构建 git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # 启动一个兼容 OpenAI 的本地服务器,并带有 Web UI: ./build/bin/llama-server -hf unsloth/GLM-5.2-GGUF:Q8_0 # 直接在终端中运行推理: ./build/bin/llama-cli -hf unsloth/GLM-5.2-GGUF:Q8_0 ##### 使用 Docker docker model run hf.co/unsloth/GLM-5.2-GGUF:Q8_0 LM StudioJanvLLM (https://huggingface.co/unsloth/GLM-5.2-GGUF?local-app=vllm)如何将 unsloth/GLM-5.2-GGUF 与 vLLM 结合使用: ##### 通过 pip 安装并启动服务 # 通过 pip 安装 vLLM: pip install vllm # 启动 vLLM 服务: vllm serve "unsloth/GLM-5.2-GGUF" # 使用 curl 调用服务(兼容 OpenAI 的 API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/GLM-5.2-GGUF", "messages": [ { "role": "user", "content": "法国的首都是哪里?" } ] }' ##### 使用 Docker docker model run hf.co/unsloth/GLM-5.2-GGUF:Q8_0 SGLang (https://huggingface.co/unsloth/GLM-5.2-GGUF?local-app=sglang)如何将 unsloth/GLM-5.2-GGUF 与 SGLang 结合使用: ##### 通过 pip 安装并启动服务 # 通过 pip 安装 SGLang: pip install sglang # 启动 SGLang 服务: python3 -m sglang.launch_server \ --model-path "unsloth/GLM-5.2-GGUF" \ --host 0.0.0.0 \ --port 30000 # 使用 curl 调用服务(兼容 OpenAI 的 API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/GLM-5.2-GGUF", "messages": [ { "role": "user", "content": "法国的首都是哪里?" } ] }' ##### 使用 Docker 镜像 docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "unsloth/GLM-5.2-GGUF" \ --host 0.0.0.0 \ --port 30000 # 使用 curl 调用服务(兼容 OpenAI 的 API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/GLM-5.2-GGUF", "messages": [ { "role": "user", "content": "法国的首都是哪里?" } ] }' Ollama (https://huggingface.co/unsloth/GLM-5.2-GGUF?local-app=ollama)如何将 unsloth/GLM-5.2-GGUF 与 Ollama 结合使用: ollama run hf.co/unsloth/GLM-5.2-GGUF:Q8_0 Unsloth Studio (https://huggingface.co/unsloth/GLM-5.2-GGUF?local-app=unsloth)如何将 unsloth/GLM-5.2-GGUF 与 Unsloth Studio 结合使用: ##### 安装 Unsloth Studio (macOS, Linux, WSL) curl -fsSL https://unsloth.ai/install.sh | sh # 运行 Unsloth Studio unsloth studio -H 0.0.0.0 -p 8888 # 然后在浏览器中打开 http://localhost:8888 # 搜索 unsloth/GLM-5.2-GGUF 开始聊天 ##### 安装 Unsloth Studio (Windows) irm https://unsloth.ai/install.ps1 | iex # 运行 Unsloth Studio unsloth studio -H 0.0.0.0 -p 8888 # 然后在浏览器中打开 http://localhost:8888 # 搜索 unsloth/GLM-5.2-GGUF 开始聊天 ##### 使用 HuggingFace Spaces 运行 Unsloth # 无需设置 # 在浏览器中打开 https://huggingface.co/spaces/unsloth/studio # 搜索 unsloth/GLM-5.2-GGUF 开始聊天 Pi (https://huggingface.co/unsloth/GLM-5.2-GGUF?local-app=pi)如何将 unsloth/GLM-5.2-GGUF 与 Pi 结合使用: ##### 启动 llama.cpp 服务器 # 安装 llama.cbrew install llama.cpp # 启动一个兼容 OpenAI 的本地服务器: llama-server -hf unsloth/GLM-5.2-GGUF:Q8_0 ##### 在 Pi 中配置模型 # 安装 Pi:npm install -g @mariozechner/pi-coding-agent # 添加到 ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "unsloth/GLM-5.2-GGUF:Q8_0" } ] } } } ##### 运行 Pi # 在项目目录中启动 Pi: pi Hermes Agentnew (https://huggingface.co/unsloth/GLM-5.2-GGUF?local-app=hermes-agent)如何将 unsloth/GLM-5.2-GGUF 与 Hermes Agent 结合使用: ##### 启动 llama.cpp 服务器 # 安装 llama.cbrew install llama.cpp # 启动一个兼容 OpenAI 的本地服务器: llama-server -hf unsloth/GLM-5.2-GGUF:Q8_0 ##### 配置 Hermes # 安装 Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # 将 Hermes 指向本地服务器: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default unsloth/GLM-5.2-GGUF:Q8_0 ##### 运行 Hermes hermes Atomic ChatnewDocker Model Runner (https://huggingface.co/unsloth/GLM-5.2-GGUF?local-app=docker-model-runner)如何将 unsloth/GLM-5.2-GGUF 与 Docker Model Runner 结合使用: docker model run hf.co/unsloth/GLM-5.2-GGUF:Q8_0 Lemonade (https://huggingface.co/unsloth/GLM-5.2-GGUF?local-app=lemonade)如何将 unsloth/GLM-5.2-GGUF 与 Lemonade 结合使用: ##### 拉取模型 # 从 https://lemonade-server.ai/ 下载 Lemonade lemonade pull unsloth/GLM-5.2-GGUF:Q8_0 ##### 运行并与模型聊天 lemonade run user.GLM-5.2-GGUF-Q8_0 ##### 列出所有可用模型 lemonade list

相似文章

huihui-ai/Huihui-GLM-5.2-abliterated-GGUF

Hugging Face Models Trending

Hugging Face 上发布了已消除限制的 GLM-5.2 模型的量化 GGUF 版本,可使用 Transformers、llama.cpp 和 vLLM 等工具进行本地推理。

Unsloth GLM-5.2 – 如何在本地运行

Hacker News Top

使用Unsloth Dynamic GGUFs在本地运行Z.ai的开放模型GLM-5.2的指南。该模型拥有744B总参数量(40B活跃),1M上下文窗口,量化版本可将内存降至2-bit的239GB,使得在256GB Mac上实现本地推理成为可能。