承接 mralaminahamed/ai-provider-for-opencode-zen 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mralaminahamed/ai-provider-for-opencode-zen

Composer 安装命令:

composer require mralaminahamed/ai-provider-for-opencode-zen

包简介

AI Provider for OpenCode Zen — an independent OpenCode Zen integration for the WordPress AI Client.

README 文档

README

An independent, third-party OpenCode Zen provider for the WordPress PHP AI Client SDK. Works as both a Composer package and a WordPress plugin. Not affiliated with, endorsed by, or sponsored by OpenCode Zen.

Requirements

  • PHP 7.4 or higher
  • WordPress 7.0 or higher (AI Client SDK is included in WordPress core)

Installation

As a WordPress Plugin

  1. Download the plugin zip
  2. Go to Plugins > Add New > Upload Plugin in your WordPress admin
  3. Upload and activate

As a Composer Package

composer require mralaminahamed/ai-provider-for-opencode-zen

Configuration

WordPress Admin

Go to Settings > OpenCode Zen to configure:

Setting Description Default
API Key Your OpenCode Zen API key
Default Model Model used when none is specified First available
Temperature Output randomness (0.0–2.0) 1.0
Max Tokens Maximum response length 2048
Top P Nucleus sampling threshold (0.0–1.0) 1.0
Presence Penalty Penalise repeated topics (-2.0–2.0) 0.0
Frequency Penalty Penalise repeated tokens (-2.0–2.0) 0.0

Environment Variable

OPENCODE_ZEN_API_KEY takes priority over the database setting:

export OPENCODE_ZEN_API_KEY=your-api-key

Get your API key at opencode.ai/zen/settings/api-keys.

Usage

With WordPress (automatic)

The provider registers itself on the init hook. No manual setup required beyond entering your API key.

use WordPress\AiClient\AiClient;

$result = AiClient::prompt('Explain quantum computing')
    ->usingProvider('opencode-zen')
    ->generateTextResult();

echo $result->toText();

As a Standalone Composer Package

use WordPress\AiClient\AiClient;
use AlAminAhamed\OpenCodeZenAiProvider\Provider\OpenCodeZenProvider;

$registry = AiClient::defaultRegistry();
$registry->registerProvider(OpenCodeZenProvider::class);

putenv('OPENCODE_ZEN_API_KEY=your-api-key');

$result = AiClient::prompt('Explain quantum computing')
    ->usingProvider('opencode-zen')
    ->generateTextResult();

echo $result->toText();

Supported Models

Models are discovered dynamically from the OpenCode Zen API (cached for 1 hour). The fallback list includes 41 models:

  • GPT 5.x — GPT 5.5, GPT 5.4, GPT 5.3 Codex, GPT 5.2, GPT 5.1, GPT 5, and variants
  • Claude 4.x — Opus 4.7/4.6/4.5/4.1, Sonnet 4.6/4.5/4, Haiku 4.5, and Claude 3.5 Haiku
  • Gemini 3.x — Gemini 3.5 Flash, 3.1 Pro, 3 Flash
  • Other — Qwen, MiniMax M2, GLM 5.1, Kimi K2, Grok, DeepSeek, Nemotron

Architecture

includes/
  Provider/
    OpenCodeZenProvider.php          # Registers provider ID "opencode-zen"
    OpenCodeZenTextGenerationModel.php  # OpenAI-compatible text generation
  Metadata/
    OpenCodeZenModelMetadataDirectory.php  # API model discovery + transient cache
  Settings/
    OpenCodeZenSettings.php          # WP admin settings page (logic only)
templates/
  admin/
    settings-page.php                # <form> wrapper
    section-general.php              # Section description
    field-model.php                  # Model <select>
    field-temperature.php            # Temperature <input>
    field-max-tokens.php             # Max tokens <input>
    field-top-p.php                  # Top P <input>
    field-presence-penalty.php       # Presence penalty <input>
    field-frequency-penalty.php      # Frequency penalty <input>

Settings page: options-general.php?page=opencode-zen-settings Option key: opencode_zen_settings

Development

# Install dependencies
composer install

# Run tests
composer test

# Lint
composer phpcs

# Auto-fix lint issues
composer phpcbf

# Static analysis
composer phpstan

# Build release zip
composer release

The release script runs composer install --no-dev --optimize-autoloader so only the plugin's own classmap is in the vendor directory — the AI Client SDK is excluded entirely (it is provided by WordPress 7.0+ at runtime).

License

GPL-2.0-or-later

mralaminahamed/ai-provider-for-opencode-zen 适用场景与选型建议

mralaminahamed/ai-provider-for-opencode-zen 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 mralaminahamed/ai-provider-for-opencode-zen 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mralaminahamed/ai-provider-for-opencode-zen 我们能提供哪些服务?
定制开发 / 二次开发

基于 mralaminahamed/ai-provider-for-opencode-zen 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 34
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-04-30