Skip to content

Instantly share code, notes, and snippets.

@steebchen
Created January 25, 2026 19:21
Show Gist options
  • Select an option

  • Save steebchen/d55c178f8159a59588bc9a4176a43514 to your computer and use it in GitHub Desktop.

Select an option

Save steebchen/d55c178f8159a59588bc9a4176a43514 to your computer and use it in GitHub Desktop.
GLM-4.7 with OpenCode via LLM Gateway

GLM-4.7 with OpenCode via LLM Gateway

Model Overview

  • Model ID: glm-4-plus
  • Provider: Zhipu AI
  • Strengths: Strong multilingual support, competitive reasoning, Chinese language excellence
  • Context: 128K tokens

Configuration

Add to ~/.config/opencode/config.json:

{
  "provider": "openai-compatible",
  "apiKey": "your-llmgateway-api-key",
  "baseUrl": "https://api.llmgateway.io/v1",
  "model": "glm-4-plus"
}

Or via environment:

export OPENCODE_PROVIDER="openai-compatible"
export OPENCODE_API_KEY="your-llmgateway-api-key"
export OPENCODE_BASE_URL="https://api.llmgateway.io/v1"
export OPENCODE_MODEL="glm-4-plus"

Usage

opencode --model glm-4-plus "add Chinese comments to this code"

Best Use Cases

  • Multilingual codebases
  • Chinese documentation and comments
  • Cross-cultural development teams
  • General coding assistance
  • Code explanation in multiple languages

Pricing Tier

Mid-tier - good balance for multilingual projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment