e-naxosMAF COURSE / COURS
Français

MICROSOFT AGENT FRAMEWORK · 0.16.0-rc.1

Demo480 — Model Routing

Run the sensitive branch without a model, then compare Ollama routing and baseline usage.

Objectives

Prepare an optional extension

Demo480.App.csproj delegates to Maf.Observability.RoutingExperiment. Revisit harness and evaluation before this extension. Build from the root; the normal path requires Ollama and already installed models. No model is downloaded automatically.

dotnet build BaseTechnique.slnx -m:1 -c Release

Verify the no-inference branch

dotnet run --project demos/Demo480_ModelRouting/Demo480.App.csproj -c Release --no-build -- --sensitive

Expect Host policy: human escalation. No model invoked; usage and cost unavailable. This branch ends before loading settings. It illustrates an explicit host decision without implementing a sensitive-text detector or human work queue.

Compare available profiles

dotnet run --project demos/Demo480_ModelRouting/Demo480.App.csproj -c Release --no-build

MAF_ROUTE_TRIAGE, MAF_ROUTE_EASY and MAF_ROUTE_HARD select already installed names. Without them all three roles reuse LocalChat.Model; this configuration proves mechanics without comparing capability. To vary them set these session environment variables to your qualified names, then rerun. This Ollama experiment rejects the compatible-API provider.

Read every stage and its counters

var triage = await Call("triage", triageModel, "Classify the following request. Return exactly Easy or Hard.\n" + request);
string route = triage.Trim();
if (route is not ("Easy" or "Hard")) throw new InvalidDataException("Unrecognized triage result.");
if (request.Contains("503", StringComparison.Ordinal)) route = "Hard";
string prompt = "Answer briefly in English. Separate facts from hypotheses.\n" + request;
_ = await Call("routed-execution", route == "Easy" ? easyModel : hardModel, prompt);
_ = await Call("direct-hard-baseline", hardModel, prompt);

shared/Maf.Observability/RoutingExperiment.cs · L39–L45 · 9a895c94534c

Source code · Maf.Observability · Folder

Record the three announced models then triage, routed-execution and direct-hard-baseline stages for each request. The program displays usage and duration but publishes neither complete answers nor quality, risk or confidence scores. Routed path including triage and Direct baseline summaries can only be compared while retaining counter coverage. The global bound is five minutes; invalid triage output fails explicitly.

Retain measurement limits

No menu, fallback, backup model, tenant quota or business write is provided. Fixed order, cache, warmup and unevaluated quality prevent economic generalization. The default candidate/judge profile remains unqualified. Successful execution does not replace domain evaluation of selected profiles.

Interpret before concluding

Prerequisites

Continue reading

Complete demo folder · README

lot013-integration-1 · 2026-10-24 · 9a895c94534cd5fc6f3da883e37e5f7856e588c1