CircleAI.Inference
1.5.0
dotnet add package CircleAI.Inference --version 1.5.0
NuGet\Install-Package CircleAI.Inference -Version 1.5.0
<PackageReference Include="CircleAI.Inference" Version="1.5.0" />
<PackageVersion Include="CircleAI.Inference" Version="1.5.0" />
<PackageReference Include="CircleAI.Inference" />
paket add CircleAI.Inference --version 1.5.0
#r "nuget: CircleAI.Inference, 1.5.0"
#:package CircleAI.Inference@1.5.0
#addin nuget:?package=CircleAI.Inference&version=1.5.0
#tool nuget:?package=CircleAI.Inference&version=1.5.0
Circle AI
On-device companion AI for the Aether Protocol ecosystem. ~100 C# modules covering inference, multi-agent orchestration, memory + persona, voice, tooling, mesh transport, and 50+ domain adapters — plus an OpenAI-compatible self-hosted inference server you can drop behind a load balancer.
Built around one architectural promise: the SDK has zero model knowledge. ModelScope's catalog is the source of truth, discovered at runtime. A new Qwen / Kimi / DeepSeek variant lands on ModelScope, the SDK picks it up on next refresh. NuGet sleeps — releases are for SDK bugs and new runtime backends, not "we support a new model."
See ARCHITECTURE.md for why.
What's in here
🧠 Inference
The trinity every consumer binds to:
| Type | Where | Purpose |
|---|---|---|
IChatGenerator |
CircleAI.Inference |
The atomic seam: messages in, tokens out |
IInferenceBridge |
CircleAI.Hosting.InferenceBridge |
Lifecycle + descriptor wrapper around a generator |
IAIService |
CircleAI.Hosting |
The long-lived companion service — RAG, persona, tools, observers |
Runtime: Alibaba MNN (Apache-2.0) on every platform. Models: Qwen 3+, Kimi-VL, DeepSeek, GLM — discovered through ModelScope, not pinned in source. See docs/ARCHITECTURE.md for the full Chinese-sovereign rationale.
🖥️ CircleAI.Inference.Server
OpenAI-compatible HTTP server. Endpoints: /v1/chat/completions (SSE
streaming), /v1/embeddings, /v1/companion/*, /v1/diagnostics,
/v1/healthz, /v1/readyz. JWT and API-key auth out of the box. Ships
with a Dockerfile, a systemd unit, and a Windows-service install script.
Drop it behind a load balancer and any OpenAI-SDK consumer talks to it unchanged.
👥 Companion + Memory
CircleAI.Companion— long-running session loop with proactive turn generation and mesh-state sync.CircleAI.Memory— episodic memory + RAG context builder, persona evolution, affect state, goal tracking, feedback signals.CircleAI.Orchestration— multi-agent loop (LokiOrchestrator) with quality gates and concurrent dispatch.
🔧 Tools + Skills + Voice
CircleAI.Tools—IToolBridgefor function calling. Built-inHttpToolBridgemaps REST APIs to tool definitions.CircleAI.Skills— pluggable capability surface the model can invoke contextually.CircleAI.Voice— ONNX TTS / STT pipeline (the only ONNX dependency in the codebase — text inference stays MNN).
🕸️ Networking + Security
CircleAI.Networking.*— pluggable transports (HTTP / WebSocket / AetherNet are production; BLE / DTN / NearLink are scaffolded).ITransportSelectorpicks per-message based on connectivity, not by consumer choice.CircleAI.Security.*— mesh-directive-driven chat refusal, AetherMesh bindings.
🏛️ ≈50 domain adapters
CircleAI.Beauty, CircleAI.Construction, CircleAI.Faith,
CircleAI.Family, CircleAI.Fitness, CircleAI.Food,
CircleAI.Healthcare, CircleAI.RealEstate, CircleAI.Tourism,
CircleAI.Tradesperson, … — each provides domain-specific system-prompt
context, knowledge facets, and lifecycle hooks. The companion engine
loads only the adapters whose required sensors / UI fit the host device.
Quick install — C# (.NET 9 / .NET 10)
dotnet add package CircleAI.Inference.Server # if you want the HTTP server
dotnet add package CircleAI.Hosting # if you want the in-process service
Zero-knob consumer
using CircleAI.Hosting;
// The SDK figures out: which model fits this device, what context window
// it can sustain, how many agents it can dispatch concurrently, which
// KV-compression mode to use. The consumer only states intent.
var ai = new AIService(new AIOptions
{
SystemPrompt = "You are B!, the helpful one.",
RequiredCapabilities = ChatCapability.Default | ChatCapability.Tools,
});
await ai.StartAsync();
var answer = await ai.AskAsync("What's the capital of Morocco?");
Console.WriteLine(answer);
That's it. No ModelId. No ContextSize. No MaxConcurrency. The
SDK probes the device, queries the ModelScope catalog, picks the
highest-quality bundle that fits + satisfies the capability flags, and
keeps that decision live as the catalog refreshes.
For the full picture (overrides, injection points, observer events, bring-your-own-runtime), see CONSUMING.md.
Self-hosted inference server
docker run -d -p 5050:5050 \
-v ~/.circleai/models:/var/lib/circleai/models \
ghcr.io/bhengubv/circleai-inference-server:latest
# Drop-in OpenAI replacement
curl http://localhost:5050/v1/chat/completions \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"model":"auto","messages":[{"role":"user","content":"Hi"}]}'
"model":"auto" ⇒ IModelSelector.BestFit(deviceProbe, ChatCapability.Default). The server picks; you don't.
Full deployment guide in docs/DEPLOY.md.
Sister repository — the 10-language portable kernel
The portable Circle AI kernel (AffectState math, KnownLanguages registry, ICompanionSession contracts) ships in 10 languages so every Aether node can host the companion stack natively — C#, Python, TypeScript, Go, Kotlin, Swift, Rust, C, Android (Kotlin), HarmonyOS (ArkTS).
The 10-language SDK lives alongside the C# framework in this repository. Per-language quickstarts: see docs/quickstart/.
License
MIT. See LICENSE.
Pointers
| Doc | Purpose |
|---|---|
| ARCHITECTURE.md | Why ModelScope is the catalog and NuGet sleeps |
| docs/ARCHITECTURE.md | The full Chinese-sovereign stack rationale |
| CONSUMING.md | The trinity, the three injection points, worked example |
| SETUP.md | MNN native-runtime setup per platform |
| TODO.md | Open work, current priorities |
| docs/quickstart/ | Per-language quickstart for the portable kernel |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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 is compatible. 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. |
-
net10.0
- CircleAI.Core (>= 1.5.0)
- Scriban (>= 7.2.4)
-
net9.0
- CircleAI.Core (>= 1.5.0)
- Scriban (>= 7.2.4)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on CircleAI.Inference:
| Package | Downloads |
|---|---|
|
CircleAI.Hosting
DI wiring, scheduled tasks, and proactive reasoning host for Circle AI agents. 1.5.0 adds upgrade-detection plumbing: IAIObserver.OnUpgradeAvailableAsync default method (non-breaking), IAIService.CheckForUpgradesAsync host-driven API, AIOptions.CheckForUpgradesOnStart (default false) and AIOptions.ModelStorageDirectory. When the flag is set, AIService.StartAsync fires one observer event per detected upgrade after the model loads. New AIService overload accepts ModelRegistryService for upgrade detection; ServiceCollectionExtensions wires it. Carries forward 1.4.0's device-inferred defaults: AIOptions.ModelId / ContextSize / AgenticMaxIterations nullable, CatalogClient opt-in, RequiredCapabilities (Vision routes to KimiVlGenerator). |
|
|
CircleAI.Embeddings
On-device text embeddings for Circle AI. Sovereign-origin embedder (BGE / Qwen-Embedding) for fully offline semantic search. |
|
|
CircleAI.Languages.Translation
On-device real-time translation for Circle AI. No API call, no data leaving device. Context-aware, live conversation mode, document translation. |
|
|
CircleAI.Hosting.InferenceBridge
Cross-OS LLM inference daemon contract for Circle AI — one model loaded once per device, shared by every app via OS-specific IPC. Ship-once, run-everywhere. |
|
|
CircleAI.Inference.Server
OpenAI-compatible hosted inference server over CircleAI.Hosting.InferenceBridge. Endpoints: /v1/chat/completions (SSE streaming), /v1/embeddings, /v1/companion/*, /v1/diagnostics, /v1/healthz, /v1/readyz. JWT and API-key auth out of the box. Ships Dockerfile, systemd unit, and a Windows-service install script. 1.3.6 picks up CircleAI.Inference 1.3.6 — adds linux-arm64 (Raspberry Pi 4/5, AWS Graviton, Apple-Silicon-via-Linux-VM, ARM-based cloud VMs). Server now runs on 5 host platforms: win-x64, linux-x64, linux-arm64, osx-arm64, osx-x64. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.0 | 0 | 6/9/2026 |
| 1.4.1 | 25 | 6/9/2026 |
| 1.4.0 | 30 | 6/9/2026 |
| 1.3.6 | 59 | 6/8/2026 |
| 1.3.5 | 53 | 6/8/2026 |
| 1.3.4 | 59 | 6/8/2026 |
| 1.3.3 | 55 | 6/8/2026 |
| 1.3.2 | 57 | 6/8/2026 |
| 1.3.1 | 67 | 6/8/2026 |
| 1.3.0 | 60 | 6/8/2026 |
| 1.2.3 | 53 | 6/7/2026 |
| 1.2.2 | 65 | 6/6/2026 |
| 1.2.1 | 54 | 6/6/2026 |
| 1.2.0 | 451 | 6/6/2026 |
| 1.0.0 | 138 | 6/3/2026 |