Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>Z.ai Chat Provider for VS CodeNew to Visual Studio Code? Get it now.
Z.ai Chat Provider for VS Code

Z.ai Chat Provider for VS Code

Ryosuke Asano

|
4,542 installs
| (1) | Free
Integrates Z.ai models (GLM-4.5, GLM-4.6, GLM-4.7, GLM-5, GLM-5-Turbo, GLM-5.1, GLM-5V-Turbo, GLM-5-Code) into VS Code Copilot Chat with vision support and thinking process display
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Z.ai Chat Provider for VS Code

CI License: MIT VS Code

Integrates Z.ai (智谱AI) models into VS Code Copilot Chat with advanced features including vision support, tool calling, and thinking process display.

Features

  • Multiple Model Support

    • GLM-4.5: 131K context window, up to 96K output tokens
    • GLM-4.5 Air: 131K context window, up to 96K output tokens
    • GLM-4.6: 200K context window, up to 128K output tokens
    • GLM-4.7: 200K context window, up to 128K output tokens
    • GLM-4.7 Flash: Faster variant with 131K max output tokens
    • GLM-5: 200K context window, up to 128K output tokens
    • GLM-5.1: 200K context window, up to 128K output tokens
    • GLM-5-Turbo: 200K context window, up to 128K output tokens
    • GLM-5V-Turbo: Multimodal coding model with vision support
    • GLM-5-Code: 200K context window, up to 131K output tokens, optimized for coding
    • GLM-4.6V: Vision model (internal only, not exposed to users)
  • Advanced Capabilities

    • Tool calling support for VS Code chat participants
    • Streaming responses via Server-Sent Events (SSE)
    • Vision support via GLM-OCR and GLM-4.6V fallback
    • Thinking/reasoning process display (configurable)
    • Automatic image-to-text conversion for non-vision models
  • Secure API Key Management

    • Stored securely in VS Code SecretStorage
    • Managed via Command Palette (Z.ai: Manage Z.ai Provider)

Installation

From Marketplace (Coming Soon)

code --install-extension Ryosuke-Asano.zai-vscode-chat

From Source

  1. Clone the repository:
git clone https://github.com/Ryosuke-Asano/zai-provider-extension.git
cd zai-provider-extension
  1. Install dependencies:
npm install
  1. Compile the project:
npm run compile
  1. Package the extension:
npm run package
  1. Install the .vsix file:
code --install-extension zai-vscode-chat-*.vsix

Setup

  1. Open VS Code
  2. Open Command Palette (Cmd/Ctrl + Shift + P)
  3. Run Z.ai: Manage Z.ai Provider
  4. Enter your Z.ai API key

Get your API key from Z.ai Platform.

Usage

Once configured, select Z.ai as your chat provider in VS Code Copilot Chat:

  • Open the Chat view (Cmd/Ctrl + Alt + I)
  • Click the Pick Model button (Cmd/Ctrl + Alt + .)
  • Open Manage Language Models menu (⚙️)
  • Click Z.ai models under Z.ai category to "Show in the chat model picker"
  • Choose a Z.ai model (GLM-4.5, GLM-4.6, GLM-4.7, GLM-4.7 Flash, GLM-5, GLM-5-Turbo, GLM-5.1, GLM-5V-Turbo, or GLM-5-Code)
    • Note: GLM-4.6V is used internally for image processing and is not selectable

Configuration

Setting Type Default Description
zai.enableThinking boolean true Enable thinking/reasoning process display in chat responses

Supported Models

User-Selectable Models

Model Context Window Max Output Vision Tools
GLM-4.5 131,072 98,304 No Yes
GLM-4.5 Air 131,072 98,304 No Yes
GLM-4.6 200,000 131,072 No Yes
GLM-4.7 200,000 131,072 No Yes
GLM-4.7 Flash 200,000 131,072 No Yes
GLM-5 200,000 131,072 No Yes
GLM-5-Turbo 200,000 131,072 No Yes
GLM-5.1 200,000 131,072 No Yes
GLM-5V-Turbo 200,000 131,072 Yes Yes
GLM-5-Code 200,000 131,000 No Yes

Internal Models (Not Exposed)

Model Context Window Max Output Vision Tools Purpose
GLM-4.6V 128,000 16,000 Yes Yes Image analysis fallback for non-vision models

MCP Integration

This extension integrates with Z.ai's MCP (Model Context Protocol) servers:

  • web-search-prime: Web search capabilities
  • web-reader: URL to text/markdown conversion
  • zread: GitHub repository file reading
  • vision-mcp: Image analysis

Development

See CONTRIBUTING.md for detailed development guidelines.

Quick Start

# Install dependencies
npm install

# Watch for changes
npm run watch

# Run tests
npm test

# Lint code
npm run lint

# Format code
npm run format

Project Structure

src/
├── extension.ts    # Extension entry point, activation
├── provider.ts     # Main chat provider implementation
├── types.ts        # Type definitions and model configuration
├── mcp.ts          # MCP client for tool integration
└── utils.ts        # Utility functions for message/tool conversion

Requirements

  • VS Code 1.104.0 or later
  • Node.js 20 or later (for development)
  • Z.ai API key

Troubleshooting

Can't Access "Manage Language Models" Menu

If you don't see the ⚙️ Manage Language Models option in Copilot Chat, make sure you have Copilot set up and enabled in VS Code. See Set up Copilot for instructions.

API Key Issues

If you see authentication errors:

  1. Run Z.ai: Manage Z.ai Provider
  2. Verify your API key is correct
  3. Ensure your API key has active credits

Vision Not Working

For non-vision models (GLM-4.5, GLM-4.6, GLM-4.7, GLM-5, GLM-5.1, GLM-5-Code):

  • Images are automatically converted to text descriptions using GLM-OCR MCP
  • If GLM-OCR fails, the extension internally uses GLM-4.6V for image analysis
  • GLM-4.6V is not selectable by users—it is only used as an internal fallback

Large Context Errors

If you encounter token limit errors:

  • Reduce the amount of code/context in your message
  • The extension enforces model-specific context limits

Changelog

See CHANGELOG.md for version history.

License

MIT © 2025 Ryosuke Asano

License

Links

  • Repository
  • Issue Tracker
  • Z.ai Platform
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft