Mythosia.AI.Providers.Alibaba
3.0.0
dotnet add package Mythosia.AI.Providers.Alibaba --version 3.0.0
NuGet\Install-Package Mythosia.AI.Providers.Alibaba -Version 3.0.0
<PackageReference Include="Mythosia.AI.Providers.Alibaba" Version="3.0.0" />
<PackageVersion Include="Mythosia.AI.Providers.Alibaba" Version="3.0.0" />
<PackageReference Include="Mythosia.AI.Providers.Alibaba" />
paket add Mythosia.AI.Providers.Alibaba --version 3.0.0
#r "nuget: Mythosia.AI.Providers.Alibaba, 3.0.0"
#:package Mythosia.AI.Providers.Alibaba@3.0.0
#addin nuget:?package=Mythosia.AI.Providers.Alibaba&version=3.0.0
#tool nuget:?package=Mythosia.AI.Providers.Alibaba&version=3.0.0
Mythosia.AI.Providers.Alibaba
Call Qwen-compatible chat endpoints on DashScope, vLLM or Ollama while keeping the shared AIService conversation, streaming and tool workflows. QwenService adds provider-specific thinking controls and custom deployment names.
Current release: 3.0.0
Requires Mythosia.AI 8.0.0, which brings Mythosia.AI.Abstractions 4.0.0 transitively. Review the v8 migration guide and rebuild callers for the inherited completion and Run contract changes.
Prepare different settings with an immutable CreateRequest(...) builder, pass cancellation to stop cooperative client work, and read (await run.Result).Text for a Run answer. The completed AIRunResult also retains reported usage, sources, requested/actual model, rounds and finish details without requiring a stream reader. Ordinary GetCompletionAsync still returns a string. Request settings · Run migration · Completion cancellation.
Qwen uses the shared local tool executor: asynchronous methods can return objects, cancellation-aware handlers receive the execution token, and failures become failed tool results. Cleanup can wait for tools that ignore cancellation; remote inference or billing cancellation is not guaranteed. See the tool contract.
Inspect service.GetCapabilities() or request.GetCapabilities() before showing model controls. Snapshots use captured Qwen settings and the endpoint's actual model ID; unknown custom deployments remain Unknown. Inspection does not send requests or consume pending settings. This adapter retains provider-specific ThinkingMode controls; native steering, hosted search and image generation are not integrated. See capability inspection.
Shared stream validation rejects content or changed finish reasons after an explicit terminal event before saving history or executing tools. The final delta in the first terminal event and trailing usage-only events remain valid. See the v3.0.0 release notes.
Features
- Qwen chat completion support through
QwenService - Streaming response support with token usage reporting (
TokenUsage) - Ordered multi-function calling in non-streaming and streaming flows, with sequential or bounded-parallel local handler execution inherited from the core policy
- Shared
Mythosia.AIconversation and message abstractions - Thinking-mode control that is sent as configured, without model-name guessing
- Compatible endpoint handling for
DashScope,vLLM, andOllama
Installation
dotnet add package Mythosia.AI.Providers.Alibaba
Model Catalog
The provider now includes a broader built-in model catalog for Qwen 3 and Qwen 3.5 families.
service.ChangeModel(AlibabaModels.Qwen3_32B);
service.ChangeModel(AlibabaModels.Qwen3_5_27B);
service.ChangeModel(AlibabaModels.Qwen3_5_397B);
Thinking Mode Behavior
QwenService sends whatever ThinkingMode you configured, translated into the platform's request format.
| Platform | Thinking On | Thinking Off |
|---|---|---|
| DashScope | enable_thinking = true |
enable_thinking = false |
| vLLM | chat_template_kwargs.enable_thinking = true |
chat_template_kwargs.enable_thinking = false |
| Ollama | reasoning.effort = "high" |
(parameter omitted) |
When thinking is off, DashScope and vLLM receive an explicit enable_thinking = false, preventing the server default from enabling reasoning unexpectedly.
The model name is not treated as a capability signal. Operators can choose any served name through vLLM --served-model-name, aliases, or a gateway. QwenService therefore sends the configured ThinkingMode without guessing from the model ID; an unsupported endpoint can ignore or reject the setting instead of the caller's instruction disappearing silently.
Request-Scoped Reasoning Control
When you are using the shared AIRequestProfile APIs from Mythosia.AI, QwenService can disable reasoning for a single call without changing the long-lived service configuration.
var answer = await service.GetCompletionAsync(
"Summarize this policy without reasoning output.",
new AIRequestProfile
{
DisableReasoning = true
});
Quick Start with vLLM
using System.Net.Http;
using Mythosia.AI.Providers.Alibaba;
var httpClient = new HttpClient();
var service = new QwenService("http://localhost:8000", EndpointPlatform.Vllm, httpClient)
.UseQwen3_32BModel();
var response = await service.GetCompletionAsync("Hello, Qwen!");
Console.WriteLine(response);
Quick Start with Ollama
using System.Net.Http;
using Mythosia.AI.Providers.Alibaba;
var httpClient = new HttpClient();
var service = new QwenService("http://localhost:11434", EndpointPlatform.Ollama, httpClient)
.UseQwen3_32BModel();
var response = await service.GetCompletionAsync("Hello, Qwen!");
Console.WriteLine(response);
Configure Thinking Mode
using System.Net.Http;
using Mythosia.AI.Providers.Alibaba;
var httpClient = new HttpClient();
var service = new QwenService("http://localhost:11434", EndpointPlatform.Ollama, httpClient)
{
ThinkingMode = QwenThinking.On
};
Using Quantized or Custom Model Names
Some Qwen deployments do not use the default public model identifier.
Examples:
- Quantized variants such as
qwen3:32b-q4_K_M - Custom deployment names from a gateway or self-hosted endpoint
- Provider-specific aliases that differ from the built-in
AlibabaModelsconstants
In those cases, keep the service configured normally and set ModelIdOverride to the exact deployed model name that your endpoint expects.
using System.Net.Http;
using Mythosia.AI.Providers.Alibaba;
var httpClient = new HttpClient();
var service = new QwenService("http://localhost:11434", EndpointPlatform.Ollama, httpClient)
{
ThinkingMode = QwenThinking.On,
ModelIdOverride = "qwen3:32b-q4_K_M"
};
var response = await service.GetCompletionAsync("Summarize this document.");
You can also combine a built-in base model selection with a different runtime model ID:
using System.Net.Http;
using Mythosia.AI.Providers.Alibaba;
var httpClient = new HttpClient();
var service = new QwenService("http://localhost:8000", EndpointPlatform.Vllm, httpClient)
.UseQwen3_32BModel();
service.ModelIdOverride = "my-qwen3-32b-awq";
var response = await service.GetCompletionAsync("Explain this code.");
This is useful when:
- The displayed deployment name is different from the public Qwen model name
- You are routing through Ollama, vLLM, or a custom proxy
- You want to use a quantized build while keeping the general service configuration readable
How Model Names Behave on Ollama
When EndpointPlatform.Ollama is used, built-in model names are automatically converted to Ollama-style IDs.
Example:
qwen3-32b→qwen3:32b
If your Ollama model name is not the default converted name, set ModelIdOverride explicitly.
Streaming Example
using System.Net.Http;
using Mythosia.AI.Providers.Alibaba;
var httpClient = new HttpClient();
var service = new QwenService("http://localhost:8000", EndpointPlatform.Vllm, httpClient)
.UseQwen3_32BModel();
await foreach (var chunk in service.StreamAsync("Explain transformers simply."))
{
if (!string.IsNullOrWhiteSpace(chunk))
Console.Write(chunk);
}
Function Calling Example
using System.Net.Http;
using Mythosia.AI.Extensions;
using Mythosia.AI.Providers.Alibaba;
var httpClient = new HttpClient();
var service = new QwenService("http://localhost:8000", EndpointPlatform.Vllm, httpClient)
.UseQwen3_32BModel()
.WithFunction(
"get_weather",
"Gets the current weather for a city",
("city", "City name", true),
(string city) => $"Weather in {city}: sunny, 24°C");
var result = await service.GetCompletionAsync("What's the weather in Seoul?");
Notes
- Use
EndpointPlatform.DashScopefor Alibaba Cloud DashScope endpoints (default) - Use
EndpointPlatform.Vllmfor OpenAI-compatiblevLLMendpoints - Use
EndpointPlatform.Ollamafor local Ollama servers - Model selection can be changed with provider model constants or
ModelIdOverride - For the shared core API surface and advanced features, see the main
Mythosia.AIpackage documentation
Documentation
- Main package: GitHub Repository
- Core documentation: Mythosia.AI Provider Guide
- Release notes: Mythosia.AI.Providers.Alibaba v3.0.0 release notes
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Mythosia.AI (>= 8.0.0)
- TiktokenSharp (>= 1.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 81 | 9/13/2026 |
| 2.0.1 | 99 | 9/8/2026 |
| 2.0.0 | 127 | 8/8/2026 |
| 1.2.8 | 140 | 7/23/2026 |
| 1.2.7 | 123 | 7/22/2026 |
| 1.2.6 | 523 | 4/28/2026 |
| 1.2.5 | 253 | 4/20/2026 |
| 1.2.4 | 156 | 4/16/2026 |
| 1.2.3 | 153 | 4/10/2026 |
| 1.2.2 | 170 | 4/3/2026 |
| 1.2.1 | 122 | 4/2/2026 |
| 1.2.0 | 128 | 3/30/2026 |
| 1.1.0 | 139 | 3/28/2026 |
| 1.0.2 | 124 | 3/24/2026 |
| 1.0.1 | 125 | 3/22/2026 |
| 1.0.0 | 166 | 3/15/2026 |
v3.0.0 aligns Qwen with Mythosia.AI 8.0.0 and Mythosia.AI.Abstractions 4.0.0. Inherits immutable request builders that capture common and Qwen settings, asynchronous local-tool object returns, cooperative cancellation, ordinary completion cancellation and local capability inspection. AIRun.Result now returns AIRunResult; read its Text for the former string and rebuild callers for the changed completion signatures. Endpoint-specific model IDs are retained in RequestedModel, separately from the reported response Model. Invalid content after a stream terminal event fails the round before history is saved or tools execute; the first terminal delta and trailing usage-only events remain valid. Existing Qwen endpoint and thinking controls remain available, and unknown custom deployments remain Unknown during inspection. Remote inference/billing cancellation is not guaranteed. Migration: https://github.com/AJ-comp/Mythosia.AI/blob/main/docs/v8-migration.md Full notes: https://github.com/AJ-comp/Mythosia.AI/blob/main/src/core/Mythosia.AI.Providers.Alibaba/RELEASE_NOTES.md#v300