Squad.NET
1.0.1
See the version list below for details.
dotnet add package Squad.NET --version 1.0.1
NuGet\Install-Package Squad.NET -Version 1.0.1
<PackageReference Include="Squad.NET" Version="1.0.1" />
<PackageVersion Include="Squad.NET" Version="1.0.1" />
<PackageReference Include="Squad.NET" />
paket add Squad.NET --version 1.0.1
#r "nuget: Squad.NET, 1.0.1"
#:package Squad.NET@1.0.1
#addin nuget:?package=Squad.NET&version=1.0.1
#tool nuget:?package=Squad.NET&version=1.0.1
Squad.NET
Squad.NET is a .NET-native framework for building typed, observable multi-agent workflows with sensible local defaults and provider escape hatches.
Current NuGet recovery release target: 1.0.1.
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, andReturnDefaultpolicies - OpenAI-compatible
/v1/chat/completionsprovider viaSquad.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 | Versions 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. |
-
net8.0
- Squad.Abstractions (>= 1.0.1)
- Squad.Bedrock (>= 1.0.1)
- Squad.Core (>= 1.0.1)
- Squad.DependencyInjection (>= 1.0.1)
- Squad.Hosting (>= 1.0.1)
- Squad.LMStudio (>= 1.0.1)
- Squad.Ollama (>= 1.0.1)
- Squad.OpenAI (>= 1.0.1)
- Squad.OpenRouter (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.