ReqLLM. Providers. ZaiCodingPlan
(ReqLLM v1.12.0)
View Source
Z.AI Coding Plan provider – alias for zai_coder.
This provider is an alias that delegates to the ZaiCoder provider implementation. It uses the same API endpoint and configuration as zai_coder.
Implementation
This provider uses the Z.AI coding endpoint (/api/coding/paas/v4) which is
optimized for code generation and technical tasks.
Supported Models
- glm-4.5 - Advanced reasoning model with 131K context
- glm-4.5-air - Lighter variant with same capabilities
- glm-4.5-flash - Free tier model with fast inference
- glm-4.5v - Vision model supporting text, image, and video inputs
- glm-4.6 - Latest model with 204K context and improved reasoning
- glm-4.6v - Vision variant of glm-4.6
- glm-4.7 - Latest model with 204K context
Configuration
# Add to .env file (automatically loaded)
ZAI_API_KEY=your-api-keyProvider Options
The following options can be passed via provider_options:
:thinking- Map to control the thinking/reasoning mode. Set to%{type: "disabled"}to disable thinking mode for faster responses, or%{type: "enabled"}to enable extended reasoning.
Example:
ReqLLM.generate_text("zai_coding_plan:glm-4.7", context,
provider_options: [thinking: %{type: "disabled"}]
)
Summary
Functions
Default implementation of attach/3.
Default implementation of attach_stream/4.
Default implementation of build_body/1.
Default implementation of decode_response/1.
Default implementation of decode_stream_event/2.
Callback implementation for ReqLLM.Provider.default_env_key/0.
Default implementation of encode_body/1.
Default implementation of extract_usage/2.
Default implementation of prepare_request/4.
Default implementation of translate_options/3.
Functions
Default implementation of attach/3.
Sets up Bearer token authentication and standard pipeline steps.
Default implementation of attach_stream/4.
Builds complete streaming requests using OpenAI-compatible format.
Default implementation of build_body/1.
Builds request body using OpenAI-compatible format for chat and embedding operations.
Default implementation of decode_response/1.
Handles success/error responses with standard ReqLLM.Response creation.
Default implementation of decode_stream_event/2.
Decodes SSE events using OpenAI-compatible format.
Callback implementation for ReqLLM.Provider.default_env_key/0.
Default implementation of encode_body/1.
Encodes request body using OpenAI-compatible format for chat and embedding operations.
Default implementation of extract_usage/2.
Extracts usage data from standard usage field in response body.
Default implementation of prepare_request/4.
Handles :chat, :object, and :embedding operations using OpenAI-compatible patterns.
Default implementation of translate_options/3.
Pass-through implementation that returns options unchanged.