Portic.Sdk 0.1.0

dotnet add package Portic.Sdk --version 0.1.0
                    
NuGet\Install-Package Portic.Sdk -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="Portic.Sdk" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Portic.Sdk" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Portic.Sdk" />
                    
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 Portic.Sdk --version 0.1.0
                    
#r "nuget: Portic.Sdk, 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 Portic.Sdk@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=Portic.Sdk&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Portic.Sdk&version=0.1.0
                    
Install as a Cake Tool

Portic.Sdk

Public, versioned provider SPI and normalized chat contracts for Portic — VEV's AI gateway. The stable integration surface adapter authors build against, without taking a dependency on the AGPL-3.0 gateway runtime.

dotnet add package Portic.Sdk

What's inside

  • IChatProvider — the provider SPI. Every model call the gateway makes goes through this one interface; each concrete provider (OpenAI, Anthropic, Ollama, a local stub, …) is a disposable adapter that implements it.
  • Normalized contracts — ChatRequest, ChatMessage, ChatCompletion, TokenUsage: the provider-neutral shapes the gateway's POST /v1/messages accepts and returns. Adapters translate these to and from their own provider's wire format.

The types are plain records/an interface with no runtime dependencies beyond the base class library.

Implementing a provider adapter

using Portic.Sdk.Contracts;
using Portic.Sdk.Providers;

public sealed class MyProvider : IChatProvider
{
    public string Name => "my-provider";

    public async Task<ChatCompletion> CompleteAsync(
        ChatRequest request, CancellationToken cancellationToken = default)
    {
        // Map `request` onto your provider's SDK/wire call, then map the response back
        // onto a normalized ChatCompletion. No provider SDK call may happen outside a
        // type like this one that implements IChatProvider (Portic's AGENTS.md guardrail).
        var reply = new ChatMessage { Role = "assistant", Content = "…" };
        return new ChatCompletion
        {
            Id = Guid.NewGuid().ToString("n"),
            Model = request.Model,
            Provider = Name,
            Message = reply,
            Usage = new TokenUsage { InputTokens = 0, OutputTokens = 0 },
        };
    }
}

Versioning

SemVer, derived from the git tag (vX.Y.Z) at release. Pre-1.0, the surface evolves additively across minor/patch versions; a breaking change to IChatProvider or any of the normalized contracts requires a major version bump and an ADR (see docs/adr/ in this repo).

Licence

Apache-2.0.

Product 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 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.
  • net9.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Portic.Sdk:

Package Downloads
Portic.Client

Thin .NET client for Portic's stable POST /v1/messages HTTP surface. Uses Portic.Sdk's normalized chat contracts and depends only on HttpClient and the base class library. Apache-2.0.

Portic.Core

Portic community runtime: the provider-neutral AI gateway domain — routing, orchestration, governance and observability ports (IMessageGateway). Compose it with a Portic.Sdk provider adapter to host a gateway. Dual-licensed AGPL-3.0 or commercial.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 215 8/22/2026