runpod

package
v0.253.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunPod

type RunPod struct {
	APIKey     string
	RestURL    string // default https://rest.runpod.io/v1
	GraphQLURL string // default https://api.runpod.io/graphql
	ProxyBase  string // overrides URL in WaitReady; tests only
	Client     *http.Client
	// contains filtered or unexported fields
}

RunPod rents GPU instances from RunPod and translates its API into compute's domain. Base URLs are fields so tests can point at httptest.

func NewRunPod

func NewRunPod(apiKey string) *RunPod

func (*RunPod) Destroy

func (r *RunPod) Destroy(ctx context.Context, id string) error

Destroy terminates an instance, and billing stops. CRUD: delete.

func (*RunPod) GPUTypes

func (r *RunPod) GPUTypes(ctx context.Context) ([]computedomain.GPUType, error)

GPUTypes returns rentable GPU types with live pricing, cheapest first. This is the one non-REST call (RunPod exposes pricing only via GraphQL).

func (*RunPod) List

List returns the instances infer rented, told by their name prefix. CRUD: read.

func (*RunPod) Provision

Provision rents a GPU instance. CRUD: create.

func (*RunPod) Status

func (r *RunPod) Status(ctx context.Context, id string) (computedomain.GPUInstance, error)

Status returns a single instance. CRUD: read.

func (*RunPod) URL

func (r *RunPod) URL(id string, port int) string

URL is the public HTTPS endpoint RunPod proxies to the instance's port.

func (*RunPod) WaitReady

func (r *RunPod) WaitReady(ctx context.Context, id string, port int, report func(string)) (computedomain.GPUInstance, error)

WaitReady polls the pod, then the llama.cpp /health endpoint through the proxy until the model answers. /health is unauthenticated in llama.cpp, so this needs no per-session token and works for `gpu status --wait` too.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL