Skip to content

Comments

feat: add ZAI provider via OpenAI-compatible base_url; enable --api-type zai; update env example and docs#1

Draft
codegen-sh[bot] wants to merge 1 commit intomainfrom
codegen-bot/add-zai-provider-581620
Draft

feat: add ZAI provider via OpenAI-compatible base_url; enable --api-type zai; update env example and docs#1
codegen-sh[bot] wants to merge 1 commit intomainfrom
codegen-bot/add-zai-provider-581620

Conversation

@codegen-sh
Copy link

@codegen-sh codegen-sh bot commented Sep 22, 2025

Summary

  • Add a dedicated zai provider to configs/oai_config.py using OpenAIWrapper with base_url override
  • Insert zai into DEFAULT_PROVIDER_PRIORITY (after openai)
  • Expose --api-type zai in configs/mode_config.py
  • Add ZAI env placeholders to configs/env.example
  • Minimal usage notes in README.md and USAGE.md

How it works

  • The ZAI provider reuses the existing OpenAI-compatible pathway (autogen OpenAIWrapper) by reading ZAI_API_KEY, ZAI_MODEL, and ZAI_BASE_URL
  • You can select it via DEFAULT_API_PROVIDER=zai or --api-type zai
  • Alternatively, keep api_type=openai and set OPENAI_BASE_URL to your Z proxy for zero-code-change usage

Validation

  • Imported configs/oai_config.py locally to ensure syntax correctness
  • Verified CLI --api-type zai appears in help and flows into get_llm_config
  • Repo setup remains backward-compatible; no breaking changes

Setup notes

  • Add to configs/.env (do not commit secrets):
    • ZAI_API_KEY=[REDACTED]
    • ZAI_MODEL=glm-4.5 (or your proxy’s model name)
    • ZAI_BASE_URL=https://<your-z-proxy>/v1
  • Ensure SERPER_API_KEY and JINA_API_KEY are present for deep search functionality

Next steps (optional)

  • If desired, I can add a small smoke test that constructs the OpenAIWrapper with --api-type zai and performs a no-op call behind a --skip-config-check toggle.

💻 View my work • 👤 Initiated by @ZeeeepaAbout Codegen
⛔ Remove Codegen from PR🚫 Ban action checks


Summary by cubic

Adds a ZAI provider using the OpenAI-compatible path via base_url. Select it with --api-type zai or DEFAULT_API_PROVIDER=zai; env templates and docs include quick setup.

  • New Features
    • Adds 'zai' provider (OpenAI-compatible) reading ZAI_API_KEY, ZAI_MODEL, ZAI_BASE_URL.
    • Places 'zai' after 'openai' in DEFAULT_PROVIDER_PRIORITY and exposes --api-type zai.
    • Updates configs/env.example, README.md, and USAGE.md with setup and the OPENAI_BASE_URL proxy option.

…ype zai; update env example and docs

Co-authored-by: Zeeeepa <zeeeepa@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Sep 22, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant