Skip to content

Commit fbe4a0e

Browse files
committed
feat(providers): add Ollama Cloud and Z.AI providers with newline-preserving streaming
- Add OllamaCloudProvider and ZAIProvider to ExtendedProviders.swift - Add ollamaCloud, zai, zaiCoding to ProviderType enum - Add provider configurations and UI support in EndpointManager and EndpointManagementView - Fix streaming to preserve newlines for proper markdown rendering - Update whats-new.json for 20260419.1 release
1 parent 34766b3 commit fbe4a0e

8 files changed

Lines changed: 725 additions & 60 deletions

File tree

Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
<key>CFBundlePackageType</key>
2020
<string>APPL</string>
2121
<key>CFBundleShortVersionString</key>
22-
<string>20260418.1</string>
22+
<string>20260419.1</string>
2323
<key>CFBundleVersion</key>
24-
<string>20260418.1</string>
24+
<string>20260419.1</string>
2525
<key>LSApplicationCategoryType</key>
2626
<string>public.app-category.productivity</string>
2727
<key>LSMinimumSystemVersion</key>

Resources/whats-new.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
{
22
"releases": [
3+
{
4+
"version": "20260419.1",
5+
"release_date": "April 19, 2026",
6+
"introduction": "Two new cloud AI providers are now available, Ollama Cloud and zAI. Configure them in Settings to get started.",
7+
"improvements": [
8+
{
9+
"id": "ollama-cloud-provider",
10+
"icon": "cloud",
11+
"title": "Ollama Cloud",
12+
"description": "Access hosted Ollama models directly. Great if you want the power of Ollama without running it yourself."
13+
},
14+
{
15+
"id": "zai-provider",
16+
"icon": "z.circle",
17+
"title": "Z.AI",
18+
"description": "A new option for chat and coding tasks. Includes support for chain-of-thought reasoning on supported models, which can help with complex problem-solving."
19+
},
20+
{
21+
"id": "markdown-streaming-fix",
22+
"icon": "text.alignleft",
23+
"title": "Fixed Markdown Formatting",
24+
"description": "Responses from cloud providers now display with proper line breaks, so headers, lists, and code blocks render correctly instead of running together."
25+
}
26+
],
27+
"bugfixes": []
28+
},
329
{
430
"version": "20260418.1",
531
"release_date": "April 18, 2026",

Sources/APIFramework/AIProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public struct ResponseNormalizer {
115115
) throws -> ServerOpenAIChatResponse {
116116

117117
switch providerType {
118-
case .openai, .localLlama, .localMLX, .gemini, .openrouter, .minimax:
118+
case .openai, .localLlama, .localMLX, .gemini, .openrouter, .minimax, .ollamaCloud, .zai, .zaiCoding:
119119
/// Already in OpenAI format or uses OpenAI format.
120120
if let openAIResponse = providerResponse as? ServerOpenAIChatResponse {
121121
return openAIResponse

Sources/APIFramework/EndpointManager.swift

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,39 @@ public class EndpointManager: ObservableObject {
893893
models: []
894894
)
895895

896+
case .ollamaCloud:
897+
return ProviderConfiguration(
898+
providerId: "ollama-cloud",
899+
providerType: .ollamaCloud,
900+
isEnabled: false,
901+
baseURL: "https://ollama.com/v1",
902+
models: ["gemma4:31b", "llama3.1:70b", "qwen2.5:72b"],
903+
maxTokens: 131072,
904+
temperature: 0.7
905+
)
906+
907+
case .zai:
908+
return ProviderConfiguration(
909+
providerId: "zai",
910+
providerType: .zai,
911+
isEnabled: false,
912+
baseURL: "https://api.z.ai/api/paas/v4",
913+
models: ["glm-5.1", "glm-4.9"],
914+
maxTokens: 131072,
915+
temperature: 1.0
916+
)
917+
918+
case .zaiCoding:
919+
return ProviderConfiguration(
920+
providerId: "zai-coding",
921+
providerType: .zaiCoding,
922+
isEnabled: false,
923+
baseURL: "https://api.z.ai/api/coding/paas/v4",
924+
models: ["glm-5.1", "glm-4.9"],
925+
maxTokens: 131072,
926+
temperature: 1.0
927+
)
928+
896929
case .custom:
897930
return ProviderConfiguration(
898931
providerId: "custom",
@@ -940,6 +973,15 @@ public class EndpointManager: ObservableObject {
940973
logger.error("ENDPOINT_ERROR: Skipping this provider - please reconfigure through Preferences UI")
941974
return nil
942975

976+
case .ollamaCloud:
977+
return OllamaCloudProvider(config: config)
978+
979+
case .zai:
980+
return ZAIProvider(config: config)
981+
982+
case .zaiCoding:
983+
return ZAIProvider(config: config)
984+
943985
case .custom:
944986
return CustomProvider(config: config)
945987
}

0 commit comments

Comments
 (0)