Runpod.SDK
0.0.4
dotnet add package Runpod.SDK --version 0.0.4
NuGet\Install-Package Runpod.SDK -Version 0.0.4
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="Runpod.SDK" Version="0.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Runpod.SDK" Version="0.0.4" />
<PackageReference Include="Runpod.SDK" />
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 Runpod.SDK --version 0.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Runpod.SDK, 0.0.4"
#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 Runpod.SDK@0.0.4
#: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=Runpod.SDK&version=0.0.4
#tool nuget:?package=Runpod.SDK&version=0.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SDK for the runpod.io API
Initializing the Client
var runpod = new RunpodClient("runpod__api_key");
Working with Serverless Endpoints
Create an Endpoint
var endpoint = runpod.Endpoint("endpoint_id");
Run a Synchronous Task
var runSyncResult = await endpoint.RunSync<JsonNode>(new {
prompt = "Hello World"
});
Run an Asynchronous Task and Wait for its Completion
var runJob = await endpoint.Run(new {
prompt = "Hello World"
});
var runResult = await runJob.Output<JsonNode>();
Stream Synchronous Task Output
Want to get LLM output in real-time? It would look something like this:
await foreach (var item in runJob.Stream<string>()) {
Console.WriteLine(item);
}
Get Task Status
var status = await runJob.Status();
Cancel a Task
await runJob.Cancel();
Check Endpoint Health
var health = await endpoint.Health();
Perform Purge
await endpoint.Purge();
Perform Purge Queue
await endpoint.PurgeQueue();
Working with Profile and Pods
Fetch User Information
var user = await runpod.cmd.GetUser();
Update User Settings
var updatedSettings = await runpod.cmd.UpdateUserSettings("publicKey");
Fetch All GPUs
var gpus = await runpod.cmd.GetGpus();
Fetch a Specific GPU
var gpu = await runpod.cmd.GetGpu("gpuId");
Fetch All Pods
var pods = await runpod.cmd.GetPods();
Fetch a Specific Pod
var pod = await runpod.cmd.GetPod("podId");
Create a Pod
var newPod = await runpod.cmd.CreatePod(
name: "Pod Name",
imageName: "Image Name",
gpuTypeId: "gpuTypeId",
cloudType: "ALL",
supportPublicIp: true,
startSsh: true,
dataCenterId: null,
countryCode: null,
gpuCount: 1,
volumeInGb: 0,
containerDiskInGb: null,
minVcpuCount: 1,
minMemoryInGb: 1,
dockerArgs: "",
ports: null,
volumeMountPath: "/runpod-volume",
env: null,
templateId: null,
networkVolumeId: null,
allowedCudaVersions: null,
minDownload: null,
minUpload: null
);
Stop a Pod
var stoppedPod = await runpod.cmd.StopPod("podId");
Resume a Pod
var resumedPod = await runpod.cmd.ResumePod("podId", gpuCount: 1);
Terminate a Pod
await runpod.cmd.TerminatePod("podId");
Create Container Registry Authentication
var registryAuth = await runpod.cmd.CreateContainerRegistryAuth("name", "username", "password");
Update Container Registry Authentication
var updatedRegistryAuth = await runpod.cmd.UpdateContainerRegistryAuth("registryAuthId", "username", "password");
Delete Container Registry Authentication
await runpod.cmd.DeleteContainerRegistryAuth("registryAuthId");
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 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
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.