ai newsDo., 22. Okt.
Eilmeldung1Password für Agents: KI-Assistenten loggen sich ein, ohne Passwörter zu sehen

How to Use GLM-5 for Free with Ollama?

GLM-5 from Z.ai is a frontier-level open-source model you can now run through Ollama — complex reasoning, software engineering, and long-horizon agentic workflows, entirely on your own hardware. Try Apidog today 💡 Download Apidog for free to complement your setup. It lets you visually design, test

dev.toDonnerstag 15:01 · 22.10.5 Min. Lesezeit
Bild: dev.to

GLM-5 from Z.ai is a frontier-level open-source model you can now run through Ollama — complex reasoning, software engineering, and long-horizon agentic workflows, entirely on your own hardware.

💡 Download Apidog for free to complement your setup. It lets you visually design, test, and debug requests against Ollama's local OpenAI-compatible endpoint, streamlining experimentation with GLM-5 from your first interaction.

Benchmarks back it up: 92.7% on AIME 2026 I, 86.0% on GPQA-Diamond, and 77.8% on SWE-bench Verified — competitive in coding, mathematical reasoning, and agentic tasks such as multi-step planning and tool use.

It also generates structured documents (PRDs, spreadsheets, reports), works with agent frameworks, and transitions smoothly from simple chat to sophisticated engineering workflows.

Ollama manages model downloads, quantization, and serving on macOS, Linux, and Windows, and exposes an OpenAI-compatible REST API at http://localhost:11434/v1. Anything built for OpenAI endpoints works with GLM-5 out of the box.

You avoid cloud costs, rate limits, and sending data to third parties. Model switching is trivial, and the glm-5:cloud tag gives you an optimized variant tailored for local execution that balances capability and resource demands.

CPU-only setups work but yield slower token generation. Mid-range GPUs often reach usable speeds by limiting context or using lower quantization where available — test incrementally after setup.

Download the installer for your platform from the official Ollama website. On macOS or Linux, run the installation command from the site in a terminal; on Windows, execute the downloaded.exe.

ollama --version Enter fullscreen mode Exit fullscreen mode If the server doesn't launch automatically, start it in the background:

ollama serve Enter fullscreen mode Exit fullscreen mode Step 2: Pull and Run GLM-5 Download the model:

ollama pull glm-5:cloud Enter fullscreen mode Exit fullscreen mode Monitor progress in the terminal — download time depends on your connection. Then start an interactive session:

ollama run glm-5:cloud Enter fullscreen mode Exit fullscreen mode Type prompts, observe responses, and exit with /bye when finished.

The CLI suits quick testing; for programmatic access, use the REST API. A minimal chat completion with curl:

curl http://localhost:11434/api/chat -d '{ "model": "glm-5:cloud", "messages": [ { "role": "user", "content": "Explain the advantages of Mixture-of-Experts architectures in large language models." } ], "stream": false }' Enter fullscreen mode Exit fullscreen mode Ollama returns a JSON response containing the assistant's message. Set "stream": true for real-time token output.

Since the endpoint is OpenAI-compatible, existing OpenAI SDK code adapts effortlessly — just point base_url at Ollama:

from openai import OpenAI client = OpenAI ( base_url = " http://localhost:11434/v1 ", [ REDACTED CREDENTIAL ] # Placeholder; no real key required ) response = client. chat. completions. create ( model = " glm-5:cloud ", messages = [ { " role ": " system ", " content ": " You are an expert software architect. " }, { " role ": " user ", " content ": " Design a scalable microservices system for an e-commerce platform handling 1M daily users. " } ], temperature = 0.7, max_tokens = 2048 ) print ( response. choices [ 0 ]. message. content ) Enter fullscreen mode Exit fullscreen mode The official ollama Python library works as well.

Visual API testing accelerates development and debugging — Apidog provides an intuitive interface for crafting requests, managing environments, and generating client code.

Download Apidog for free from the official site, create a new project, and configure:

Build the request body visually: define the messages array, set the model to "glm-5:cloud", and adjust temperature, top_p, or max_tokens. Send the request and inspect the full JSON response, including token usage and timing.

This turns raw API experimentation into a structured, collaborative process — particularly valuable when testing complex multi-turn conversations or tool-calling scenarios with visual debugging tools.

FROM glm-5:cloud SYSTEM You are a precise engineering assistant focused on long-term planning and code quality. PARAMETER temperature 0.6 PARAMETER num_ctx 131072 Enter fullscreen mode Exit fullscreen mode Build and run the custom model:

ollama create my-glm5 -f Modelfile ollama run my-glm5 Enter fullscreen mode Exit fullscreen mode Adjust context length carefully: larger windows consume more memory but enable analysis of extensive codebases or documents. Monitor VRAM usage with nvidia-smi.

For agentic workflows, launch compatible tools directly:

ollama launch openclaw --model glm-5:cloud Enter fullscreen mode Exit fullscreen mode Similar commands support Claude Code, Codex, and other frameworks, letting GLM-5 power desktop agents or coding assistants locally.

Experiment with system prompts to steer the model toward specific domains such as frontend architecture or cybersecurity analysis. Track tokens-per-second — it typically improves with GPU acceleration and optimized context management.

Community forums and official documentation provide additional solutions as the ecosystem evolves.

If you need to run GLM-5 without Ollama or with a different inference backend, running GLM-5 locally for free via alternative setups covers the options that give you full control over the serving layer.

If you already have GLM-5 running locally via Ollama and want to evaluate the updated release without spinning up new infrastructure, GLM-5.2's free access tiers and self-hosted options cover both the API quota route and the weights you can pull directly.

Running GLM-5 locally through Ollama removes barriers to high-quality AI assistance — state-of-the-art reasoning and coding performance with complete data sovereignty and zero usage costs.

Start with the installation steps above, integrate Apidog to refine your API interactions, and explore custom configurations that match your workflows. Small adjustments — optimized prompts, context management, tool integrations — frequently yield substantial improvements in output quality and efficiency.

GLM-5's capabilities plus Ollama's simplicity let you experiment freely and build production-grade solutions entirely on your own infrastructure. Begin your local deployment now.

Quelle: dev.to (dev.to). Original öffnen