{"id":48830097,"url":"https://github.com/selfagency/z-models-vscode","last_synced_at":"2026-04-22T03:02:13.390Z","repository":{"id":351340637,"uuid":"1210563253","full_name":"selfagency/z-models-vscode","owner":"selfagency","description":"Access Z.ai models within GitHub Copilot Chat","archived":false,"fork":false,"pushed_at":"2026-04-14T16:16:28.000Z","size":197,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-14T17:07:38.391Z","etag":null,"topics":["ai","chat","chatbot","copilot","github-copilot","github-copilot-chat","llm","vscode","vscode-extension","zai","zhipu"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/selfagency.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-14T14:36:24.000Z","updated_at":"2026-04-14T16:15:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/selfagency/z-models-vscode","commit_stats":null,"previous_names":["selfagency/z-models-vscode"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/selfagency/z-models-vscode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfagency%2Fz-models-vscode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfagency%2Fz-models-vscode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfagency%2Fz-models-vscode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfagency%2Fz-models-vscode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selfagency","download_url":"https://codeload.github.com/selfagency/z-models-vscode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selfagency%2Fz-models-vscode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31812977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chat","chatbot","copilot","github-copilot","github-copilot-chat","llm","vscode","vscode-extension","zai","zhipu"],"created_at":"2026-04-14T20:00:53.413Z","updated_at":"2026-04-22T03:02:13.382Z","avatar_url":"https://github.com/selfagency.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Z.ai for Copilot\n\n[![Tests](https://github.com/selfagency/z-models-vscode/actions/workflows/ci.yml/badge.svg)](https://github.com/selfagency/z-models-vscode/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/selfagency/z-models-vscode/graph/badge.svg?token=0gHudqeY4p)](https://codecov.io/gh/selfagency/z-models-vscode)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo.png\" alt=\"Z.ai Logo\" width=\"128\" height=\"auto\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eAccess Z.ai (Zhipu) coding models within GitHub Copilot Chat\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://z.ai\"\u003e🌐 Z.ai\u003c/a\u003e •\n  \u003ca href=\"https://docs.z.ai/api-reference\"\u003e📖 API Docs\u003c/a\u003e •\n  \u003ca href=\"https://z.ai/manage-apikey/apikey-list\"\u003e🔑 Get API Key\u003c/a\u003e\n\u003c/p\u003e\n\n## ✨ Features\n\n- 🧠 **Coding Plan Models** - Uses models exposed by the Z.ai Coding endpoint for Coding Plan usage\n- 🔀 **Model Picker** - Select Z models via the model selector dropdown on any Copilot Chat conversation\n- 💬 **Chat Participant** - Invoke `@z` directly in Copilot Chat for a dedicated, history-aware Z conversation\n- 🔧 **Tool Calling** - Function calling support for agentic workflows\n- 🖼️ **Vision via MCP** - Image understanding is routed through the Vision MCP server in coding workflows\n- 🔒 **Secure** - API key stored using VS Code's encrypted secrets API\n- ⚡ **Streaming** - Real-time response streaming for faster interactions\n- 📊 **Usage Status Bar** - Status bar item tracks subscription usage limits\n\n## ⚠️ For Coding Plan users only\n\nDue to Z.ai Coding Plan restrictions, this extension is intentionally scoped to coding usage:\n\n- It uses the dedicated Coding endpoint: `https://api.z.ai/api/coding/paas/v4`\n- It only supports Coding Plan model availability (coding models), not the full general API catalog\n- Vision/image workflows are provided through the Vision MCP server\n\n## 🔧 Requirements\n\n- **VS Code** 1.109.0 or higher\n- **GitHub Copilot Chat** extension installed (required)\n- A valid **Z.ai API key**\n\n## 🚀 Installation\n\n1. **Install from VS Code Marketplace** (or install the `.vsix` file)\n2. **Open Command Palette** (`Ctrl+Shift+P` / `Cmd+Shift+P`)\n3. **Run:** `Z: Manage API Key`\n4. **Enter your API key** from [z.ai](https://z.ai/manage-apikey/apikey-list)\n5. *(Optional)* **Run:** `Z: Manage Settings` to view coding-endpoint behavior details\n\n## 🔑 Getting Your API Key\n\n1. Go to [Z.ai Console](https://z.ai/manage-apikey/apikey-list)\n2. Sign up or log in with your account\n3. Navigate to **API Keys** section\n4. Click **Create new key**\n5. Copy the key and paste it into VS Code when prompted\n\n## 💬 Usage\n\n### Model Picker\n\nTo use a Z model in an existing Copilot Chat conversation without the `@z` handle:\n\n1. Open **GitHub Copilot Chat** panel in VS Code\n2. Click the **model selector** dropdown\n3. Choose a **Z.ai** model\n4. Start chatting!\n\n### Chat Participant\n\nType `@z` in any Copilot Chat input to direct the conversation to Z.ai. The participant is sticky — once invoked, it stays active for the thread.\n\n```text\n@z explain the architecture of this project\n```\n\n### Usage Status Bar\n\nWhen a `Z_API_KEY` is configured, the extension shows a usage item on the right side of the status bar. Click the status bar item to toggle between hourly and weekly views.\n\nTooltip includes:\n\n- Token quota windows and progress bars\n- MCP time-limit usage windows\n- Last updated time\n\nYou can also refresh usage manually via command palette:\n\n- `Z: Refresh Usage Stats`\n\nRelated settings:\n\n- `zModels.usage.enabled`\n- `zModels.usage.refreshInterval`\n\n### Advanced `modelOptions` support\n\nThis provider supports the following `modelOptions` keys (used internally by VS Code model requests and useful for extension contributors):\n\n- `temperature: number`\n- `topP: number`\n- `safePrompt: boolean`\n\nThinking controls:\n\n- `thinking: boolean` (`false` maps to `thinking.type = \"disabled\"`)\n- `thinkingType: \"enabled\" | \"disabled\"`\n- `clearThinking: boolean` (alias: `clear_thinking`)\n\nStructured output:\n\n- `jsonMode: boolean` (maps to `response_format: { type: \"json_object\" }`)\n- `responseFormat: \"json_object\" | { type: \"json_object\" }`\n\nWeb search tool:\n\n- `webSearch: boolean | object` (alias: `web_search`)\n  - `true` enables default web search tool config\n  - object passes through as `web_search` tool configuration\n\nNotes:\n\n- Requests use streaming (`stream: true`) and tool streaming (`tool_stream: true`) when tools are present.\n- Tool calls are assembled incrementally from SSE deltas and emitted as soon as arguments become valid JSON.\n- Cache usage is automatic server-side; cached prompt token counts are logged when returned by the API (`usage.prompt_tokens_details.cached_tokens`).\n- Token counting in VS Code uses a compatible approximation (`cl100k_base`) and should be treated as an estimate for GLM models.\n\n## 🛡️ Privacy \u0026 Security\n\n- Your API key is stored securely using VS Code's encrypted secrets API\n- No data is stored by this extension - all requests go directly to Z.ai\n- See [Z.ai Privacy Policy](https://docs.z.ai/legal-agreement/privacy-policy) for details\n\n## 🎛️ MCP Servers\n\nThis extension supports Model Context Protocol (MCP) servers for enhanced capabilities:\n\n- **Vision MCP**: Image processing and analysis\n- **Search MCP**: Web and code search capabilities\n- **Reader MCP**: Document reading and PDF processing\n- **ZRead MCP**: Advanced reading and contextual analysis\n\nWhen an image is attached in chat and Vision MCP is enabled, the extension prefers MCP-based image analysis for Coding Plan compatibility.\n\n### Configure MCP Servers\n\nYou can enable/disable MCP servers in VS Code settings:\n\n1. Open VS Code Settings (`Ctrl+,` or `Cmd+,`)\n2. Search for \"Z.ai\"\n3. Enable/disable individual MCP servers as needed\n\n### Troubleshooting\n\n- **`command 'z-chat.manageApiKey' not found`**\n  - Ensure you are running the latest extension build and reload VS Code (`Developer: Reload Window`).\n  - This usually indicates extension activation failed before command registration.\n\n- **Selecting Z.ai in Model Manager does nothing**\n  - This is typically the same activation issue as above; update/reload the extension first.\n\n- **No registered MCP servers**\n  - MCP server definitions are registered eagerly, but they are only resolvable/startable after a valid API key is stored.\n  - MCP registration depends on VS Code builds that include MCP provider APIs. In builds without that API, the extension still works for chat/models, but MCP server registration is skipped.\n\n## 🛠️ Development\n\n### Prerequisites\n\n- [Node.js](https://nodejs.org/) 20+\n- [pnpm](https://pnpm.io/) (version pinned in `package.json`)\n- [VS Code](https://code.visualstudio.com/) 1.109.0+\n\n### Build\n\n```bash\npnpm install\npnpm run compile        # type-check + lint + bundle\npnpm run watch          # parallel watch for type-check and bundle\n```\n\n### Testing\n\n```bash\npnpm test               # unit tests (Vitest)\npnpm run test:coverage  # unit tests with coverage\npnpm run test:extension # VS Code integration tests\n```\n\n### Debugging\n\nOpen the project in VS Code and press **F5** to launch the Extension Development Host with the extension loaded.\n\n## 📄 License\n\nMIT License - See [LICENSE](LICENSE) for details.\n\nMaintained by [Daniel Sieradski](https://self.agency) ([@selfagency](https://github.com/selfagency)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfagency%2Fz-models-vscode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselfagency%2Fz-models-vscode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselfagency%2Fz-models-vscode/lists"}