pi-opinionated-glm

Provider-only Pi package that registers a dedicated glm provider backed by OpenCode Zen.

Packages

Package details

extension

Install pi-opinionated-glm from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-opinionated-glm
Package
pi-opinionated-glm
Version
0.2.0
Published
Apr 13, 2026
Downloads
57/mo · 13/wk
Author
exaclior123
License
unknown
Types
extension
Size
4.7 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-opinionated-glm

Provider-only Pi package that registers a dedicated glm provider backed by OpenCode Zen:

  • provider name is glm
  • base URL is https://opencode.ai/zen/go/v1
  • API key env var is OPENCODE_API_KEY
  • the package mirrors Pi's built-in OpenCode Go GLM models instead of pretending GLM must come from z.ai directly

That is the point of the package. It is opinionated. For this workspace, OpenCode Go (/zen/go/) is the default GLM backend because the official z.ai/BigModel rate limits are annoying enough to be useless in practice, and the China-optimized gateway offers better latency.

Install

# try temporarily
pi -e ~/coding_agents/pi-opinionated-glm

# or install into the current project
pi install -l ~/coding_agents/pi-opinionated-glm

Set your API key before use:

export OPENCODE_API_KEY=...

What it changes

This package registers a dedicated glm provider that routes requests through OpenCode Zen:

  • mirrors Pi's built-in opencode-go GLM chat models at runtime instead of freezing a handwritten duplicate list here
  • filters that upstream catalog down to GLM models only, so the package surface stays honest
  • seeds a fallback glm-5.1 entry when the local Pi build has not picked it up yet
  • relies on Pi's normal OpenAI-compatible transport against https://opencode.ai/zen/go/v1

Registered provider

  • Provider name: glm
  • API key env var: OPENCODE_API_KEY
  • Backend: OpenCode Go (China-optimized Zen gateway)

Usage

Use GLM through the dedicated provider, for example:

  • glm/glm-5.1
  • glm/glm-5
  • glm/glm-4.7

Scope

This package is intentionally narrow:

  • it picks an opinionated backend for GLM access
  • it does not masquerade as z.ai anymore
  • it does not maintain a giant handwritten model registry when Pi already has most of the catalog upstream
  • it only adds the small glm-5.1 fallback metadata needed until the local Pi build catches up