Squad.NET 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Squad.NET --version 0.1.0
                    
NuGet\Install-Package Squad.NET -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Squad.NET" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Squad.NET" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Squad.NET" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Squad.NET --version 0.1.0
                    
#r "nuget: Squad.NET, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Squad.NET@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Squad.NET&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Squad.NET&version=0.1.0
                    
Install as a Cake Tool

Squad.NET

.NET Version License

Squad.NET is a .NET-native framework for building typed, observable multi-agent workflows with sensible local defaults and provider escape hatches.

Current release target: 0.1.0.

What Works In v0.1

  • Local offline runs with FakeChatModel
  • Sequential, parallel, and hierarchical task execution with bounded manager replanning
  • Per-agent model routing with a named model registry
  • Provider-neutral native tool calls and prompt-style tool calls
  • Structured output with Throw, ReturnRaw, and ReturnDefault policies
  • OpenAI-compatible /v1/chat/completions provider via Squad.OpenAI
  • OpenRouter provider via Squad.OpenRouter
  • AWS Bedrock Runtime Converse provider via Squad.Bedrock
  • Ollama local/network provider via Squad.Ollama
  • LM Studio local/network provider via Squad.LMStudio
  • ASP.NET Core hosting library plus runnable hosting sample
  • Microsoft.Extensions.DependencyInjection integration

Quick Start

No API key is needed for the first run:

using Squad.Abstractions;
using Squad.Core;

var squad = SquadBuilder.Create("HelloSquad")
    .AddAgent(AgentDef.Create("Assistant", "Helpful assistant", "Answer clearly"))
    .AddTask(TaskDef.Create("Answer", "Answer the user's question"))
    .WithModel(new FakeChatModel("local", "Hello from Squad.NET."))
    .Build();

var result = await squad.RunAsync(SquadInput.FromText("Hello"));
Console.WriteLine(result.OutputText);

Run the bundled sample:

dotnet run --project samples/MinimalHelloWorld

Per-Agent Models

Register named models once, then opt agents into them only when needed. Agents without a model use the default.

var squad = SquadBuilder.Create("ContentSquad")
    .AddAgent(AgentDef.Create("Researcher", "Research", "Find facts").WithModel("research"))
    .AddAgent(AgentDef.Create("Writer", "Writer", "Write clearly").WithModel("writer"))
    .AddTask(TaskDef.Create("Research", "Research the topic").WithAgent("Researcher"))
    .AddTask(TaskDef.Create("Write", "Write the final answer").WithAgent("Writer"))
    .WithModel("research", researchModel)
    .WithModel("writer", writerModel)
    .WithDefaultModel("research")
    .Build();

Unknown model names fail fast with an actionable message that names the agent and the missing registration.

Hierarchical Replanning

Hierarchical squads use the manager agent to create a plan. By default, if a planned task fails, the manager gets one chance to revise the remaining plan while completed successful tasks are preserved.

var squad = SquadBuilder.Create("ContentSquad")
    .WithProcess(Process.Hierarchical)
    .WithManagerAgent("Researcher")
    .WithHierarchicalOptions(o => o.WithMaxPlanRevisions(1))
    .Build();

Disable replanning when you want strict fail-fast behavior:

.WithHierarchicalOptions(o => o.DisableReplanning())

Providers

Provider-specific boilerplates are available in docs/providers.

OpenAI-compatible endpoint:

using Squad.OpenAI;

var model = new OpenAIChatModel(new OpenAIChatModelOptions
{
    ModelId = "gpt-4.1-mini",
    ApiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!,
    BaseUrl = "https://api.openai.com/v1"
});

OpenRouter:

using Squad.OpenRouter;

var model = new OpenRouterChatModel(
    "openai/gpt-oss-120b:free",
    Environment.GetEnvironmentVariable("OPENROUTER_API_KEY")!);

AWS Bedrock Converse:

using Squad.Bedrock;

var model = new BedrockChatModel(new BedrockChatModelOptions
{
    ModelId = "anthropic.claude-3-haiku-20240307-v1:0",
    Region = "us-east-1"
});

Bedrock uses explicit options, environment variables, or the shared AWS credentials/config files.

Ollama on the same machine:

using Squad.Ollama;

var model = new OllamaChatModel("llama3.2");

Ollama on another device on your network:

var model = new OllamaChatModel("llama3.2", "http://192.168.1.20:11434");

LM Studio:

using Squad.LMStudio;

var model = new LMStudioChatModel("qwen2.5-coder-7b");

Hosting

Squad.Hosting is a reusable library. The runnable ASP.NET Core app lives in samples/MVP6.HostingDemo.

dotnet run --project samples/MVP6.HostingDemo

Execute:

curl -X POST http://localhost:5000/api/squad/execute \
  -H "Content-Type: application/json" \
  -d "{\"squadName\":\"DemoSquad\",\"input\":\"Hello\"}"

Both hosted endpoints are POST endpoints and use the same JSON body:

{
  "squadName": "DemoSquad",
  "input": "Hello"
}

execute returns a SquadResult JSON response. stream returns Server-Sent Events.

You can choose the route prefix:

app.MapSquadApi("/ai/squads");

Stream:

curl -N -X POST http://localhost:5000/api/squad/stream \
  -H "Content-Type: application/json" \
  -d "{\"squadName\":\"DemoSquad\",\"input\":\"Hello\"}"

Build And Test

dotnet restore Squad.NET.sln
dotnet build Squad.NET.sln -c Release --no-restore
dotnet test Squad.NET.sln -c Release --no-build
dotnet pack src/Squad.NET/Squad.NET.csproj -c Release --no-build
docker build -t squad-hosting-sample .

Project Layout

src/
  Squad.Abstractions/
  Squad.Core/
  Squad.OpenAI/
  Squad.OpenRouter/
  Squad.Bedrock/
  Squad.Ollama/
  Squad.LMStudio/
  Squad.DependencyInjection/
  Squad.Hosting/
  Squad.NET/
samples/
  MinimalHelloWorld/
  MVP1.OpenRouterDemo/
  MVP2.ToolsDemo/
  MVP3.StructuredOutputDemo/
  MVP4.ProcessesDemo/
  MVP5.ObservabilityDemo/
  MVP6.HostingDemo/
  MVP7.LocalProvidersDemo/
tests/

License

MIT. See LICENSE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.2 97 5/1/2026
1.0.1 94 5/1/2026
1.0.0 101 4/29/2026
0.1.0 97 5/1/2026