Documentation
¶
Index ¶
- type RunPod
- func (r *RunPod) Destroy(ctx context.Context, id string) error
- func (r *RunPod) GPUTypes(ctx context.Context) ([]computedomain.GPUType, error)
- func (r *RunPod) List(ctx context.Context) ([]computedomain.GPUInstance, error)
- func (r *RunPod) Provision(ctx context.Context, req computedomain.ProvisionRequest) (computedomain.GPUInstance, error)
- func (r *RunPod) Status(ctx context.Context, id string) (computedomain.GPUInstance, error)
- func (r *RunPod) URL(id string, port int) string
- func (r *RunPod) WaitReady(ctx context.Context, id string, port int, report func(string)) (computedomain.GPUInstance, error)
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
GraphQLURL string
ProxyBase string
Client *http.Client
// contains filtered or unexported fields
}
RunPod rents GPU instances from RunPod and translates its API into compute's domain. The URLs default to RunPod's REST and GraphQL APIs and are fields so tests can use httptest. ProxyBase overrides the WaitReady URL in tests, and a zero pollInterval probes every 10s.
func (*RunPod) GPUTypes ¶
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 ¶
func (r *RunPod) List(ctx context.Context) ([]computedomain.GPUInstance, error)
List returns the instances infer rented, told by their name prefix. CRUD: read.
func (*RunPod) Provision ¶
func (r *RunPod) Provision(ctx context.Context, req computedomain.ProvisionRequest) (computedomain.GPUInstance, error)
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) 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.