Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.zgi.cn/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Agents, workflows, knowledge bases, and developer APIs in ZGI all rely on model capabilities. Model gateway unifies different model suppliers, official channels, enterprise private channels, custom models, API keys, default models, call billing and connectivity testing into the same governance system, allowing teams to access, select and manage models in a consistent way.
Understand in one sentence The model gateway is an integrated call portal suitable for multiple models: it provides an OpenAI compatible experience to the outside world and completes supplier adaptation, channel routing, model availability management, quota deduction and call tracking internally.

What is model gateway

core objectillustrate
ProviderManage OpenAI, Anthropic, Google, domestic model service providers and enterprise custom suppliers
ModelUnified recording of model name, capability type, context window, input/output price, capability label, availability and enabled status
ChannelHosts real call credentials, Base URL, model list, priority, weight, balance and connectivity status
API KeyCall credentials for developers or business systems, configurable quota, expiration time, model range and IP whitelist
Default ModelSet default models according to dialogue, vector, rearrangement, visual, drawing and other purposes to reduce application configuration costs
BillingThe amount is withheld before the call is made. After the call is completed, the settlement is based on the actual Token, model price and channel information.

Key components of model gateway

moduleAbility description
Supplier managementView supplier lists and details, enable/disable suppliers, create, update, and delete enterprise custom suppliers
Model managementSearch models by vendor, purpose, capability, input/output modality, status, enable/disable single or batch models
custom modelEnter the name, purpose, context window, price, endpoints, and parameter capabilities of a private or compatible model
Default modelConfigure default models for scenarios such as dialogue, vectors, rearrangement, vision, and drawings. The system also supports automatic parsing of available models.
Channel managementCreate an organization private channel and configure API Key, Base URL, model mapping, priority, weight and label
Official channelView the platform’s official channels and available models, and adjust the priority, weight and activation status of the official channel group
Connectivity testSupports channel testing, specified model testing, draft testing and multi-model batch testing, returning success status and response time
call credentialsCreate and manage LLM API Key, supporting quotas, model restrictions, IP whitelist, expiration time and status control

Supported model types and uses

Type/purposeillustrate
Large Language Model/Text DialogueFor agent dialogue, workflow LLM nodes, text generation and structured understanding
Embedding/Vector ModelUsed for knowledge base vectorization, semantic search and similarity recall
Rerank / Rerank modelUsed to rearrange knowledge base search results to improve the hit quality of complex problems
Visual ModelUsed for picture understanding, picture and text question answering and document image analysis
Image generation modelUsed to prompt word generation graphs and workflow image generation nodes
Speech to Text/Text to SpeechUsed for voice input, voice broadcast and multi-modal interaction
Real-time voice, video generation, reviewFor extended scenarios such as real-time audio, video generation and content security

Routing and degradation

ZGI implements model call routing through the priority and weight of the channel. Priority is used to determine the channel selection sequence, and weight is used to distribute traffic among channels with the same priority. Enterprises can configure official channels and private channels at the same time to strike a balance between cost, stability, regional compliance and supplier redundancy.
  • Channel Enable/Deactivate — Quickly remove abnormal channels from routing
  • Model Mapping — Maps the platform model name to the supplier’s real model name, compatible with naming differences between different service providers
  • Parameter and Header Override — Attach request parameters or headers to a specific channel
  • Connectivity Test — Verify the callability of single or multiple models before going online to reduce runtime failures
  • Official Channel Monitoring — The backend supports channel event streaming, and the gateway instance can receive changes such as channel creation, update, enablement, and disabling.

How to access the model

View existing models

Enter “Model Management” to view existing suppliers and models, and confirm whether the required model is already in the platform metadata.

Use official channels

Enter “Channel” to confirm whether the official channel group is enabled and view the models available on the platform.

Access the company’s own account

Create an organization private channel and fill in the provider, API Key, Base URL, and model list.

Perform connectivity tests

Perform channel testing or specified model testing to confirm that methods such as chat, embedding, image-gen, and rerank are available.

Enable and configure default models

Enable the model in “Model Management” and create a custom model if necessary; set the default model in “Default Model” for dialogue, vector, rearrangement, visual, drawing and other purposes.

Create calling credentials

Create an API Key for developers or system integration, and limit model scope, quota, validity period, and source IP.

OpenAI compatible calls

The goal of Model Gateway is to reduce developer integration costs. Developers can use unified model names, unified authentication methods, and unified call semantics to access different supplier models; the platform side is responsible for supplier adaptation, model mapping, routing, billing, and tracking. For systems that already have OpenAI SDK, compatible access methods can be used first and gradually migrate to the underlying multi-vendor capabilities.
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_ZGI_API_KEY",
    base_url="https://api.zgi.cn/v1"  # or local: http://localhost:2678/v1
)

response = client.chat.completions.create(
    model="zgi-default",
    messages=[{"role": "user", "content": "Summarize the key terms of this contract"}],
)

print(response.choices[0].message.content)

Costs and Tracking

  • Model metadata records input_price, output_price, cached_input_price, context window and maximum output Token
  • Call settlement record model, supplier, channel, request ID, response time, token usage, cost and status
  • The API Key dimension can record the used quota and remaining quota, making it easy to track by system, application or integration party.
  • Private channels support balance adjustment, which is suitable for scenarios where enterprises bring their own model accounts or settle by channel.

Typical scenario

sceneConfiguration recommendations
Multi-vendor disaster recoveryConfigure multiple channels for the same model purpose and quickly switch when a single supplier is unavailable
Cost StratificationUse cost-effective models for daily tasks, and use flagship models for complex reasoning or high-value scenarios.
Private model accessIncorporate on-premises or enterprise-specific models into the unified model selector
R&D IntegrationProvide a unified model calling entrance for internal systems through API Key, and control risks by model and quota
Knowledge Base EnhancementsUniformly configure the Embedding and Rerank models to ensure the indexing and recall quality of RAG

Advantages of ZGI Model Gateway

  • Unify suppliers, models, channels and API Key to reduce the engineering complexity of multi-model access
  • Model metadata is rich and can be filtered by purpose, modality, capability, price, context window and availability
  • Official channels and private channels coexist, which can not only quickly use platform capabilities, but also access the company’s own resources
  • Connectivity testing and batch testing in advance reduce the risk of call failure after release
  • Linked with the Expense Center to form a complete closed loop of pre-call inspection, post-call settlement, and bill tracking