Imagine you have a really smart friend named GLM. He can write stories, answer questions, and even make pretty documents. Right now he lives far away β at Z.ai's house β and every time you want to talk, you have to send him a letter through the mail and wait.
What if you could invite GLM to live in your house? Then he'd always be there. No mail. No waiting. And β best part β you could give him a desk, some pens, and a recipe book, and he'd start making the same kind of pretty reports Z.ai shows off.
This guide walks you through that, one tiny step at a time. Grown-up words are explained with kid words. Every step ends with "you did it" so you always know when to high-five yourself.
Before we start: meet the four friends
Picture four friends who all need to show up at your house for a party:
- GLM β the smart brain. He writes the words.
- Ollama β the front door. He's the one who actually lets GLM inside your computer.
- Open WebUI β the desk and chair GLM sits at. It's the screen with buttons that you click.
- Toolbox β pens, paper, scissors, glue. Without these, GLM can only talk. With these, he can make things.
Got the picture? Okay, let's invite them over one at a time.
Step 1 β Put in the front door (install Ollama)
Ollama is the front door of your computer. Without it, GLM has nowhere to walk in. The good news: it installs itself with one command.
Open your terminal (that black box where you type stuff). On a Mac, press Cmd + Space, type terminal, and hit Enter. On Windows, search for "PowerShell." Then paste this in and press Enter:
curl -fsSL https://ollama.com/install.sh | sh
Your computer will think for a minute, download some files, and tell you when it's done. If you see something like "Ollama is now running" or just no red error text β you did it.
Step 2 β Invite GLM inside (download the model)
Now that the door is in, you need to actually call GLM over. He lives in a big library called Hugging Face. Tell Ollama to fetch him:
ollama pull hf.co/unsloth/GLM-4.6-GGUF:TQ1_0
This one takes a while β like, "go make a sandwich" while. GLM is a chunky boy (~73GB). When the progress bar hits 100% and the prompt comes back, you did it.
Quick note: if your computer doesn't have a lot of memory (less than 32GB of RAM or under 24GB of video card memory), grab the smaller cousin instead:
ollama pull hf.co/unsloth/GLM-4.5-Air-GGUF:Q4_K_M
He's smaller, faster, and almost as smart.
Step 3 β Say hi to GLM (test it works)
Before we give him a desk, let's just check he's awake. Type:
ollama run hf.co/unsloth/GLM-4.6-GGUF:TQ1_0
You'll see a little >>> prompt. That means GLM is listening. Type: Hi! What's 2 plus 2? and press Enter. If he answers β even a weird answer β you did it. GLM is alive in your house.
Type /bye to send him to his room for now.
Step 4 β Give GLM a desk (install Open WebUI)
Right now, talking to GLM means typing in that black terminal box. That's no fun. Let's give him a nice desk with buttons and a screen. That desk is called Open WebUI.
Make sure Python is installed first (it usually is on Mac; on Windows grab it from python.org). Then in your terminal:
pip install open-webui
open-webui serve
It'll print some text and tell you it's running on something like http://localhost:8080. Open your browser (Chrome, Safari, whatever) and go to that address. You'll see a chat screen that looks suspiciously like the one at z.ai. You did it. GLM has a desk now.
If you go to Settings β Connections, you'll see Ollama is already auto-detected. That's because both friends are at the same party.
Step 5 β Hand GLM the toolbox (install the document libraries)
Here's the part most people miss, and it's the secret sauce. GLM by himself can only talk. He can't actually save a Word file or draw a chart. He needs tools β just like a chef needs a stove and a pan.
Open a new terminal window (or stop the open-webui one with Ctrl+C and restart it later) and install these tools. Each one is a different appliance in GLM's kitchen:
pip install python-docx # the Word-document typewriter
pip install reportlab # the PDF-printing press
pip install openpyxl # the Excel spreadsheet maker
pip install python-pptx # the PowerPoint slide projector
pip install matplotlib seaborn # the chart-drawing crayons
pip install pandas # the calculator
pip install weasyprint # an HTML-to-PDF toaster (optional but nice)
When all of those finish installing without red errors β you did it. GLM's kitchen is fully stocked.
Step 6 β Write the recipe book (make skill files)
This is the magic step. A chef with tools but no recipes makes a mess. So we write GLM a little recipe book β one recipe per kind of document.
Make a folder on your computer, like ~/.glm-skills/, and inside it put plain text files. Each one tells GLM the rules for that kind of document. For example, pdf.md might say:
# How to make a PDF
- Use the reportlab library.
- Every paragraph must have at least 3 sentences.
- Never put a page break in the middle of a section.
- For Chinese characters, register Noto Serif SC first.
- Always save the .py script before running it.
Then in Open WebUI, go to Settings β Advanced β System Prompt, and paste the contents of the recipe that matches what you want. (If you want a Word doc, paste docx.md. If you want a PDF, paste pdf.md.) Now whenever GLM writes that kind of document, he follows your rules. You did it. GLM knows how the house runs.
Step 7 β Ask for a report (the fun part)
Back in Open WebUI, type something like:
"Write me a 3-page PDF briefing about why the sky is blue, with a cover page and three sections."
If everything's wired up β GLM is awake, the libraries are installed, and the recipe is loaded β GLM will write a Python script, run it, and produce an actual .pdf file you can open and read. You did it. You just reproduced a Z.ai-style polished report on your own computer, with no API bill.
Quick recap β the party in order
- Install the door β
curl -fsSL https://ollama.com/install.sh | sh - Invite GLM in β
ollama pull hf.co/unsloth/GLM-4.6-GGUF:TQ1_0 - Wave hello β
ollama run ...and ask "what's 2+2?" - Set up the desk β
pip install open-webui && open-webui serve - Stock the kitchen β
pip install python-docx reportlab openpyxl python-pptx matplotlib - Write the recipe book β make
~/.glm-skills/*.mdfiles, paste one into the system prompt - Order a report β ask Open WebUI for a PDF and watch it appear
Do these seven steps in order and you'll have a working local GLM setup before bedtime.
So is the Z.ai frontend open source?
Honest answer: no, the actual chat.z.ai website code is not open source. You can't just download the exact screen you see when you log into Z.ai.
But here's what Z.ai has given away for free (and it's a lot):
- The GLM model weights β GLM-4.5, 4.6, 4.7, and GLM-5 are all on Hugging Face under the MIT license. This is the brain itself. Anyone can use it commercially.
- The inference code β at
github.com/zai-org/GLM-4.5, you get the Python code that knows how to run the model. - Z.ai Coding Plugins β at
github.com/zai-org/zai-coding-plugins, a marketplace of plugins for Claude Code-style agents. - Synapse β at
github.com/zai-org/Synapse, a self-hostable AI workspace with shared conversations, memory, and MCP tools. This is the closest thing Z.ai has released to their chat frontend, but it's a separate product, not the chat.z.ai code.
What's not open: the proprietary "skills" system that turns a plain chat answer into a polished multi-page report with the right fonts, page breaks, and cover pages. That part you build yourself with Step 6 above.
So the realistic move is: take Z.ai's open model, run it on your machine, give it the open-source Open WebUI frontend, and write your own skill files. You end up with something that works like Z.ai, even if it doesn't look exactly like Z.ai. And honestly β once you've tuned your skill files for a few weeks, yours might be better, because they'll be exactly tuned to the documents you care about.
How to tell GLM exactly what you want (the spec sheet)
Here's the part nobody explains: a model can't read your mind. "Make me a report" produces a different document every time. To get the polished, repeatable output you're after, you have to brief GLM the same way you'd brief a junior designer β with specific numbers and specific rules, not adjectives.
You can put the brief in two places. In the user prompt for one-off requests where every report is different. Or in the skill file for repeatable defaults where you want all your PDFs to look the same. The mental model: skill file = house style guide; user prompt = the specific assignment.
The 11 things to always specify
Every brief should answer these. Skip one and the model fills it in with a guess β usually a bad one.
- Length β total page count, word count, and words-per-section. "8 pages" is too vague; "8 pages, ~3,000 words, ~400 words per body section, 4 body sections" is briefable.
- Cover page β yes or no, layout (full-bleed photo, solid color, or centered title only), and whether it should look "glossy" (gradient/photographic) or "minimal" (typographic only).
- Table of contents β yes or no, and if yes, how deep (just H1s, or H1 plus H2).
- Headers and footers β what goes in the header (report title? section name?), what goes in the footer (page numbers? copyright line? date?).
- Page numbers β format (1, 2, 3 or i, ii, iii for front matter), starting position (cover doesn't count? start at TOC?), and alignment.
- Typography β heading font, body font, and sizes. If you don't pick, the model picks for you, usually badly.
- Color palette β primary, accent, and background. Use hex codes, not adjectives. "Professional blue" means something different to every model on every day.
- Section structure β what sections, in what order, with what each one is about.
- Visual elements β charts? tables? callout boxes? sidebars? Specify which and where.
- Tone and audience β executive, technical, or general public.
- Output format and path β PDF, DOCX, XLSX, or PPTX, plus the exact save location on disk.
A copy-paste spec template
Here's a template you can fill in and paste into the user prompt or your skill file. Treat the bracketed values as the only things you change.
# REPORT SPEC
Length: 8 pages total, ~3,000 words, ~400 words per body section
Audience: executive (non-technical)
Tone: confident, concise, no hedging
Cover:
- Style: glossy, full-bleed gradient background (#0A2540 to #1E3A8A)
- Title centered, white, 32pt
- Subtitle below in lighter weight, 14pt
- Date and author in bottom-right corner, 10pt
Table of contents: yes, H1 only, on its own page after cover
Headers: report title on left, section name on right
Footers: page number centered ("Page 3 of 8"), copyright line on left
Page numbers: arabic, start at 1 on the first body page
(cover and TOC don't count)
Typography:
- Headings: Noto Sans SC, 18pt, bold, #0A2540
- Body: Noto Serif SC, 11pt, #1F2937
- Captions: Noto Sans SC, 9pt, italic, #6B7280
Color palette:
- Primary: #0A2540 (deep navy)
- Accent: #F59E0B (amber)
- Background: #FFFFFF
- Callout background: #FEF3C7
Sections (in order):
1. Executive Summary β 200 words
2. Market Context β 400 words + 1 bar chart
3. Key Findings β 800 words + 2 tables
4. Recommendations β 400 words
5. Appendix β data tables, no word count
Visual elements:
- 1 bar chart in section 2 (matplotlib, accent color)
- 2 tables in section 3 (alternating row shading)
- 3 callout boxes for key stats (amber background)
Output: PDF, saved to /home/me/reports/q4-summary.pdf
How to actually make the cover "glossy"
"Glossy" is a vague word that means different things to different models. To get the look you actually want, specify these four things instead of just the word:
- Background type: full-bleed photo, gradient, solid color, or texture.
- Gradient direction (if gradient): "top-to-bottom, 135 degrees" or "radial from center".
- Hex codes for both endpoints of the gradient.
- Title treatment: shadow yes/no, embossed yes/no, all-caps yes/no.
- Photo source (if full-bleed): "from Unsplash, query: modern cityscape at dusk" β otherwise the model will guess, and it'll guess badly.
A typical glossy cover brief looks like this:
Cover style: glossy, full-bleed gradient
Gradient: 135 degrees linear, from #0F172A (top-left) to #1E40AF (bottom-right)
Title: "Q4 2026 Market Review", centered, 36pt, white,
slight drop shadow (rgba(0,0,0,0.3), 2px offset)
Subtitle: "Prepared for the Board of Directors", centered, 14pt, #E5E7EB
Bottom strip: thin amber bar (#F59E0B), 4px tall, full width, 24px from bottom edge
Date: "October 2026", bottom-right, 10pt, white
Where each spec lives
| Spec type | Where it goes | Example |
|---|---|---|
| Reusable defaults (fonts, palette, page number style) | Skill file (pdf.md) |
"All PDFs use Noto Serif SC for body..." |
| Per-report variables (length, sections, topic) | User prompt | "Make me an 8-page Q4 review..." |
| One-off flourishes (glossy cover, custom hero image) | User prompt, near the top | "Cover should be a glossy gradient..." |
Two example briefs side by side
Example A β short and opinionated:
"Make a 4-page PDF briefing on lithium supply chains. Glossy cover with deep navy gradient. TOC. Executive summary plus 3 body sections plus recommendations. Page numbers in footer, centered. Save as lithium.pdf."
Example B β long and fully spec'd:
Use the template above, fill in every field, paste the whole thing into the chat.
Both work. Example A produces a good-but-generic report. Example B produces a report that looks like a human designer made it. The difference between the two is roughly the difference between a template you found on Etsy and one a brand agency would charge you five figures for.
Wrapping up
Think of it like this: the model is the brain, the agent loop is the hands, the Python libraries are the typewriter, and the skill files are the style guide. Skip any one of those four and the output drops a tier. Get all four right and you'll be producing Z.ai-quality deliverables on your own hardware, on your own data, with no API bill.
Start with Steps 1 through 3 tonight. Get one goodnight-answer from GLM. Then come back tomorrow and finish Steps 4 through 7. By the end of the week, you'll have your own report factory.
IMMORTALITY