AI-Studio/app/Tests/Models/ZAI/GlmFamilyTests.cs
Thorsten Sommer d85b4e71b6
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Rebuilt how AI Studio knows what a model can do (#960)
2026-09-13 14:17:25 +02:00

42 lines
2.0 KiB
C#

using AIStudio.Models.Registry;
using AIStudio.Provider;
// ReSharper disable InconsistentNaming
namespace AIStudio.Tests.Models.ZAI;
/// <summary>
/// Checks how a GLM name says that the model looks at pictures.
/// </summary>
/// <remarks>
/// Z AI marks its vision models by gluing a "v" to the version number: glm-4v, glm-4.1v, glm-4.5v.
/// That is not a name part, so no pattern can ask about it, and the family works it out of the name
/// instead -- the second of the two places in the rebuilt rules where a capability is calculated.
///
/// These need tests of their own because the corpus cannot tell the calculation apart from a
/// careless one. Looking for a bare "v" anywhere answers every corpus name the same way, and is
/// still wrong: a quantized build carries one in "nvfp4", and so do the names of several inference
/// providers. The corpus happens to hold that name only for a generation which reads images anyway.
/// </remarks>
[TestFixture]
public sealed class GlmFamilyTests
{
[TestCase("glm-4.5v", TestName = "The vision marker sits behind the version")]
[TestCase("glm-4v", TestName = "A version without a dot carries the marker just the same")]
[TestCase("glm-4.1v-9b", TestName = "A size may follow the marker")]
public void AGlmWhoseVersionCarriesTheMarkerLooksAtPictures(string modelId)
{
var profile = ModelRegistry.Shared.Profile(LLMProviders.SELF_HOSTED, modelId);
Assert.That(profile.Has(Capability.MULTIPLE_IMAGE_INPUT), Is.True);
}
[TestCase("glm-4-9b-chat-nvfp4", TestName = "A quantized build is not a vision model")]
[TestCase("glm-4-9b-chat", TestName = "The plain 4 line reads text only")]
[TestCase("glm-4.6-latest", TestName = "A rolling tag says nothing about pictures")]
public void AGlmCarryingAVSomewhereElseDoesNot(string modelId)
{
var profile = ModelRegistry.Shared.Profile(LLMProviders.SELF_HOSTED, modelId);
Assert.That(profile.Has(Capability.MULTIPLE_IMAGE_INPUT), Is.False);
}
}