Agntcy.Slim.SlimRpc
2.1.0
dotnet add package Agntcy.Slim.SlimRpc --version 2.1.0
NuGet\Install-Package Agntcy.Slim.SlimRpc -Version 2.1.0
<PackageReference Include="Agntcy.Slim.SlimRpc" Version="2.1.0" />
<PackageVersion Include="Agntcy.Slim.SlimRpc" Version="2.1.0" />
<PackageReference Include="Agntcy.Slim.SlimRpc" />
paket add Agntcy.Slim.SlimRpc --version 2.1.0
#r "nuget: Agntcy.Slim.SlimRpc, 2.1.0"
#:package Agntcy.Slim.SlimRpc@2.1.0
#addin nuget:?package=Agntcy.Slim.SlimRpc&version=2.1.0
#tool nuget:?package=Agntcy.Slim.SlimRpc&version=2.1.0
slimrpc (SLIM Remote Procedure Call)
slimrpc, or SLIM Remote Procedure Call, is a mechanism designed to enable Protocol Buffers (protobuf) RPC over SLIM (Secure Low-Latency Interactive Messaging). This is analogous to gRPC, which leverages HTTP/2 as its underlying transport layer for protobuf RPC.
A key advantage of slimrpc lies in its ability to seamlessly integrate SLIM as the transport protocol for inter-application message exchange. This significantly simplifies development: a protobuf file can be compiled to generate code that utilizes SLIM for communication. Application developers can then interact with the generated code much like they would with standard gRPC, while benefiting from the inherent security features and efficiency provided by the SLIM protocol.
For detailed instructions on compiling a protobuf file to obtain the necessary slimrpc stub code, see the slimrpc compiler README.
SLIM naming in slimrpc
In slimrpc, each service and its individual RPC handlers are assigned a SLIM name, facilitating efficient message routing and processing. For slimrpc, service methods are invoked using the format:
{package-name}.{service-name}/{method-name}
For example, a service example_service.Test with method ExampleUnaryUnary would
use the name example_service.Test/ExampleUnaryUnary.
The slimrpc package manages all the underlying SLIM communication. Application developers only need to implement the specific functions that will be invoked when a message arrives for a defined RPC method.
C# Setup
Prerequisites
- .NET 8.0 or higher
- buf CLI
- protoc-gen-slimrpc-csharp plugin (build from source)
Code Generation
Add the Agntcy.Slim and Agntcy.Slim.SlimRpc NuGet packages to your project.
Then configure buf.gen.yaml to generate C# slimrpc stubs:
version: v2
managed:
enabled: true
plugins:
# Generates standard .pb.cs files for C#
- remote: buf.build/protocolbuffers/csharp
out: Generated
opt: base_namespace=ExampleService
# Generates _slimrpc.cs files (client stubs and server handlers)
- local: /path/to/target/release/protoc-gen-slimrpc-csharp
out: Generated
opt: base_namespace=ExampleService,types_namespace=ExampleService
Run buf generate to produce the generated code. For the example project in this
repository, use:
task slimrpc:generate-proto
Creating a Channel and Server
Server
Create an RPC server using SlimRpcServerFactory.CreateServer:
using Agntcy.Slim;
using Agntcy.Slim.SlimRpc;
// After creating app and connecting to SLIM...
var localName = SlimName.Parse("agntcy/grpc/server");
var server = SlimRpcServerFactory.CreateServer(app, localName, connectionId);
// Register your service implementation
TestServerRegistration.RegisterTestServer(server, new MyTestServerImpl());
await server.ServeAsync();
Client
Create an RPC channel using SlimRpcChannelFactory.CreateChannel and pass it to
the generated client:
using Agntcy.Slim;
using Agntcy.Slim.SlimRpc;
// After creating app and connecting to SLIM...
var remoteName = SlimName.Parse("agntcy/grpc/server");
var channel = SlimRpcChannelFactory.CreateChannel(app, remoteName, connectionId);
var client = new TestClient(channel);
// Make RPC calls
var request = new ExampleRequest { ExampleString = "hello", ExampleInteger = 1 };
var response = await client.ExampleUnaryUnaryAsync(request);
RPC Patterns
The generated client supports all four gRPC streaming patterns:
- Unary-Unary:
ExampleUnaryUnaryAsync(request)— single request, single response - Unary-Stream:
ExampleUnaryStreamAsync(request)— single request, streaming responses - Stream-Unary:
ExampleStreamUnaryAsync(requestStream)— streaming requests, single response - Stream-Stream:
ExampleStreamStreamAsync(requestStream)— bidirectional streaming
All client methods accept optional timeout, metadata, and cancellationToken parameters.
Example
A complete working example is available in Slim.Examples.SlimRpc. To run it:
- Start a SLIM server (from the slim repo):
cd data-plane && cargo run --bin slim -- --config ./config/base/server-config.yaml - Generate proto code:
task slimrpc:generate-proto - Run the server:
dotnet run --project Slim.Examples.SlimRpc -- --mode server - Run the client (in another terminal):
dotnet run --project Slim.Examples.SlimRpc -- --mode client
| 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
- Agntcy.Slim (>= 2.1.0)
- Google.Protobuf (>= 3.28.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Agntcy.Slim.SlimRpc:
| Package | Downloads |
|---|---|
|
Agntcy.SlimA2A
SLIMRPC transport for the A2A (Agent2Agent) .NET SDK — interoperable with slim-a2a-go and slim-a2a-python (lf.a2a.v1). |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.1.0 | 67 | 8/13/2026 |
| 2.0.0 | 109 | 8/5/2026 |
| 2.0.0-alpha.7 | 50 | 8/3/2026 |
| 2.0.0-alpha.5 | 54 | 7/31/2026 |
| 2.0.0-alpha.4 | 53 | 7/21/2026 |
| 2.0.0-alpha.3 | 50 | 7/15/2026 |
| 2.0.0-alpha.2 | 56 | 6/29/2026 |
| 2.0.0-alpha.1 | 59 | 6/23/2026 |
| 2.0.0-alpha.0 | 57 | 6/3/2026 |
| 1.4.1 | 117 | 5/23/2026 |
| 1.4.0 | 105 | 5/13/2026 |
| 1.4.0-rc.6 | 65 | 5/13/2026 |
| 1.4.0-rc.5 | 64 | 5/12/2026 |
| 1.4.0-rc.3 | 65 | 5/12/2026 |
| 1.4.0-rc.2 | 62 | 5/11/2026 |
| 1.4.0-rc.1 | 69 | 5/8/2026 |
| 1.4.0-rc.0 | 74 | 4/21/2026 |
| 1.3.0 | 1,404 | 3/31/2026 |
| 1.3.0-rc.3 | 66 | 3/31/2026 |
| 1.3.0-rc.1 | 74 | 3/26/2026 |