Add Z AI provider with chat_zai() and models_zai()#923
Conversation
2046afc to
4204762
Compare
|
I guarded the |
|
I've never heard of z.ai before. Could you give me some reassurance that it's at least reasonably commonly used and worth adding to ellmer? |
|
Hi, Z.ai got some big momentum ealier this year and very nice coding plan. https://z.ai/subscribe The Z.ai subreddit does have a 26k weekly visits and over 300 weekly contributions. I personally have used both the Coding Plan and API since Jan 2026 and have no compliants! |
|
@lazasaurus-ai the reddit argument is compelling. Thanks! @thisisnic can you please add this PR to your to do list? |
Will do! |
|
Thanks for the PR @lazasaurus-ai! Looks like you may have forgotten to commit some files - the PR description mentions tests, but I don't see them here? |
Implements suppo# Add Z AI Provider
This PR adds support for Z AI's GLM models to ellmer.
Features
chat_zai()function for Z AI GLM modelsmodels_zai()function to list available modelshttps://api.z.ai/api/coding/paas/v4https://api.z.ai/api/paas/v4– For usage-based planshttps://open.bigmodel.cn/api/coding/paas/v4https://open.bigmodel.cn/api/paas/v4message.reasoning_contentcompletion_tokens_details.reasoning_tokensModels Supported
Implementation Details
ProviderOpenAICompatiblefor OpenAI-compatible APIvalue_tokens()to extract reasoning tokensvalue_turn()to handle reasoning contentTesting
tests/testthat/test-provider-zai.RDocumentation
R/provider-zai.Randman/chat_zai.RdExample