pricing

package
v1.46.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

* GPU instance data is from:https://instances.vantage.sh/ ,Thanks a lot!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTflopsMapAndInitGPUPricingInfo added in v1.41.0

func SetTflopsMapAndInitGPUPricingInfo(ctx context.Context, gpuInfos *[]config.GpuInfo)

Types

type CompleteGPUInfo added in v1.43.3

type CompleteGPUInfo struct {
	*config.GpuInfo
	VRAMGigabytes int32
}

CompleteGPUInfo combines GpuInfo with VRAM information from instance data

type GPUNodeInstanceInfoAndPrice

type GPUNodeInstanceInfoAndPrice struct {
	GPUNodeInstanceInfo types.GPUNodeInstanceInfo
	// contains filtered or unexported fields
}

type PricingProvider

type PricingProvider interface {
	GetPricing(instanceType string, capacityType tfv1.CapacityTypeEnum, region string) (float64, bool)
	GetRegionalGPUNodeInstanceTypes(region string) ([]types.GPUNodeInstanceInfo, bool)
	GetGPUCapacityByModel(gpuModel string) (resource.Quantity, resource.Quantity, bool)
}

PricingProvider provides pricing information and calculations for instance types

type StaticPricingProvider

type StaticPricingProvider struct{}

StaticPricingProvider implements PricingProvider using static pricing data Data is now stored in global variables and initialized during package init

func NewStaticPricingProvider

func NewStaticPricingProvider() *StaticPricingProvider

func (*StaticPricingProvider) GetGPUCapacityByModel added in v1.43.3

func (p *StaticPricingProvider) GetGPUCapacityByModel(gpuModel string) (resource.Quantity, resource.Quantity, bool)

GetGPUCapacityByModel gets the full capacity (TFlops and VRAM) for a GPU model Returns TFlops, VRAM, and whether found

func (*StaticPricingProvider) GetGPUNodeInstanceTypeInfoByInstance

func (p *StaticPricingProvider) GetGPUNodeInstanceTypeInfoByInstance(instanceType string, region string) (types.GPUNodeInstanceInfo, bool)

GetGPUNodeInstanceTypeInfoByInstance gets the gpu info for the instanceType, region

func (*StaticPricingProvider) GetPricing added in v1.41.0

func (p *StaticPricingProvider) GetPricing(instanceType string, capacityType tfv1.CapacityTypeEnum, region string) (float64, bool)

GetPricing gets the pricing for the instanceType, capacityType

func (*StaticPricingProvider) GetRegionalGPUNodeInstanceTypes added in v1.41.0

func (p *StaticPricingProvider) GetRegionalGPUNodeInstanceTypes(region string) ([]types.GPUNodeInstanceInfo, bool)

GetRegionalGPUNodeInstanceTypes implements PricingProvider interface

Jump to

Keyboard shortcuts

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