together

package module
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 26 Imported by: 5 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Together Go API Library

Go Reference

The Together Go library provides convenient access to the Together REST API from applications written in Go.

It is generated with Stainless.

Installation

import (
	"github.com/togethercomputer/together-go" // imported as together
)

Or to pin the version:

go get -u 'github.com/togethercomputer/together-go@v0.13.0'

Requirements

This library requires Go 1.27.3+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/togethercomputer/together-go"
	"github.com/togethercomputer/together-go/option"
)

func main() {
	client := together.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("TOGETHER_API_KEY")
	)
	chatCompletion, err := client.Chat.Completions.New(context.TODO(), together.ChatCompletionNewParams{
		Messages: []together.ChatCompletionMessageParamUnion{{
			OfChatCompletionUserMessage: &together.ChatCompletionUserMessageParam{
				Role: together.ChatCompletionUserMessageParamRoleUser,
				Content: together.ChatCompletionUserMessageParamContentUnion{
					OfString: together.String("Say this is a test!"),
				},
			},
		}},
		Model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", chatCompletion.Choices)
}

Request fields

The together library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `api:"required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, together.String(string), together.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := together.ExampleParams{
	ID:   "id_xxx",               // required property
	Name: together.String("..."), // optional property

	Point: together.Point{
		X: 0,               // required field will serialize as 0
		Y: together.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: together.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[together.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := together.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Chat.Completions.New(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

iter := client.Organization.Usage.Costs.ListAutoPaging(context.TODO(), together.OrganizationUsageCostListParams{})
// Automatically fetches more pages as needed.
for iter.Next() {
	billingUsageWindow := iter.Current()
	fmt.Printf("%+v\n", billingUsageWindow)
}
if err := iter.Err(); err != nil {
	panic(err.Error())
}

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

page, err := client.Organization.Usage.Costs.List(context.TODO(), together.OrganizationUsageCostListParams{})
for page != nil {
	for _, cost := range page.Data {
		fmt.Printf("%+v\n", cost)
	}
	page, err = page.GetNextPage()
}
if err != nil {
	panic(err.Error())
}
Errors

When the API returns a non-success status code, we return an error with type *together.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Chat.Completions.New(context.TODO(), together.ChatCompletionNewParams{
	Messages: []together.ChatCompletionMessageParamUnion{{
		OfChatCompletionUserMessage: &together.ChatCompletionUserMessageParam{
			Role: together.ChatCompletionUserMessageParamRoleUser,
			Content: together.ChatCompletionUserMessageParamContentUnion{
				OfString: together.String("Say this is a test"),
			},
		},
	}},
	Model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
})
if err != nil {
	var apierr *together.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/v1/chat/completions": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Chat.Completions.New(
	ctx,
	together.ChatCompletionNewParams{
		Messages: []together.ChatCompletionMessageParamUnion{{
			OfChatCompletionUserMessage: &together.ChatCompletionUserMessageParam{
				Role: together.ChatCompletionUserMessageParamRoleUser,
				Content: together.ChatCompletionUserMessageParamContentUnion{
					OfString: together.String("Say this is a test"),
				},
			},
		}},
		Model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper together.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

// A file from the file system
file, err := os.Open("/path/to/file")
together.FileUploadParams{
	File:     file,
	FileName: "dataset.csv",
	Purpose:  together.FilePurposeFineTune,
}

// A file from a string
together.FileUploadParams{
	File:     strings.NewReader("my file contents"),
	FileName: "dataset.csv",
	Purpose:  together.FilePurposeFineTune,
}

// With a custom filename and contentType
together.FileUploadParams{
	File:     together.File(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),
	FileName: "dataset.csv",
	Purpose:  together.FilePurposeFineTune,
}
Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := together.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Chat.Completions.New(
	context.TODO(),
	together.ChatCompletionNewParams{
		Messages: []together.ChatCompletionMessageParamUnion{{
			OfChatCompletionUserMessage: &together.ChatCompletionUserMessageParam{
				Role: together.ChatCompletionUserMessageParamRoleUser,
				Content: together.ChatCompletionUserMessageParamContentUnion{
					OfString: together.String("Say this is a test"),
				},
			},
		}},
		Model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
	},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
chatCompletion, err := client.Chat.Completions.New(
	context.TODO(),
	together.ChatCompletionNewParams{
		Messages: []together.ChatCompletionMessageParamUnion{{
			OfChatCompletionUserMessage: &together.ChatCompletionUserMessageParam{
				Role: together.ChatCompletionUserMessageParamRoleUser,
				Content: together.ChatCompletionUserMessageParamContentUnion{
					OfString: together.String("Say this is a test"),
				},
			},
		}},
		Model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
	},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", chatCompletion)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: together.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := together.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (TOGETHER_API_KEY, TOGETHER_PROJECT_ID, TOGETHER_BASE_URL). This should be used to initialize new clients.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type AbExperiment added in v0.11.0

type AbExperiment struct {
	// Output only. Unique A/B experiment identifier.
	ID string `json:"id" api:"required"`
	// Output only. Timestamp when the A/B experiment was created.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// Output only. Identifier of the principal that created the A/B experiment.
	CreatedBy string `json:"createdBy" api:"required"`
	// Output only. Endpoint this A/B experiment belongs to.
	EndpointID string `json:"endpointId" api:"required"`
	// Optional opaque version tag for optimistic concurrency control.
	Etag string `json:"etag" api:"required"`
	// Two to 20 participating deployments with exactly one control and percentages
	// that add up to 100.
	Members []AbMember `json:"members" api:"required"`
	// Human-readable A/B experiment name, unique within the endpoint.
	Name string `json:"name" api:"required"`
	// Output only. Project that owns the parent endpoint.
	ProjectID string `json:"projectId" api:"required"`
	// Output only. Timestamp when the A/B experiment was last updated.
	UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
	// Optional free-form description.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		CreatedBy   respjson.Field
		EndpointID  respjson.Field
		Etag        respjson.Field
		Members     respjson.Field
		Name        respjson.Field
		ProjectID   respjson.Field
		UpdatedAt   respjson.Field
		Description respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Managed cohort split that subdivides a control deployment's live traffic among the control and one or more variants.

func (AbExperiment) RawJSON added in v0.11.0

func (r AbExperiment) RawJSON() string

Returns the unmodified JSON received from the API

func (*AbExperiment) UnmarshalJSON added in v0.11.0

func (r *AbExperiment) UnmarshalJSON(data []byte) error

type AbMember added in v0.11.0

type AbMember struct {
	// Deployment under the parent endpoint.
	DeploymentID string `json:"deploymentId" api:"required"`
	// Integer traffic percent in [1, 100]. Percentages across all members must sum
	// to 100.
	Percent int64 `json:"percent" api:"required"`
	// Role of this deployment within the A/B experiment.
	//
	// Any of "AB_EXPERIMENT_MEMBER_ROLE_CONTROL", "AB_EXPERIMENT_MEMBER_ROLE_VARIANT".
	Role AbMemberRole `json:"role" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DeploymentID respjson.Field
		Percent      respjson.Field
		Role         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Deployment participating in an A/B experiment.

func (AbMember) RawJSON added in v0.11.0

func (r AbMember) RawJSON() string

Returns the unmodified JSON received from the API

func (AbMember) ToParam added in v0.11.0

func (r AbMember) ToParam() AbMemberParam

ToParam converts this AbMember to a AbMemberParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with AbMemberParam.Overrides()

func (*AbMember) UnmarshalJSON added in v0.11.0

func (r *AbMember) UnmarshalJSON(data []byte) error

type AbMemberParam added in v0.11.0

type AbMemberParam struct {
	// Deployment under the parent endpoint.
	DeploymentID string `json:"deploymentId" api:"required"`
	// Integer traffic percent in [1, 100]. Percentages across all members must sum
	// to 100.
	Percent int64 `json:"percent" api:"required"`
	// Role of this deployment within the A/B experiment.
	//
	// Any of "AB_EXPERIMENT_MEMBER_ROLE_CONTROL", "AB_EXPERIMENT_MEMBER_ROLE_VARIANT".
	Role AbMemberRole `json:"role,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Deployment participating in an A/B experiment.

The properties DeploymentID, Percent, Role are required.

func (AbMemberParam) MarshalJSON added in v0.11.0

func (r AbMemberParam) MarshalJSON() (data []byte, err error)

func (*AbMemberParam) UnmarshalJSON added in v0.11.0

func (r *AbMemberParam) UnmarshalJSON(data []byte) error

type AbMemberRole added in v0.11.0

type AbMemberRole string

Role of this deployment within the A/B experiment.

const (
	AbMemberRoleAbExperimentMemberRoleControl AbMemberRole = "AB_EXPERIMENT_MEMBER_ROLE_CONTROL"
	AbMemberRoleAbExperimentMemberRoleVariant AbMemberRole = "AB_EXPERIMENT_MEMBER_ROLE_VARIANT"
)

type AudioService

type AudioService struct {
	Options        []option.RequestOption
	Speech         AudioSpeechService
	Voices         AudioVoiceService
	Transcriptions AudioTranscriptionService
	Translations   AudioTranslationService
}

AudioService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAudioService method instead.

func NewAudioService

func NewAudioService(opts ...option.RequestOption) (r AudioService)

NewAudioService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type AudioSpeechNewParams

type AudioSpeechNewParams struct {
	// Input text to generate the audio for
	Input string `json:"input" api:"required"`
	// The name of the model to query.
	//
	// [See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#audio-models)
	// The current supported tts models are: - cartesia/sonic - hexgrad/Kokoro-82M -
	// canopylabs/orpheus-3b-0.1-ft
	Model AudioSpeechNewParamsModel `json:"model,omitzero" api:"required"`
	// The voice to use for generating the audio. The voices supported are different
	// for each model. For eg - for canopylabs/orpheus-3b-0.1-ft, one of the voices
	// supported is tara, for hexgrad/Kokoro-82M, one of the voices supported is
	// af_alloy and for cartesia/sonic, one of the voices supported is "friendly
	// sidekick".
	//
	// You can view the voices supported for each model using the /v1/voices endpoint
	// sending the model name as the query parameter.
	// [View all supported voices here](https://docs.together.ai/docs/text-to-speech#supported-voices).
	//
	// `hexgrad/Kokoro-82M` additionally supports voice mixing, where two or more
	// voices are combined into a single blended voice by joining their names with `+`
	// (e.g. `af_bella+af_heart`). Optional per-voice weights can be provided in
	// parentheses (e.g. `af_bella(2)+af_heart(1)`). Other models require a single
	// voice name.
	Voice string `json:"voice" api:"required"`
	// Language or locale of input text. Accepts ISO 639-1 language codes (e.g., `en`,
	// `fr`, `es`, `zh`) as well as locale codes for region-specific variants. Locale
	// codes must be lowercase (e.g., `zh-hk` for Cantonese).
	Language param.Opt[string] `json:"language,omitzero"`
	// Sampling rate in Hz for the output audio. Cartesia and Minimax models respect
	// this parameter. Orpheus and Kokoro models always output at 24000 Hz regardless
	// of this setting.
	SampleRate param.Opt[int64] `json:"sample_rate,omitzero"`
	// Bitrate of the MP3 audio output in bits per second. Only applicable when
	// response_format is mp3. Higher values produce better audio quality at larger
	// file sizes. Default is 128000. Currently supported on Cartesia models.
	//
	// Any of 32000, 64000, 96000, 128000, 192000.
	BitRate int64 `json:"bit_rate,omitzero"`
	// Additional model-specific parameters that fine-tune speech generation behavior.
	ExtraParams AudioSpeechNewParamsExtraParams `json:"extra_params,omitzero"`
	// Audio encoding of response. Only applicable when response_format is raw or pcm.
	// Cartesia models respect this parameter and support all values. Orpheus, Kokoro,
	// and Minimax models always return pcm_s16le regardless of this setting.
	//
	// Any of "pcm_f32le", "pcm_s16le", "pcm_mulaw", "pcm_alaw".
	ResponseEncoding AudioSpeechNewParamsResponseEncoding `json:"response_encoding,omitzero"`
	// The format of audio output. Supported formats are mp3, wav, raw if streaming is
	// false. If streaming is true, the only supported format is raw.
	//
	// Any of "mp3", "wav", "raw".
	ResponseFormat AudioSpeechNewParamsResponseFormat `json:"response_format,omitzero"`
	// contains filtered or unexported fields
}

func (AudioSpeechNewParams) MarshalJSON

func (r AudioSpeechNewParams) MarshalJSON() (data []byte, err error)

func (*AudioSpeechNewParams) UnmarshalJSON

func (r *AudioSpeechNewParams) UnmarshalJSON(data []byte) error

type AudioSpeechNewParamsExtraParams added in v0.10.0

type AudioSpeechNewParamsExtraParams struct {
	// A list of pronunciation rules for specific characters or symbols. Each entry
	// uses the format `"<source>/<replacement>"` (e.g., `["omg/oh my god"]`) to
	// override how the model pronounces matching tokens.
	PronunciationDict []string `json:"pronunciation_dict,omitzero"`
	// contains filtered or unexported fields
}

Additional model-specific parameters that fine-tune speech generation behavior.

func (AudioSpeechNewParamsExtraParams) MarshalJSON added in v0.10.0

func (r AudioSpeechNewParamsExtraParams) MarshalJSON() (data []byte, err error)

func (*AudioSpeechNewParamsExtraParams) UnmarshalJSON added in v0.10.0

func (r *AudioSpeechNewParamsExtraParams) UnmarshalJSON(data []byte) error

type AudioSpeechNewParamsModel

type AudioSpeechNewParamsModel string

The name of the model to query.

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#audio-models) The current supported tts models are: - cartesia/sonic - hexgrad/Kokoro-82M - canopylabs/orpheus-3b-0.1-ft

const (
	AudioSpeechNewParamsModelCartesiaSonic            AudioSpeechNewParamsModel = "cartesia/sonic"
	AudioSpeechNewParamsModelHexgradKokoro82M         AudioSpeechNewParamsModel = "hexgrad/Kokoro-82M"
	AudioSpeechNewParamsModelCanopylabsOrpheus3b0_1Ft AudioSpeechNewParamsModel = "canopylabs/orpheus-3b-0.1-ft"
)

type AudioSpeechNewParamsResponseEncoding

type AudioSpeechNewParamsResponseEncoding string

Audio encoding of response. Only applicable when response_format is raw or pcm. Cartesia models respect this parameter and support all values. Orpheus, Kokoro, and Minimax models always return pcm_s16le regardless of this setting.

const (
	AudioSpeechNewParamsResponseEncodingPcmF32le AudioSpeechNewParamsResponseEncoding = "pcm_f32le"
	AudioSpeechNewParamsResponseEncodingPcmS16le AudioSpeechNewParamsResponseEncoding = "pcm_s16le"
	AudioSpeechNewParamsResponseEncodingPcmMulaw AudioSpeechNewParamsResponseEncoding = "pcm_mulaw"
	AudioSpeechNewParamsResponseEncodingPcmAlaw  AudioSpeechNewParamsResponseEncoding = "pcm_alaw"
)

type AudioSpeechNewParamsResponseFormat

type AudioSpeechNewParamsResponseFormat string

The format of audio output. Supported formats are mp3, wav, raw if streaming is false. If streaming is true, the only supported format is raw.

const (
	AudioSpeechNewParamsResponseFormatMP3 AudioSpeechNewParamsResponseFormat = "mp3"
	AudioSpeechNewParamsResponseFormatWav AudioSpeechNewParamsResponseFormat = "wav"
	AudioSpeechNewParamsResponseFormatRaw AudioSpeechNewParamsResponseFormat = "raw"
)

type AudioSpeechService

type AudioSpeechService struct {
	Options []option.RequestOption
}

AudioSpeechService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAudioSpeechService method instead.

func NewAudioSpeechService

func NewAudioSpeechService(opts ...option.RequestOption) (r AudioSpeechService)

NewAudioSpeechService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AudioSpeechService) New

Generate audio from input text

func (*AudioSpeechService) NewStreaming

Generate audio from input text

type AudioSpeechStreamChunk

type AudioSpeechStreamChunk struct {
	// base64 encoded audio stream
	B64   string `json:"b64" api:"required"`
	Model string `json:"model" api:"required"`
	// The object type, which is always `audio.tts.chunk`.
	Object constant.AudioTtsChunk `json:"object" default:"audio.tts.chunk"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		B64         respjson.Field
		Model       respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioSpeechStreamChunk) RawJSON

func (r AudioSpeechStreamChunk) RawJSON() string

Returns the unmodified JSON received from the API

func (*AudioSpeechStreamChunk) UnmarshalJSON

func (r *AudioSpeechStreamChunk) UnmarshalJSON(data []byte) error

type AudioTranscriptionNewParams

type AudioTranscriptionNewParams struct {
	// Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a,
	// .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is
	// rejected with `audio_too_long`. Binary uploads are additionally capped at 80 MB
	// (HTTP 413); URL-fetched audio is capped at 1 GB.
	File AudioTranscriptionNewParamsFileUnion `json:"file,omitzero" api:"required" format:"binary"`
	// Whether to enable speaker diarization. When enabled, you will get the speaker id
	// for each word in the transcription. In the response, in the words array, you
	// will get the speaker id for each word. In addition, we also return the
	// speaker_segments array which contains the speaker id for each speaker segment
	// along with the start and end time of the segment along with all the words in the
	// segment.
	//
	// For eg - ... "speaker_segments": [ "speaker_id": "SPEAKER_00", "start": 0,
	// "end": 30.02, "words": [ { "id": 0, "word": "Tijana", "start": 0, "end": 11.475,
	// "speaker_id": "SPEAKER_00" }, ...
	Diarize param.Opt[bool] `json:"diarize,omitzero"`
	// Optional ISO 639-1 language code. If `auto` is provided, language is
	// auto-detected.
	Language param.Opt[string] `json:"language,omitzero"`
	// Maximum number of speakers expected in the audio. Used to improve diarization
	// accuracy when the approximate number of speakers is known.
	MaxSpeakers param.Opt[int64] `json:"max_speakers,omitzero"`
	// Minimum number of speakers expected in the audio. Used to improve diarization
	// accuracy when the approximate number of speakers is known.
	MinSpeakers param.Opt[int64] `json:"min_speakers,omitzero"`
	// Optional text to bias decoding. Supported only on Whisper-family models (e.g.
	// `openai/whisper-large-v3`). Other STT models (e.g.
	// `nvidia/parakeet-tdt-0.6b-v3`) accept the field for API compatibility but ignore
	// it.
	Prompt param.Opt[string] `json:"prompt,omitzero"`
	// Sampling temperature between 0.0 and 1.0
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// Model to use for transcription
	//
	// Any of "openai/whisper-large-v3".
	Model AudioTranscriptionNewParamsModel `json:"model,omitzero"`
	// The format of the response
	//
	// Any of "json", "verbose_json".
	ResponseFormat AudioTranscriptionNewParamsResponseFormat `json:"response_format,omitzero"`
	// Controls level of timestamp detail in verbose_json. Only used when
	// response_format is verbose_json. Can be a single granularity or an array to get
	// multiple levels.
	TimestampGranularities AudioTranscriptionNewParamsTimestampGranularitiesUnion `json:"timestamp_granularities,omitzero"`
	// contains filtered or unexported fields
}

func (AudioTranscriptionNewParams) MarshalMultipart

func (r AudioTranscriptionNewParams) MarshalMultipart() (data []byte, contentType string, err error)

type AudioTranscriptionNewParamsFileUnion added in v0.3.0

type AudioTranscriptionNewParamsFileUnion struct {
	OfFile   io.Reader         `json:",omitzero,inline"`
	OfString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (AudioTranscriptionNewParamsFileUnion) MarshalJSON added in v0.3.0

func (u AudioTranscriptionNewParamsFileUnion) MarshalJSON() ([]byte, error)

func (*AudioTranscriptionNewParamsFileUnion) UnmarshalJSON added in v0.3.0

func (u *AudioTranscriptionNewParamsFileUnion) UnmarshalJSON(data []byte) error

type AudioTranscriptionNewParamsModel

type AudioTranscriptionNewParamsModel string

Model to use for transcription

const (
	AudioTranscriptionNewParamsModelOpenAIWhisperLargeV3 AudioTranscriptionNewParamsModel = "openai/whisper-large-v3"
)

type AudioTranscriptionNewParamsResponseFormat

type AudioTranscriptionNewParamsResponseFormat string

The format of the response

const (
	AudioTranscriptionNewParamsResponseFormatJson        AudioTranscriptionNewParamsResponseFormat = "json"
	AudioTranscriptionNewParamsResponseFormatVerboseJson AudioTranscriptionNewParamsResponseFormat = "verbose_json"
)

type AudioTranscriptionNewParamsTimestampGranularitiesString

type AudioTranscriptionNewParamsTimestampGranularitiesString string
const (
	AudioTranscriptionNewParamsTimestampGranularitiesStringSegment AudioTranscriptionNewParamsTimestampGranularitiesString = "segment"
	AudioTranscriptionNewParamsTimestampGranularitiesStringWord    AudioTranscriptionNewParamsTimestampGranularitiesString = "word"
)

type AudioTranscriptionNewParamsTimestampGranularitiesUnion

type AudioTranscriptionNewParamsTimestampGranularitiesUnion struct {
	// Check if union is this variant with
	// !param.IsOmitted(union.OfAudioTranscriptionNewsTimestampGranularitiesString)
	OfAudioTranscriptionNewsTimestampGranularitiesString         param.Opt[string] `json:",omitzero,inline"`
	OfAudioTranscriptionNewsTimestampGranularitiesArrayItemArray []string          `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (AudioTranscriptionNewParamsTimestampGranularitiesUnion) MarshalJSON

func (*AudioTranscriptionNewParamsTimestampGranularitiesUnion) UnmarshalJSON

type AudioTranscriptionNewResponseAudioTranscriptionJsonResponse

type AudioTranscriptionNewResponseAudioTranscriptionJsonResponse struct {
	// The transcribed text
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranscriptionNewResponseAudioTranscriptionJsonResponse) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseAudioTranscriptionJsonResponse) UnmarshalJSON

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse struct {
	// The duration of the audio in seconds
	Duration float64 `json:"duration" api:"required"`
	// The language of the audio
	Language string `json:"language" api:"required"`
	// Array of transcription segments
	Segments []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment `json:"segments" api:"required"`
	// The transcribed text
	Text string `json:"text" api:"required"`
	// Array of transcription speaker segments (only when diarize is enabled)
	SpeakerSegments []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment `json:"speaker_segments"`
	// Array of transcription words (only when timestamp_granularities includes 'word')
	Words []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord `json:"words"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Duration        respjson.Field
		Language        respjson.Field
		Segments        respjson.Field
		Text            respjson.Field
		SpeakerSegments respjson.Field
		Words           respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse) UnmarshalJSON

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment struct {
	// Unique identifier for the segment
	ID int64 `json:"id" api:"required"`
	// End time of the segment in seconds
	End float64 `json:"end" api:"required"`
	// Start time of the segment in seconds
	Start float64 `json:"start" api:"required"`
	// The text content of the segment
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		End         respjson.Field
		Start       respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment) UnmarshalJSON

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment struct {
	// Unique identifier for the speaker segment
	ID int64 `json:"id" api:"required"`
	// End time of the speaker segment in seconds
	End float64 `json:"end" api:"required"`
	// The speaker identifier
	SpeakerID string `json:"speaker_id" api:"required"`
	// Start time of the speaker segment in seconds
	Start float64 `json:"start" api:"required"`
	// The full text spoken by this speaker in this segment
	Text string `json:"text" api:"required"`
	// Array of words spoken by this speaker in this segment
	Words []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord `json:"words" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		End         respjson.Field
		SpeakerID   respjson.Field
		Start       respjson.Field
		Text        respjson.Field
		Words       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment) UnmarshalJSON

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord struct {
	// End time of the word in seconds
	End float64 `json:"end" api:"required"`
	// Start time of the word in seconds
	Start float64 `json:"start" api:"required"`
	// The word
	Word string `json:"word" api:"required"`
	// The speaker id for the word (only when diarize is enabled)
	SpeakerID string `json:"speaker_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		End         respjson.Field
		Start       respjson.Field
		Word        respjson.Field
		SpeakerID   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegmentWord) UnmarshalJSON

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord

type AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord struct {
	// End time of the word in seconds
	End float64 `json:"end" api:"required"`
	// Start time of the word in seconds
	Start float64 `json:"start" api:"required"`
	// The word
	Word string `json:"word" api:"required"`
	// The speaker id for the word (only when diarize is enabled)
	SpeakerID string `json:"speaker_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		End         respjson.Field
		Start       respjson.Field
		Word        respjson.Field
		SpeakerID   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord) UnmarshalJSON

type AudioTranscriptionNewResponseUnion

type AudioTranscriptionNewResponseUnion struct {
	Text string `json:"text"`
	// This field is from variant
	// [AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse].
	Duration float64 `json:"duration"`
	// This field is from variant
	// [AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse].
	Language string `json:"language"`
	// This field is from variant
	// [AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse].
	Segments []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSegment `json:"segments"`
	// This field is from variant
	// [AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse].
	SpeakerSegments []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseSpeakerSegment `json:"speaker_segments"`
	// This field is from variant
	// [AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse].
	Words []AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponseWord `json:"words"`
	JSON  struct {
		Text            respjson.Field
		Duration        respjson.Field
		Language        respjson.Field
		Segments        respjson.Field
		SpeakerSegments respjson.Field
		Words           respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AudioTranscriptionNewResponseUnion contains all possible properties and values from AudioTranscriptionNewResponseAudioTranscriptionJsonResponse, AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (AudioTranscriptionNewResponseUnion) AsAudioTranscriptionNewResponseAudioTranscriptionJsonResponse

func (u AudioTranscriptionNewResponseUnion) AsAudioTranscriptionNewResponseAudioTranscriptionJsonResponse() (v AudioTranscriptionNewResponseAudioTranscriptionJsonResponse)

func (AudioTranscriptionNewResponseUnion) AsAudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse

func (u AudioTranscriptionNewResponseUnion) AsAudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse() (v AudioTranscriptionNewResponseAudioTranscriptionVerboseJsonResponse)

func (AudioTranscriptionNewResponseUnion) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranscriptionNewResponseUnion) UnmarshalJSON

func (r *AudioTranscriptionNewResponseUnion) UnmarshalJSON(data []byte) error

type AudioTranscriptionService

type AudioTranscriptionService struct {
	Options []option.RequestOption
}

AudioTranscriptionService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAudioTranscriptionService method instead.

func NewAudioTranscriptionService

func NewAudioTranscriptionService(opts ...option.RequestOption) (r AudioTranscriptionService)

NewAudioTranscriptionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AudioTranscriptionService) New

Transcribes audio into text

type AudioTranslationNewParams

type AudioTranslationNewParams struct {
	// Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a,
	// .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is
	// rejected with `audio_too_long`. Binary uploads are additionally capped at 80 MB
	// (HTTP 413); URL-fetched audio is capped at 1 GB.
	File AudioTranslationNewParamsFileUnion `json:"file,omitzero" api:"required" format:"binary"`
	// Target output language. Optional ISO 639-1 language code. If omitted, language
	// is set to English.
	Language param.Opt[string] `json:"language,omitzero"`
	// Optional text to bias decoding. Supported only on Whisper-family models (e.g.
	// `openai/whisper-large-v3`). Other STT models (e.g.
	// `nvidia/parakeet-tdt-0.6b-v3`) accept the field for API compatibility but ignore
	// it.
	Prompt param.Opt[string] `json:"prompt,omitzero"`
	// Sampling temperature between 0.0 and 1.0
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// Model to use for translation
	//
	// Any of "openai/whisper-large-v3".
	Model AudioTranslationNewParamsModel `json:"model,omitzero"`
	// The format of the response
	//
	// Any of "json", "verbose_json".
	ResponseFormat AudioTranslationNewParamsResponseFormat `json:"response_format,omitzero"`
	// Controls level of timestamp detail in verbose_json. Only used when
	// response_format is verbose_json. Can be a single granularity or an array to get
	// multiple levels.
	TimestampGranularities AudioTranslationNewParamsTimestampGranularitiesUnion `json:"timestamp_granularities,omitzero"`
	// contains filtered or unexported fields
}

func (AudioTranslationNewParams) MarshalMultipart

func (r AudioTranslationNewParams) MarshalMultipart() (data []byte, contentType string, err error)

type AudioTranslationNewParamsFileUnion added in v0.3.0

type AudioTranslationNewParamsFileUnion struct {
	OfFile   io.Reader         `json:",omitzero,inline"`
	OfString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (AudioTranslationNewParamsFileUnion) MarshalJSON added in v0.3.0

func (u AudioTranslationNewParamsFileUnion) MarshalJSON() ([]byte, error)

func (*AudioTranslationNewParamsFileUnion) UnmarshalJSON added in v0.3.0

func (u *AudioTranslationNewParamsFileUnion) UnmarshalJSON(data []byte) error

type AudioTranslationNewParamsModel

type AudioTranslationNewParamsModel string

Model to use for translation

const (
	AudioTranslationNewParamsModelOpenAIWhisperLargeV3 AudioTranslationNewParamsModel = "openai/whisper-large-v3"
)

type AudioTranslationNewParamsResponseFormat

type AudioTranslationNewParamsResponseFormat string

The format of the response

const (
	AudioTranslationNewParamsResponseFormatJson        AudioTranslationNewParamsResponseFormat = "json"
	AudioTranslationNewParamsResponseFormatVerboseJson AudioTranslationNewParamsResponseFormat = "verbose_json"
)

type AudioTranslationNewParamsTimestampGranularitiesString

type AudioTranslationNewParamsTimestampGranularitiesString string
const (
	AudioTranslationNewParamsTimestampGranularitiesStringSegment AudioTranslationNewParamsTimestampGranularitiesString = "segment"
	AudioTranslationNewParamsTimestampGranularitiesStringWord    AudioTranslationNewParamsTimestampGranularitiesString = "word"
)

type AudioTranslationNewParamsTimestampGranularitiesUnion

type AudioTranslationNewParamsTimestampGranularitiesUnion struct {
	// Check if union is this variant with
	// !param.IsOmitted(union.OfAudioTranslationNewsTimestampGranularitiesString)
	OfAudioTranslationNewsTimestampGranularitiesString         param.Opt[string] `json:",omitzero,inline"`
	OfAudioTranslationNewsTimestampGranularitiesArrayItemArray []string          `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (AudioTranslationNewParamsTimestampGranularitiesUnion) MarshalJSON

func (*AudioTranslationNewParamsTimestampGranularitiesUnion) UnmarshalJSON

type AudioTranslationNewResponseAudioTranslationJsonResponse

type AudioTranslationNewResponseAudioTranslationJsonResponse struct {
	// The translated text
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranslationNewResponseAudioTranslationJsonResponse) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranslationNewResponseAudioTranslationJsonResponse) UnmarshalJSON

type AudioTranslationNewResponseAudioTranslationVerboseJsonResponse

type AudioTranslationNewResponseAudioTranslationVerboseJsonResponse struct {
	// The duration of the audio in seconds
	Duration float64 `json:"duration" api:"required"`
	// The target language of the translation
	Language string `json:"language" api:"required"`
	// Array of translation segments
	Segments []AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment `json:"segments" api:"required"`
	// The translated text
	Text string `json:"text" api:"required"`
	// Array of translation words (only when timestamp_granularities includes 'word')
	Words []AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord `json:"words"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Duration    respjson.Field
		Language    respjson.Field
		Segments    respjson.Field
		Text        respjson.Field
		Words       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranslationNewResponseAudioTranslationVerboseJsonResponse) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranslationNewResponseAudioTranslationVerboseJsonResponse) UnmarshalJSON

type AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment

type AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment struct {
	// Unique identifier for the segment
	ID int64 `json:"id" api:"required"`
	// End time of the segment in seconds
	End float64 `json:"end" api:"required"`
	// Start time of the segment in seconds
	Start float64 `json:"start" api:"required"`
	// The text content of the segment
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		End         respjson.Field
		Start       respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment) UnmarshalJSON

type AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord

type AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord struct {
	// End time of the word in seconds
	End float64 `json:"end" api:"required"`
	// Start time of the word in seconds
	Start float64 `json:"start" api:"required"`
	// The word
	Word string `json:"word" api:"required"`
	// The speaker id for the word (only when diarize is enabled)
	SpeakerID string `json:"speaker_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		End         respjson.Field
		Start       respjson.Field
		Word        respjson.Field
		SpeakerID   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord) UnmarshalJSON

type AudioTranslationNewResponseUnion

type AudioTranslationNewResponseUnion struct {
	Text string `json:"text"`
	// This field is from variant
	// [AudioTranslationNewResponseAudioTranslationVerboseJsonResponse].
	Duration float64 `json:"duration"`
	// This field is from variant
	// [AudioTranslationNewResponseAudioTranslationVerboseJsonResponse].
	Language string `json:"language"`
	// This field is from variant
	// [AudioTranslationNewResponseAudioTranslationVerboseJsonResponse].
	Segments []AudioTranslationNewResponseAudioTranslationVerboseJsonResponseSegment `json:"segments"`
	// This field is from variant
	// [AudioTranslationNewResponseAudioTranslationVerboseJsonResponse].
	Words []AudioTranslationNewResponseAudioTranslationVerboseJsonResponseWord `json:"words"`
	JSON  struct {
		Text     respjson.Field
		Duration respjson.Field
		Language respjson.Field
		Segments respjson.Field
		Words    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AudioTranslationNewResponseUnion contains all possible properties and values from AudioTranslationNewResponseAudioTranslationJsonResponse, AudioTranslationNewResponseAudioTranslationVerboseJsonResponse.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (AudioTranslationNewResponseUnion) AsAudioTranslationNewResponseAudioTranslationJsonResponse

func (u AudioTranslationNewResponseUnion) AsAudioTranslationNewResponseAudioTranslationJsonResponse() (v AudioTranslationNewResponseAudioTranslationJsonResponse)

func (AudioTranslationNewResponseUnion) AsAudioTranslationNewResponseAudioTranslationVerboseJsonResponse

func (u AudioTranslationNewResponseUnion) AsAudioTranslationNewResponseAudioTranslationVerboseJsonResponse() (v AudioTranslationNewResponseAudioTranslationVerboseJsonResponse)

func (AudioTranslationNewResponseUnion) RawJSON

Returns the unmodified JSON received from the API

func (*AudioTranslationNewResponseUnion) UnmarshalJSON

func (r *AudioTranslationNewResponseUnion) UnmarshalJSON(data []byte) error

type AudioTranslationService

type AudioTranslationService struct {
	Options []option.RequestOption
}

AudioTranslationService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAudioTranslationService method instead.

func NewAudioTranslationService

func NewAudioTranslationService(opts ...option.RequestOption) (r AudioTranslationService)

NewAudioTranslationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AudioTranslationService) New

Translates audio into English

type AudioVoiceListResponse

type AudioVoiceListResponse struct {
	Data []AudioVoiceListResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing a list of models and their available voices.

func (AudioVoiceListResponse) RawJSON

func (r AudioVoiceListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*AudioVoiceListResponse) UnmarshalJSON

func (r *AudioVoiceListResponse) UnmarshalJSON(data []byte) error

type AudioVoiceListResponseData

type AudioVoiceListResponseData struct {
	// Model name.
	Model string `json:"model" api:"required"`
	// List of available voices for the model.
	Voices []AudioVoiceListResponseDataVoice `json:"voices" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Model       respjson.Field
		Voices      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a model with its available voices.

func (AudioVoiceListResponseData) RawJSON

func (r AudioVoiceListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*AudioVoiceListResponseData) UnmarshalJSON

func (r *AudioVoiceListResponseData) UnmarshalJSON(data []byte) error

type AudioVoiceListResponseDataVoice

type AudioVoiceListResponseDataVoice struct {
	ID string `json:"id" api:"required"`
	// Voice name to be used for audio inference.
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioVoiceListResponseDataVoice) RawJSON

Returns the unmodified JSON received from the API

func (*AudioVoiceListResponseDataVoice) UnmarshalJSON

func (r *AudioVoiceListResponseDataVoice) UnmarshalJSON(data []byte) error

type AudioVoiceService

type AudioVoiceService struct {
	Options []option.RequestOption
}

AudioVoiceService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAudioVoiceService method instead.

func NewAudioVoiceService

func NewAudioVoiceService(opts ...option.RequestOption) (r AudioVoiceService)

NewAudioVoiceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AudioVoiceService) List

Fetch available voices for each model

type BatchJob

type BatchJob struct {
	ID          string    `json:"id" format:"uuid"`
	CompletedAt time.Time `json:"completed_at" format:"date-time"`
	CreatedAt   time.Time `json:"created_at" format:"date-time"`
	Endpoint    string    `json:"endpoint"`
	Error       string    `json:"error"`
	ErrorFileID string    `json:"error_file_id"`
	// Size of input file in bytes
	FileSizeBytes int64     `json:"file_size_bytes"`
	InputFileID   string    `json:"input_file_id"`
	JobDeadline   time.Time `json:"job_deadline" format:"date-time"`
	// Model used for processing requests
	ModelID      string `json:"model_id"`
	OutputFileID string `json:"output_file_id"`
	// Completion progress (0.0 to 100)
	Progress float64 `json:"progress"`
	// Current status of the batch job
	//
	// Any of "VALIDATING", "IN_PROGRESS", "COMPLETED", "FAILED", "EXPIRED",
	// "CANCELLED".
	Status BatchJobStatus `json:"status"`
	UserID string         `json:"user_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CompletedAt   respjson.Field
		CreatedAt     respjson.Field
		Endpoint      respjson.Field
		Error         respjson.Field
		ErrorFileID   respjson.Field
		FileSizeBytes respjson.Field
		InputFileID   respjson.Field
		JobDeadline   respjson.Field
		ModelID       respjson.Field
		OutputFileID  respjson.Field
		Progress      respjson.Field
		Status        respjson.Field
		UserID        respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchJob) RawJSON

func (r BatchJob) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchJob) UnmarshalJSON

func (r *BatchJob) UnmarshalJSON(data []byte) error

type BatchJobStatus

type BatchJobStatus string

Current status of the batch job

const (
	BatchJobStatusValidating BatchJobStatus = "VALIDATING"
	BatchJobStatusInProgress BatchJobStatus = "IN_PROGRESS"
	BatchJobStatusCompleted  BatchJobStatus = "COMPLETED"
	BatchJobStatusFailed     BatchJobStatus = "FAILED"
	BatchJobStatusExpired    BatchJobStatus = "EXPIRED"
	BatchJobStatusCancelled  BatchJobStatus = "CANCELLED"
)

type BatchNewParams

type BatchNewParams struct {
	// The endpoint to use for batch processing. Each line of the uploaded input file
	// is dispatched against this endpoint.
	//
	// - `/v1/chat/completions` — chat completion batches
	// - `/v1/audio/transcriptions` — audio transcription batches (e.g.
	//   `openai/whisper-large-v3`)
	// - `/v1/audio/translations` — audio translation batches
	//
	// Any of "/v1/chat/completions", "/v1/audio/transcriptions",
	// "/v1/audio/translations".
	Endpoint BatchNewParamsEndpoint `json:"endpoint,omitzero" api:"required"`
	// ID of the uploaded input file containing batch requests
	InputFileID string `json:"input_file_id" api:"required"`
	// Time window for batch completion (optional)
	CompletionWindow param.Opt[string] `json:"completion_window,omitzero"`
	// Model to use for processing batch requests
	ModelID param.Opt[string] `json:"model_id,omitzero"`
	// Priority for batch processing (optional)
	Priority param.Opt[int64] `json:"priority,omitzero"`
	// contains filtered or unexported fields
}

func (BatchNewParams) MarshalJSON

func (r BatchNewParams) MarshalJSON() (data []byte, err error)

func (*BatchNewParams) UnmarshalJSON

func (r *BatchNewParams) UnmarshalJSON(data []byte) error

type BatchNewParamsEndpoint added in v0.10.0

type BatchNewParamsEndpoint string

The endpoint to use for batch processing. Each line of the uploaded input file is dispatched against this endpoint.

  • `/v1/chat/completions` — chat completion batches
  • `/v1/audio/transcriptions` — audio transcription batches (e.g. `openai/whisper-large-v3`)
  • `/v1/audio/translations` — audio translation batches
const (
	BatchNewParamsEndpointV1ChatCompletions     BatchNewParamsEndpoint = "/v1/chat/completions"
	BatchNewParamsEndpointV1AudioTranscriptions BatchNewParamsEndpoint = "/v1/audio/transcriptions"
	BatchNewParamsEndpointV1AudioTranslations   BatchNewParamsEndpoint = "/v1/audio/translations"
)

type BatchNewResponse

type BatchNewResponse struct {
	Job     BatchJob `json:"job"`
	Warning string   `json:"warning"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Job         respjson.Field
		Warning     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchNewResponse) RawJSON

func (r BatchNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchNewResponse) UnmarshalJSON

func (r *BatchNewResponse) UnmarshalJSON(data []byte) error

type BatchService

type BatchService struct {
	Options []option.RequestOption
}

BatchService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBatchService method instead.

func NewBatchService

func NewBatchService(opts ...option.RequestOption) (r BatchService)

NewBatchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BatchService) Cancel

func (r *BatchService) Cancel(ctx context.Context, id string, opts ...option.RequestOption) (res *BatchJob, err error)

Cancel a batch job by ID

func (*BatchService) Get

func (r *BatchService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *BatchJob, err error)

Get details of a batch job by ID

func (*BatchService) List

func (r *BatchService) List(ctx context.Context, opts ...option.RequestOption) (res *[]BatchJob, err error)

List all batch jobs for the authenticated user

func (*BatchService) New

func (r *BatchService) New(ctx context.Context, body BatchNewParams, opts ...option.RequestOption) (res *BatchNewResponse, err error)

Create a new batch job with the given input file and endpoint

type BetaJigDeployParams added in v0.6.0

type BetaJigDeployParams struct {
	// GPUType specifies the GPU hardware to use (e.g., "h100-80gb").
	//
	// Any of "h100-80gb", "h100-40gb-mig", "h200-140gb", "b200-192gb".
	GPUType BetaJigDeployParamsGPUType `json:"gpu_type,omitzero" api:"required"`
	// Image is the container image to deploy from registry.together.ai.
	Image string `json:"image" api:"required"`
	// Name is the unique identifier for your deployment. Must contain lowercase
	// letters, numbers, or hyphens, start with a lowercase letter or number, and be
	// 4-63 characters. It cannot be changed.
	Name string `json:"name" api:"required"`
	// CPU is the number of CPU cores to allocate per container instance (e.g., 0.1 =
	// 100 milli cores)
	CPU param.Opt[float64] `json:"cpu,omitzero"`
	// Description is an optional human-readable description of your deployment
	Description param.Opt[string] `json:"description,omitzero"`
	// GPUCount is the number of GPUs to allocate per container instance. Defaults to 0
	// if not specified
	GPUCount param.Opt[int64] `json:"gpu_count,omitzero"`
	// HealthCheckPath is the HTTP path for health checks (e.g., "/health"). If set,
	// the platform checks this endpoint to determine container health.
	HealthCheckPath param.Opt[string] `json:"health_check_path,omitzero"`
	// MaxReplicas is the maximum number of container instances. Defaults to
	// MinReplicas if not set.
	MaxReplicas param.Opt[int64] `json:"max_replicas,omitzero"`
	// Memory is the amount of RAM to allocate per container instance in GiB (e.g., 0.5
	// = 512MiB)
	Memory param.Opt[float64] `json:"memory,omitzero"`
	// MinReplicas is the minimum number of container instances to run. Defaults to 1
	// if not specified
	MinReplicas param.Opt[int64] `json:"min_replicas,omitzero"`
	// Port is the container port your application listens on (e.g., 8080 for web
	// servers). Required if your application serves traffic
	Port param.Opt[int64] `json:"port,omitzero"`
	// Storage is the amount of ephemeral disk storage to allocate per container
	// instance (e.g., 10 = 10GiB)
	Storage param.Opt[int64] `json:"storage,omitzero"`
	// TerminationGracePeriodSeconds is the time in seconds to wait for graceful
	// shutdown before forcefully terminating the replica
	TerminationGracePeriodSeconds param.Opt[int64] `json:"termination_grace_period_seconds,omitzero"`
	// Args overrides the container's CMD. Provide as an array of arguments (e.g.,
	// ["python", "app.py"])
	Args []string `json:"args,omitzero"`
	// Autoscaling configuration. Example: {"metric": "QueueBacklogPerWorker",
	// "target": 1.01} to scale based on queue backlog. Omit or set to null to disable
	// autoscaling
	Autoscaling BetaJigDeployParamsAutoscalingUnion `json:"autoscaling,omitzero"`
	// Controls how replicas above reserved capacity behave. `stable` replicas stay
	// running after scale-up; `preemptible` replicas may be evicted during capacity
	// contention.
	//
	// Any of "stable", "preemptible".
	CapacityType BetaJigDeployParamsCapacityType `json:"capacity_type,omitzero"`
	// Command overrides the container's ENTRYPOINT. Provide as an array (e.g.,
	// ["/bin/sh", "-c"])
	Command []string `json:"command,omitzero"`
	// EnvironmentVariables is a list of environment variables to set in the container.
	// Each must have a name and either a value or value_from_secret
	EnvironmentVariables []BetaJigDeployParamsEnvironmentVariable `json:"environment_variables,omitzero"`
	// Model weights to preload from Together's model registry into the container. At
	// most one mount is supported, and it cannot be used with volumes.
	ModelMounts []BetaJigDeployParamsModelMount `json:"model_mounts,omitzero"`
	// Volumes is a list of volume mounts to attach to the container. Each mount must
	// reference an existing volume by name
	Volumes []BetaJigDeployParamsVolume `json:"volumes,omitzero"`
	// contains filtered or unexported fields
}

func (BetaJigDeployParams) MarshalJSON added in v0.6.0

func (r BetaJigDeployParams) MarshalJSON() (data []byte, err error)

func (*BetaJigDeployParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigDeployParams) UnmarshalJSON(data []byte) error

type BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig added in v0.7.0

type BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig struct {
	// CustomMetricName is the Prometheus metric name. Must match
	// [a-zA-Z\_:][a-zA-Z0-9_:]\*
	CustomMetricName param.Opt[string] `json:"custom_metric_name,omitzero"`
	// Target is the threshold value. Default: 500
	Target param.Opt[float64] `json:"target,omitzero"`
	// Metric must be CustomMetric
	//
	// Any of "CustomMetric".
	Metric string `json:"metric,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling config for CustomMetric metric

func (BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig) MarshalJSON added in v0.7.0

func (*BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON added in v0.7.0

type BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig added in v0.7.0

type BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig struct {
	// Target is the threshold value. Default: 100 for HTTPTotalRequests, 500 (ms) for
	// HTTPAvgRequestDuration
	Target param.Opt[float64] `json:"target,omitzero"`
	// TimeIntervalMinutes is the rate window in minutes. Default: 10
	TimeIntervalMinutes param.Opt[int64] `json:"time_interval_minutes,omitzero"`
	// Metric must be HTTPTotalRequests or HTTPAvgRequestDuration
	//
	// Any of "HTTPTotalRequests", "HTTPAvgRequestDuration".
	Metric string `json:"metric,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling config for HTTPTotalRequests and HTTPAvgRequestDuration metrics

func (BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig) MarshalJSON added in v0.7.0

func (r BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig) MarshalJSON() (data []byte, err error)

func (*BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig) UnmarshalJSON added in v0.7.0

type BetaJigDeployParamsAutoscalingQueueAutoscalingConfig added in v0.7.0

type BetaJigDeployParamsAutoscalingQueueAutoscalingConfig struct {
	// Model overrides the model name for queue status lookup. Defaults to the
	// deployment app name
	Model param.Opt[string] `json:"model,omitzero"`
	// Target is the threshold value. Default: 1.01
	Target param.Opt[float64] `json:"target,omitzero"`
	// Metric must be QueueBacklogPerWorker
	//
	// Any of "QueueBacklogPerWorker".
	Metric string `json:"metric,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling config for QueueBacklogPerWorker metric

func (BetaJigDeployParamsAutoscalingQueueAutoscalingConfig) MarshalJSON added in v0.7.0

func (r BetaJigDeployParamsAutoscalingQueueAutoscalingConfig) MarshalJSON() (data []byte, err error)

func (*BetaJigDeployParamsAutoscalingQueueAutoscalingConfig) UnmarshalJSON added in v0.7.0

type BetaJigDeployParamsAutoscalingUnion added in v0.7.0

type BetaJigDeployParamsAutoscalingUnion struct {
	OfBetaJigDeploysAutoscalingHTTPAutoscalingConfig         *BetaJigDeployParamsAutoscalingHTTPAutoscalingConfig         `json:",omitzero,inline"`
	OfBetaJigDeploysAutoscalingQueueAutoscalingConfig        *BetaJigDeployParamsAutoscalingQueueAutoscalingConfig        `json:",omitzero,inline"`
	OfBetaJigDeploysAutoscalingCustomMetricAutoscalingConfig *BetaJigDeployParamsAutoscalingCustomMetricAutoscalingConfig `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BetaJigDeployParamsAutoscalingUnion) GetCustomMetricName added in v0.7.0

func (u BetaJigDeployParamsAutoscalingUnion) GetCustomMetricName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaJigDeployParamsAutoscalingUnion) GetMetric added in v0.7.0

Returns a pointer to the underlying variant's property, if present.

func (BetaJigDeployParamsAutoscalingUnion) GetModel added in v0.7.0

Returns a pointer to the underlying variant's property, if present.

func (BetaJigDeployParamsAutoscalingUnion) GetTarget added in v0.7.0

Returns a pointer to the underlying variant's property, if present.

func (BetaJigDeployParamsAutoscalingUnion) GetTimeIntervalMinutes added in v0.7.0

func (u BetaJigDeployParamsAutoscalingUnion) GetTimeIntervalMinutes() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaJigDeployParamsAutoscalingUnion) MarshalJSON added in v0.7.0

func (u BetaJigDeployParamsAutoscalingUnion) MarshalJSON() ([]byte, error)

func (*BetaJigDeployParamsAutoscalingUnion) UnmarshalJSON added in v0.7.0

func (u *BetaJigDeployParamsAutoscalingUnion) UnmarshalJSON(data []byte) error

type BetaJigDeployParamsCapacityType added in v0.13.0

type BetaJigDeployParamsCapacityType string

Controls how replicas above reserved capacity behave. `stable` replicas stay running after scale-up; `preemptible` replicas may be evicted during capacity contention.

const (
	BetaJigDeployParamsCapacityTypeStable      BetaJigDeployParamsCapacityType = "stable"
	BetaJigDeployParamsCapacityTypePreemptible BetaJigDeployParamsCapacityType = "preemptible"
)

type BetaJigDeployParamsEnvironmentVariable added in v0.6.0

type BetaJigDeployParamsEnvironmentVariable struct {
	// Name is the environment variable name (e.g., "DATABASE_URL"). Must start with a
	// letter or underscore, followed by letters, numbers, or underscores
	Name string `json:"name" api:"required"`
	// Value is the plain text value for the environment variable. Use this for
	// non-sensitive values. Either Value or ValueFromSecret must be set, but not both
	Value param.Opt[string] `json:"value,omitzero"`
	// ValueFromSecret references a secret by name or ID to use as the value. Use this
	// for sensitive values like API keys or passwords. Either Value or ValueFromSecret
	// must be set, but not both
	ValueFromSecret param.Opt[string] `json:"value_from_secret,omitzero"`
	// contains filtered or unexported fields
}

The property Name is required.

func (BetaJigDeployParamsEnvironmentVariable) MarshalJSON added in v0.6.0

func (r BetaJigDeployParamsEnvironmentVariable) MarshalJSON() (data []byte, err error)

func (*BetaJigDeployParamsEnvironmentVariable) UnmarshalJSON added in v0.6.0

func (r *BetaJigDeployParamsEnvironmentVariable) UnmarshalJSON(data []byte) error

type BetaJigDeployParamsGPUType added in v0.6.0

type BetaJigDeployParamsGPUType string

GPUType specifies the GPU hardware to use (e.g., "h100-80gb").

const (
	BetaJigDeployParamsGPUTypeH100_80gb    BetaJigDeployParamsGPUType = "h100-80gb"
	BetaJigDeployParamsGPUTypeH100_40gbMig BetaJigDeployParamsGPUType = "h100-40gb-mig"
	BetaJigDeployParamsGPUTypeH200_140gb   BetaJigDeployParamsGPUType = "h200-140gb"
	BetaJigDeployParamsGPUTypeB200_192gb   BetaJigDeployParamsGPUType = "b200-192gb"
)

type BetaJigDeployParamsModelMount added in v0.13.0

type BetaJigDeployParamsModelMount struct {
	// Model registry identifier (`ml_...`) whose weights are mounted.
	ModelID string `json:"model_id" api:"required"`
	// Container path where model weights are mounted, such as `/models`.
	MountPath string `json:"mount_path" api:"required"`
	// Optional validated revision identifier (`rv_...`) to pin; defaults to the latest
	// validated revision.
	RevisionID param.Opt[string] `json:"revision_id,omitzero"`
	// contains filtered or unexported fields
}

The properties ModelID, MountPath are required.

func (BetaJigDeployParamsModelMount) MarshalJSON added in v0.13.0

func (r BetaJigDeployParamsModelMount) MarshalJSON() (data []byte, err error)

func (*BetaJigDeployParamsModelMount) UnmarshalJSON added in v0.13.0

func (r *BetaJigDeployParamsModelMount) UnmarshalJSON(data []byte) error

type BetaJigDeployParamsVolume added in v0.6.0

type BetaJigDeployParamsVolume struct {
	// MountPath is the path in the container where the volume mounts (e.g., "/data").
	MountPath string `json:"mount_path" api:"required"`
	// Name is the name of the volume to mount. Must reference an existing volume by
	// name or ID
	Name string `json:"name" api:"required"`
	// Version is the volume version to mount. On create, defaults to the latest
	// version. On update, defaults to the currently mounted version.
	Version param.Opt[int64] `json:"version,omitzero"`
	// contains filtered or unexported fields
}

The properties MountPath, Name are required.

func (BetaJigDeployParamsVolume) MarshalJSON added in v0.6.0

func (r BetaJigDeployParamsVolume) MarshalJSON() (data []byte, err error)

func (*BetaJigDeployParamsVolume) UnmarshalJSON added in v0.6.0

func (r *BetaJigDeployParamsVolume) UnmarshalJSON(data []byte) error

type BetaJigDestroyResponse added in v0.6.0

type BetaJigDestroyResponse = any

type BetaJigGetLogsParams added in v0.6.0

type BetaJigGetLogsParams struct {
	// Replica ID to filter logs
	ReplicaID param.Opt[string] `query:"replica_id,omitzero" json:"-"`
	// Deployment revision (UUID) to filter logs
	Revision param.Opt[string] `query:"revision,omitzero" json:"-"`
	// Deployment image version (tag or last 4 characters of image digest) to filter
	// logs
	Version param.Opt[string] `query:"version,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaJigGetLogsParams) URLQuery added in v0.6.0

func (r BetaJigGetLogsParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaJigGetLogsParams's query parameters as `url.Values`.

type BetaJigGetRevisionParams added in v0.13.0

type BetaJigGetRevisionParams struct {
	// Deployment ID or name.
	ID string `path:"id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type BetaJigListResponse added in v0.6.0

type BetaJigListResponse struct {
	// Data is the array of deployment items
	Data []Deployment `json:"data"`
	// The object type, which is always `list`.
	//
	// Any of "list".
	Object BetaJigListResponseObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaJigListResponse) RawJSON added in v0.6.0

func (r BetaJigListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigListResponse) UnmarshalJSON added in v0.6.0

func (r *BetaJigListResponse) UnmarshalJSON(data []byte) error

type BetaJigListResponseObject added in v0.7.0

type BetaJigListResponseObject string

The object type, which is always `list`.

const (
	BetaJigListResponseObjectList BetaJigListResponseObject = "list"
)

type BetaJigListRevisionsParams added in v0.13.0

type BetaJigListRevisionsParams struct {
	// Return only events with event_number strictly less than this value for
	// pagination.
	Before param.Opt[int64] `query:"before,omitzero" json:"-"`
	// Maximum number of events to return (default 10, max 100).
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaJigListRevisionsParams) URLQuery added in v0.13.0

func (r BetaJigListRevisionsParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaJigListRevisionsParams's query parameters as `url.Values`.

type BetaJigQueueCancelParams added in v0.6.0

type BetaJigQueueCancelParams struct {
	// Model identifier the job was submitted to
	Model string `json:"model" api:"required"`
	// The request ID returned from the submit endpoint
	RequestID string `json:"request_id" api:"required"`
	// contains filtered or unexported fields
}

func (BetaJigQueueCancelParams) MarshalJSON added in v0.6.0

func (r BetaJigQueueCancelParams) MarshalJSON() (data []byte, err error)

func (*BetaJigQueueCancelParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigQueueCancelParams) UnmarshalJSON(data []byte) error

type BetaJigQueueCancelResponse added in v0.6.0

type BetaJigQueueCancelResponse struct {
	// Job status after the cancel attempt. Only pending jobs can be canceled. If the
	// job is already running, done, or failed, the status is returned unchanged.
	//
	// Any of "canceled", "running", "done", "failed".
	Status BetaJigQueueCancelResponseStatus `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Status returned after a cancel attempt.

func (BetaJigQueueCancelResponse) RawJSON added in v0.6.0

func (r BetaJigQueueCancelResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigQueueCancelResponse) UnmarshalJSON added in v0.6.0

func (r *BetaJigQueueCancelResponse) UnmarshalJSON(data []byte) error

type BetaJigQueueCancelResponseStatus added in v0.7.0

type BetaJigQueueCancelResponseStatus string

Job status after the cancel attempt. Only pending jobs can be canceled. If the job is already running, done, or failed, the status is returned unchanged.

const (
	BetaJigQueueCancelResponseStatusCanceled BetaJigQueueCancelResponseStatus = "canceled"
	BetaJigQueueCancelResponseStatusRunning  BetaJigQueueCancelResponseStatus = "running"
	BetaJigQueueCancelResponseStatusDone     BetaJigQueueCancelResponseStatus = "done"
	BetaJigQueueCancelResponseStatusFailed   BetaJigQueueCancelResponseStatus = "failed"
)

type BetaJigQueueClearParams added in v0.11.0

type BetaJigQueueClearParams struct {
	// Model identifier whose pending jobs should be canceled
	Model string `json:"model" api:"required"`
	// contains filtered or unexported fields
}

func (BetaJigQueueClearParams) MarshalJSON added in v0.11.0

func (r BetaJigQueueClearParams) MarshalJSON() (data []byte, err error)

func (*BetaJigQueueClearParams) UnmarshalJSON added in v0.11.0

func (r *BetaJigQueueClearParams) UnmarshalJSON(data []byte) error

type BetaJigQueueClearResponse added in v0.11.0

type BetaJigQueueClearResponse struct {
	// Number of pending jobs that were canceled
	CanceledCount int64 `json:"canceled_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CanceledCount respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Count of pending jobs canceled by the clear operation.

func (BetaJigQueueClearResponse) RawJSON added in v0.11.0

func (r BetaJigQueueClearResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigQueueClearResponse) UnmarshalJSON added in v0.11.0

func (r *BetaJigQueueClearResponse) UnmarshalJSON(data []byte) error

type BetaJigQueueGetParams added in v0.6.0

type BetaJigQueueGetParams struct {
	// Model name the job was submitted to
	Model string `query:"model" api:"required" json:"-"`
	// Request ID returned from the submit endpoint
	RequestID string `query:"request_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

func (BetaJigQueueGetParams) URLQuery added in v0.6.0

func (r BetaJigQueueGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaJigQueueGetParams's query parameters as `url.Values`.

type BetaJigQueueGetResponse added in v0.6.0

type BetaJigQueueGetResponse struct {
	// Model identifier the job was submitted to
	Model string `json:"model" api:"required"`
	// The request ID that was returned from the submit endpoint
	RequestID string `json:"request_id" api:"required"`
	// Current job status. Transitions: pending → running → done/failed. A pending job
	// may also be canceled.
	//
	// Any of "pending", "running", "done", "failed", "canceled".
	Status BetaJigQueueGetResponseStatus `json:"status" api:"required"`
	// Timestamp when a worker claimed the job
	ClaimedAt time.Time `json:"claimed_at" format:"date-time"`
	// Timestamp when the job was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Timestamp when the job completed (done or failed)
	DoneAt time.Time `json:"done_at" format:"date-time"`
	// Job metadata. Contains keys from the submit request, plus any modifications from
	// the model or system (e.g. progress, retry history).
	Info map[string]any `json:"info"`
	// Freeform model input, as submitted
	Inputs map[string]any `json:"inputs"`
	// Freeform model output, populated when the job reaches done status. Contents are
	// model-specific.
	Outputs map[string]any `json:"outputs"`
	// Job priority. Higher values are processed first.
	Priority int64 `json:"priority"`
	// Number of times this job has been retried. Workers set a claim timeout and must
	// send periodic status updates to keep the job alive. If no update is received
	// within the timeout, the job is returned to the queue and retried. After 3
	// retries the job is permanently failed. Jobs explicitly failed by the model are
	// not retried.
	Retries int64 `json:"retries"`
	// Non-fatal messages about the request (e.g. deprecation notices)
	Warnings []string `json:"warnings"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Model       respjson.Field
		RequestID   respjson.Field
		Status      respjson.Field
		ClaimedAt   respjson.Field
		CreatedAt   respjson.Field
		DoneAt      respjson.Field
		Info        respjson.Field
		Inputs      respjson.Field
		Outputs     respjson.Field
		Priority    respjson.Field
		Retries     respjson.Field
		Warnings    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current status and metadata for a queued job.

func (BetaJigQueueGetResponse) RawJSON added in v0.6.0

func (r BetaJigQueueGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigQueueGetResponse) UnmarshalJSON added in v0.6.0

func (r *BetaJigQueueGetResponse) UnmarshalJSON(data []byte) error

type BetaJigQueueGetResponseStatus added in v0.7.0

type BetaJigQueueGetResponseStatus string

Current job status. Transitions: pending → running → done/failed. A pending job may also be canceled.

const (
	BetaJigQueueGetResponseStatusPending  BetaJigQueueGetResponseStatus = "pending"
	BetaJigQueueGetResponseStatusRunning  BetaJigQueueGetResponseStatus = "running"
	BetaJigQueueGetResponseStatusDone     BetaJigQueueGetResponseStatus = "done"
	BetaJigQueueGetResponseStatusFailed   BetaJigQueueGetResponseStatus = "failed"
	BetaJigQueueGetResponseStatusCanceled BetaJigQueueGetResponseStatus = "canceled"
)

type BetaJigQueueMetricsParams added in v0.6.0

type BetaJigQueueMetricsParams struct {
	// Model name to get metrics for
	Model string `query:"model" api:"required" json:"-"`
	// contains filtered or unexported fields
}

func (BetaJigQueueMetricsParams) URLQuery added in v0.6.0

func (r BetaJigQueueMetricsParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaJigQueueMetricsParams's query parameters as `url.Values`.

type BetaJigQueueMetricsResponse added in v0.6.0

type BetaJigQueueMetricsResponse struct {
	// Number of jobs currently being processed
	MessagesRunning int64 `json:"messages_running" api:"required"`
	// Number of jobs waiting to be claimed by a worker
	MessagesWaiting int64 `json:"messages_waiting" api:"required"`
	// Total number of active jobs (waiting + running)
	TotalJobs int64 `json:"total_jobs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MessagesRunning respjson.Field
		MessagesWaiting respjson.Field
		TotalJobs       respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Queue job counts for a model.

func (BetaJigQueueMetricsResponse) RawJSON added in v0.7.0

func (r BetaJigQueueMetricsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigQueueMetricsResponse) UnmarshalJSON added in v0.7.0

func (r *BetaJigQueueMetricsResponse) UnmarshalJSON(data []byte) error

type BetaJigQueueService added in v0.6.0

type BetaJigQueueService struct {
	Options []option.RequestOption
}

BetaJigQueueService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaJigQueueService method instead.

func NewBetaJigQueueService added in v0.6.0

func NewBetaJigQueueService(opts ...option.RequestOption) (r BetaJigQueueService)

NewBetaJigQueueService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BetaJigQueueService) Cancel added in v0.6.0

Cancel a pending job. Only jobs in pending status can be canceled. Running jobs cannot be stopped. Returns the job status after the attempt. If the job is not pending, returns 409 with the current status unchanged.

func (*BetaJigQueueService) Clear added in v0.11.0

Cancel all pending jobs for the given model. Running jobs are left untouched. Returns the number of jobs that were canceled.

func (*BetaJigQueueService) Get added in v0.6.0

Poll the current status of a previously submitted job. Provide the request_id and model as query parameters.

func (*BetaJigQueueService) Metrics added in v0.6.0

Get the current queue statistics for a model, including pending and running job counts.

func (*BetaJigQueueService) Submit added in v0.6.0

Submit a new job to the queue for asynchronous processing. Jobs are processed in strict priority order (higher priority first, FIFO within the same priority). Returns a request ID that can be used to poll status or cancel the job.

type BetaJigQueueSubmitParams added in v0.6.0

type BetaJigQueueSubmitParams struct {
	// Required model identifier
	Model string `json:"model" api:"required"`
	// Freeform model input. Passed unchanged to the model. Contents are
	// model-specific.
	Payload map[string]any `json:"payload,omitzero" api:"required"`
	// Job priority. Higher values are processed first (strict priority ordering). Jobs
	// with equal priority are processed in submission order (FIFO).
	Priority param.Opt[int64] `json:"priority,omitzero"`
	// Arbitrary JSON metadata stored with the job. Returned in status responses, where
	// the model and system may have added or modified keys (e.g. progress).
	Info map[string]any `json:"info,omitzero"`
	// contains filtered or unexported fields
}

func (BetaJigQueueSubmitParams) MarshalJSON added in v0.6.0

func (r BetaJigQueueSubmitParams) MarshalJSON() (data []byte, err error)

func (*BetaJigQueueSubmitParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigQueueSubmitParams) UnmarshalJSON(data []byte) error

type BetaJigQueueSubmitResponse added in v0.6.0

type BetaJigQueueSubmitResponse struct {
	// Unique identifier for the submitted job. Use this to poll status or cancel.
	RequestID string `json:"requestId" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response returned after queueing a job.

func (BetaJigQueueSubmitResponse) RawJSON added in v0.6.0

func (r BetaJigQueueSubmitResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigQueueSubmitResponse) UnmarshalJSON added in v0.6.0

func (r *BetaJigQueueSubmitResponse) UnmarshalJSON(data []byte) error

type BetaJigRollbackParams added in v0.13.0

type BetaJigRollbackParams struct {
	// Revision number or revision ID to roll back to.
	RevisionIdentifier string `json:"revision_identifier" api:"required"`
	// contains filtered or unexported fields
}

func (BetaJigRollbackParams) MarshalJSON added in v0.13.0

func (r BetaJigRollbackParams) MarshalJSON() (data []byte, err error)

func (*BetaJigRollbackParams) UnmarshalJSON added in v0.13.0

func (r *BetaJigRollbackParams) UnmarshalJSON(data []byte) error

type BetaJigSecretDeleteResponse added in v0.6.0

type BetaJigSecretDeleteResponse = any

type BetaJigSecretListResponse added in v0.6.0

type BetaJigSecretListResponse struct {
	// Data is the array of secret items
	Data []Secret `json:"data"`
	// The object type, which is always `list`.
	//
	// Any of "list".
	Object BetaJigSecretListResponseObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaJigSecretListResponse) RawJSON added in v0.6.0

func (r BetaJigSecretListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigSecretListResponse) UnmarshalJSON added in v0.6.0

func (r *BetaJigSecretListResponse) UnmarshalJSON(data []byte) error

type BetaJigSecretListResponseObject added in v0.7.0

type BetaJigSecretListResponseObject string

The object type, which is always `list`.

const (
	BetaJigSecretListResponseObjectList BetaJigSecretListResponseObject = "list"
)

type BetaJigSecretNewParams added in v0.6.0

type BetaJigSecretNewParams struct {
	// Name is the unique identifier for the secret. Can contain alphanumeric
	// characters, underscores, hyphens, forward slashes, and periods (1-100
	// characters)
	Name string `json:"name" api:"required"`
	// Value is the sensitive data to store securely (e.g., API keys, passwords,
	// tokens). Encrypted at rest.
	Value string `json:"value" api:"required"`
	// Description is an optional human-readable description of the secret's purpose
	// (max 500 characters)
	Description param.Opt[string] `json:"description,omitzero"`
	// ProjectID is ignored - the project is automatically determined from your
	// authentication
	ProjectID param.Opt[string] `json:"project_id,omitzero"`
	// contains filtered or unexported fields
}

func (BetaJigSecretNewParams) MarshalJSON added in v0.6.0

func (r BetaJigSecretNewParams) MarshalJSON() (data []byte, err error)

func (*BetaJigSecretNewParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigSecretNewParams) UnmarshalJSON(data []byte) error

type BetaJigSecretService added in v0.6.0

type BetaJigSecretService struct {
	Options []option.RequestOption
}

BetaJigSecretService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaJigSecretService method instead.

func NewBetaJigSecretService added in v0.6.0

func NewBetaJigSecretService(opts ...option.RequestOption) (r BetaJigSecretService)

NewBetaJigSecretService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BetaJigSecretService) Delete added in v0.6.0

Delete an existing secret

func (*BetaJigSecretService) Get added in v0.6.0

func (r *BetaJigSecretService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Secret, err error)

Retrieve details of a specific secret by its ID or name

func (*BetaJigSecretService) List added in v0.6.0

Retrieve all secrets in your project

func (*BetaJigSecretService) New added in v0.6.0

Create a new secret to store sensitive configuration values

func (*BetaJigSecretService) Update added in v0.6.0

Update an existing secret's value or metadata

type BetaJigSecretUpdateParams added in v0.6.0

type BetaJigSecretUpdateParams struct {
	// Description is an optional human-readable description of the secret's purpose
	// (max 500 characters)
	Description param.Opt[string] `json:"description,omitzero"`
	// Name is the new unique identifier for the secret. Can contain alphanumeric
	// characters, underscores, hyphens, forward slashes, and periods (1-100
	// characters)
	Name param.Opt[string] `json:"name,omitzero"`
	// ProjectID is ignored - the project is automatically determined from your
	// authentication
	ProjectID param.Opt[string] `json:"project_id,omitzero"`
	// Value is the new sensitive data to store securely. Updating this replaces the
	// existing secret value.
	Value param.Opt[string] `json:"value,omitzero"`
	// contains filtered or unexported fields
}

func (BetaJigSecretUpdateParams) MarshalJSON added in v0.6.0

func (r BetaJigSecretUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaJigSecretUpdateParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigSecretUpdateParams) UnmarshalJSON(data []byte) error

type BetaJigService added in v0.6.0

type BetaJigService struct {
	Options []option.RequestOption
	Queue   BetaJigQueueService
	Volumes BetaJigVolumeService
	Secrets BetaJigSecretService
}

BetaJigService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaJigService method instead.

func NewBetaJigService added in v0.6.0

func NewBetaJigService(opts ...option.RequestOption) (r BetaJigService)

NewBetaJigService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BetaJigService) Deploy added in v0.6.0

func (r *BetaJigService) Deploy(ctx context.Context, body BetaJigDeployParams, opts ...option.RequestOption) (res *Deployment, err error)

Create a new deployment with specified configuration

func (*BetaJigService) Destroy added in v0.6.0

func (r *BetaJigService) Destroy(ctx context.Context, id string, opts ...option.RequestOption) (res *BetaJigDestroyResponse, err error)

Delete an existing deployment

func (*BetaJigService) Get added in v0.6.0

func (r *BetaJigService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Deployment, err error)

Retrieve details of a specific deployment by its ID or name

func (*BetaJigService) GetLogs added in v0.6.0

func (r *BetaJigService) GetLogs(ctx context.Context, id string, query BetaJigGetLogsParams, opts ...option.RequestOption) (res *DeploymentLogs, err error)

Retrieve logs from a deployment, optionally filtered by replica ID.

func (*BetaJigService) GetRevision added in v0.13.0

func (r *BetaJigService) GetRevision(ctx context.Context, revisionIdentifier string, query BetaJigGetRevisionParams, opts ...option.RequestOption) (res *DeploymentRevision, err error)

Returns the deployment configuration defined by the specified revision. Only the 50 most recent revisions per deployment retain their configuration; older revisions return 404 even while they still appear in the revision history. The deployment's currently active revision is always available, regardless of age.

func (*BetaJigService) List added in v0.6.0

func (r *BetaJigService) List(ctx context.Context, opts ...option.RequestOption) (res *BetaJigListResponse, err error)

Get a list of all deployments in your project

func (*BetaJigService) ListRevisions added in v0.13.0

Returns the revision history of the deployment, in descending order. Defaults to the most recent events. Only the 200 most recent events are retained per deployment; paginating past that returns an empty list.

func (*BetaJigService) Rollback added in v0.13.0

func (r *BetaJigService) Rollback(ctx context.Context, id string, body BetaJigRollbackParams, opts ...option.RequestOption) (res *Deployment, err error)

Re-applies the spec of a previous revision. Pods running the target revision will be retained. Other pods will be drained and restarted with the target revision. Only the 50 most recent revisions per deployment can be rolled back to; older targets return 404.

func (*BetaJigService) Update added in v0.6.0

func (r *BetaJigService) Update(ctx context.Context, id string, body BetaJigUpdateParams, opts ...option.RequestOption) (res *Deployment, err error)

Update an existing deployment configuration

type BetaJigUpdateParams added in v0.6.0

type BetaJigUpdateParams struct {
	// CPU is the number of CPU cores to allocate per container instance (e.g., 0.1 =
	// 100 milli cores)
	CPU param.Opt[float64] `json:"cpu,omitzero"`
	// Description is an optional human-readable description of your deployment
	Description param.Opt[string] `json:"description,omitzero"`
	// GPUCount is the number of GPUs to allocate per container instance
	GPUCount param.Opt[int64] `json:"gpu_count,omitzero"`
	// HealthCheckPath is the HTTP path for health checks (e.g., "/health"). Set to
	// empty string to disable health checks
	HealthCheckPath param.Opt[string] `json:"health_check_path,omitzero"`
	// Image is the container image to deploy from registry.together.ai.
	Image param.Opt[string] `json:"image,omitzero"`
	// MaxReplicas is the maximum number of replicas that can be scaled up to.
	MaxReplicas param.Opt[int64] `json:"max_replicas,omitzero"`
	// Memory is the amount of RAM to allocate per container instance in GiB (e.g., 0.5
	// = 512MiB)
	Memory param.Opt[float64] `json:"memory,omitzero"`
	// MinReplicas is the minimum number of replicas to run
	MinReplicas param.Opt[int64] `json:"min_replicas,omitzero"`
	// Name is the new unique identifier for your deployment. Must contain only
	// alphanumeric characters, underscores, or hyphens (1-100 characters)
	Name param.Opt[string] `json:"name,omitzero"`
	// Port is the container port your application listens on (e.g., 8080 for web
	// servers)
	Port param.Opt[int64] `json:"port,omitzero"`
	// Storage is the amount of ephemeral disk storage to allocate per container
	// instance (e.g., 10 = 10GiB)
	Storage param.Opt[int64] `json:"storage,omitzero"`
	// TerminationGracePeriodSeconds is the time in seconds to wait for graceful
	// shutdown before forcefully terminating the replica
	TerminationGracePeriodSeconds param.Opt[int64] `json:"termination_grace_period_seconds,omitzero"`
	// Args overrides the container's CMD. Provide as an array of arguments (e.g.,
	// ["python", "app.py"])
	Args []string `json:"args,omitzero"`
	// Autoscaling configuration for the deployment. Set to {} to disable autoscaling
	Autoscaling BetaJigUpdateParamsAutoscalingUnion `json:"autoscaling,omitzero"`
	// Controls how replicas above reserved capacity behave. `stable` replicas stay
	// running after scale-up; `preemptible` replicas may be evicted during capacity
	// contention.
	//
	// Any of "stable", "preemptible".
	CapacityType BetaJigUpdateParamsCapacityType `json:"capacity_type,omitzero"`
	// Command overrides the container's ENTRYPOINT. Provide as an array (e.g.,
	// ["/bin/sh", "-c"])
	Command []string `json:"command,omitzero"`
	// EnvironmentVariables is a list of environment variables to set in the container.
	// Replaces all existing environment variables.
	EnvironmentVariables []BetaJigUpdateParamsEnvironmentVariable `json:"environment_variables,omitzero"`
	// GPUType specifies the GPU hardware to use (e.g., "h100-80gb")
	//
	// Any of "h100-80gb", "h100-40gb-mig", "h200-140gb", "b200-192gb".
	GPUType BetaJigUpdateParamsGPUType `json:"gpu_type,omitzero"`
	// Replacement model weights to mount into the deployment. At most one mount is
	// supported, and it cannot be used with volumes.
	ModelMounts []BetaJigUpdateParamsModelMount `json:"model_mounts,omitzero"`
	// Volumes is a list of volume mounts to attach to the container. Replaces all
	// existing volumes.
	Volumes []BetaJigUpdateParamsVolume `json:"volumes,omitzero"`
	// contains filtered or unexported fields
}

func (BetaJigUpdateParams) MarshalJSON added in v0.6.0

func (r BetaJigUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaJigUpdateParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigUpdateParams) UnmarshalJSON(data []byte) error

type BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig added in v0.7.0

type BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig struct {
	// CustomMetricName is the Prometheus metric name. Must match
	// [a-zA-Z\_:][a-zA-Z0-9_:]\*
	CustomMetricName param.Opt[string] `json:"custom_metric_name,omitzero"`
	// Target is the threshold value. Default: 500
	Target param.Opt[float64] `json:"target,omitzero"`
	// Metric must be CustomMetric
	//
	// Any of "CustomMetric".
	Metric string `json:"metric,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling config for CustomMetric metric

func (BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig) MarshalJSON added in v0.7.0

func (*BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON added in v0.7.0

type BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig added in v0.7.0

type BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig struct {
	// Target is the threshold value. Default: 100 for HTTPTotalRequests, 500 (ms) for
	// HTTPAvgRequestDuration
	Target param.Opt[float64] `json:"target,omitzero"`
	// TimeIntervalMinutes is the rate window in minutes. Default: 10
	TimeIntervalMinutes param.Opt[int64] `json:"time_interval_minutes,omitzero"`
	// Metric must be HTTPTotalRequests or HTTPAvgRequestDuration
	//
	// Any of "HTTPTotalRequests", "HTTPAvgRequestDuration".
	Metric string `json:"metric,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling config for HTTPTotalRequests and HTTPAvgRequestDuration metrics

func (BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig) MarshalJSON added in v0.7.0

func (r BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig) MarshalJSON() (data []byte, err error)

func (*BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig) UnmarshalJSON added in v0.7.0

type BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig added in v0.7.0

type BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig struct {
	// Model overrides the model name for queue status lookup. Defaults to the
	// deployment app name
	Model param.Opt[string] `json:"model,omitzero"`
	// Target is the threshold value. Default: 1.01
	Target param.Opt[float64] `json:"target,omitzero"`
	// Metric must be QueueBacklogPerWorker
	//
	// Any of "QueueBacklogPerWorker".
	Metric string `json:"metric,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling config for QueueBacklogPerWorker metric

func (BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig) MarshalJSON added in v0.7.0

func (r BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig) MarshalJSON() (data []byte, err error)

func (*BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig) UnmarshalJSON added in v0.7.0

type BetaJigUpdateParamsAutoscalingUnion added in v0.7.0

type BetaJigUpdateParamsAutoscalingUnion struct {
	OfBetaJigUpdatesAutoscalingHTTPAutoscalingConfig         *BetaJigUpdateParamsAutoscalingHTTPAutoscalingConfig         `json:",omitzero,inline"`
	OfBetaJigUpdatesAutoscalingQueueAutoscalingConfig        *BetaJigUpdateParamsAutoscalingQueueAutoscalingConfig        `json:",omitzero,inline"`
	OfBetaJigUpdatesAutoscalingCustomMetricAutoscalingConfig *BetaJigUpdateParamsAutoscalingCustomMetricAutoscalingConfig `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BetaJigUpdateParamsAutoscalingUnion) GetCustomMetricName added in v0.7.0

func (u BetaJigUpdateParamsAutoscalingUnion) GetCustomMetricName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaJigUpdateParamsAutoscalingUnion) GetMetric added in v0.7.0

Returns a pointer to the underlying variant's property, if present.

func (BetaJigUpdateParamsAutoscalingUnion) GetModel added in v0.7.0

Returns a pointer to the underlying variant's property, if present.

func (BetaJigUpdateParamsAutoscalingUnion) GetTarget added in v0.7.0

Returns a pointer to the underlying variant's property, if present.

func (BetaJigUpdateParamsAutoscalingUnion) GetTimeIntervalMinutes added in v0.7.0

func (u BetaJigUpdateParamsAutoscalingUnion) GetTimeIntervalMinutes() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaJigUpdateParamsAutoscalingUnion) MarshalJSON added in v0.7.0

func (u BetaJigUpdateParamsAutoscalingUnion) MarshalJSON() ([]byte, error)

func (*BetaJigUpdateParamsAutoscalingUnion) UnmarshalJSON added in v0.7.0

func (u *BetaJigUpdateParamsAutoscalingUnion) UnmarshalJSON(data []byte) error

type BetaJigUpdateParamsCapacityType added in v0.13.0

type BetaJigUpdateParamsCapacityType string

Controls how replicas above reserved capacity behave. `stable` replicas stay running after scale-up; `preemptible` replicas may be evicted during capacity contention.

const (
	BetaJigUpdateParamsCapacityTypeStable      BetaJigUpdateParamsCapacityType = "stable"
	BetaJigUpdateParamsCapacityTypePreemptible BetaJigUpdateParamsCapacityType = "preemptible"
)

type BetaJigUpdateParamsEnvironmentVariable added in v0.6.0

type BetaJigUpdateParamsEnvironmentVariable struct {
	// Name is the environment variable name (e.g., "DATABASE_URL"). Must start with a
	// letter or underscore, followed by letters, numbers, or underscores
	Name string `json:"name" api:"required"`
	// Value is the plain text value for the environment variable. Use this for
	// non-sensitive values. Either Value or ValueFromSecret must be set, but not both
	Value param.Opt[string] `json:"value,omitzero"`
	// ValueFromSecret references a secret by name or ID to use as the value. Use this
	// for sensitive values like API keys or passwords. Either Value or ValueFromSecret
	// must be set, but not both
	ValueFromSecret param.Opt[string] `json:"value_from_secret,omitzero"`
	// contains filtered or unexported fields
}

The property Name is required.

func (BetaJigUpdateParamsEnvironmentVariable) MarshalJSON added in v0.6.0

func (r BetaJigUpdateParamsEnvironmentVariable) MarshalJSON() (data []byte, err error)

func (*BetaJigUpdateParamsEnvironmentVariable) UnmarshalJSON added in v0.6.0

func (r *BetaJigUpdateParamsEnvironmentVariable) UnmarshalJSON(data []byte) error

type BetaJigUpdateParamsGPUType added in v0.6.0

type BetaJigUpdateParamsGPUType string

GPUType specifies the GPU hardware to use (e.g., "h100-80gb")

const (
	BetaJigUpdateParamsGPUTypeH100_80gb    BetaJigUpdateParamsGPUType = "h100-80gb"
	BetaJigUpdateParamsGPUTypeH100_40gbMig BetaJigUpdateParamsGPUType = "h100-40gb-mig"
	BetaJigUpdateParamsGPUTypeH200_140gb   BetaJigUpdateParamsGPUType = "h200-140gb"
	BetaJigUpdateParamsGPUTypeB200_192gb   BetaJigUpdateParamsGPUType = "b200-192gb"
)

type BetaJigUpdateParamsModelMount added in v0.13.0

type BetaJigUpdateParamsModelMount struct {
	// Model registry identifier (`ml_...`) whose weights are mounted.
	ModelID string `json:"model_id" api:"required"`
	// Container path where model weights are mounted, such as `/models`.
	MountPath string `json:"mount_path" api:"required"`
	// Optional validated revision identifier (`rv_...`) to pin; defaults to the latest
	// validated revision.
	RevisionID param.Opt[string] `json:"revision_id,omitzero"`
	// contains filtered or unexported fields
}

The properties ModelID, MountPath are required.

func (BetaJigUpdateParamsModelMount) MarshalJSON added in v0.13.0

func (r BetaJigUpdateParamsModelMount) MarshalJSON() (data []byte, err error)

func (*BetaJigUpdateParamsModelMount) UnmarshalJSON added in v0.13.0

func (r *BetaJigUpdateParamsModelMount) UnmarshalJSON(data []byte) error

type BetaJigUpdateParamsVolume added in v0.6.0

type BetaJigUpdateParamsVolume struct {
	// MountPath is the path in the container where the volume mounts (e.g., "/data").
	MountPath string `json:"mount_path" api:"required"`
	// Name is the name of the volume to mount. Must reference an existing volume by
	// name or ID
	Name string `json:"name" api:"required"`
	// Version is the volume version to mount. On create, defaults to the latest
	// version. On update, defaults to the currently mounted version.
	Version param.Opt[int64] `json:"version,omitzero"`
	// contains filtered or unexported fields
}

The properties MountPath, Name are required.

func (BetaJigUpdateParamsVolume) MarshalJSON added in v0.6.0

func (r BetaJigUpdateParamsVolume) MarshalJSON() (data []byte, err error)

func (*BetaJigUpdateParamsVolume) UnmarshalJSON added in v0.6.0

func (r *BetaJigUpdateParamsVolume) UnmarshalJSON(data []byte) error

type BetaJigVolumeDeleteResponse added in v0.6.0

type BetaJigVolumeDeleteResponse = any

type BetaJigVolumeGetParams added in v0.10.0

type BetaJigVolumeGetParams struct {
	// Volume version to describe (defaults to current version)
	Version param.Opt[int64] `query:"version,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaJigVolumeGetParams) URLQuery added in v0.10.0

func (r BetaJigVolumeGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaJigVolumeGetParams's query parameters as `url.Values`.

type BetaJigVolumeListResponse added in v0.6.0

type BetaJigVolumeListResponse struct {
	// Data is the array of volume items
	Data []Volume `json:"data"`
	// The object type, which is always `list`.
	//
	// Any of "list".
	Object BetaJigVolumeListResponseObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaJigVolumeListResponse) RawJSON added in v0.6.0

func (r BetaJigVolumeListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaJigVolumeListResponse) UnmarshalJSON added in v0.6.0

func (r *BetaJigVolumeListResponse) UnmarshalJSON(data []byte) error

type BetaJigVolumeListResponseObject added in v0.7.0

type BetaJigVolumeListResponseObject string

The object type, which is always `list`.

const (
	BetaJigVolumeListResponseObjectList BetaJigVolumeListResponseObject = "list"
)

type BetaJigVolumeNewParams added in v0.6.0

type BetaJigVolumeNewParams struct {
	// Content specifies the new content to preload to this volume.
	Content BetaJigVolumeNewParamsContent `json:"content,omitzero" api:"required"`
	// Name is the unique identifier for the volume within the project
	Name string `json:"name" api:"required"`
	// Type is the volume type (currently only "readOnly" is supported)
	//
	// Any of "readOnly".
	Type BetaJigVolumeNewParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (BetaJigVolumeNewParams) MarshalJSON added in v0.6.0

func (r BetaJigVolumeNewParams) MarshalJSON() (data []byte, err error)

func (*BetaJigVolumeNewParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigVolumeNewParams) UnmarshalJSON(data []byte) error

type BetaJigVolumeNewParamsContent added in v0.6.0

type BetaJigVolumeNewParamsContent struct {
	// SourcePrefix is the file path prefix for the content to be preloaded into the
	// volume. Mutually exclusive with Origin
	SourcePrefix param.Opt[string] `json:"source_prefix,omitzero"`
	// External source Together copies into a new volume version; mutually exclusive
	// with source_prefix.
	Origin VolumeOriginParam `json:"origin,omitzero"`
	// Type is the content type (currently only "files" is supported which allows
	// preloading files uploaded via Files API into the volume)
	//
	// Any of "files".
	Type string `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Content specifies the new content to preload to this volume.

func (BetaJigVolumeNewParamsContent) MarshalJSON added in v0.6.0

func (r BetaJigVolumeNewParamsContent) MarshalJSON() (data []byte, err error)

func (*BetaJigVolumeNewParamsContent) UnmarshalJSON added in v0.6.0

func (r *BetaJigVolumeNewParamsContent) UnmarshalJSON(data []byte) error

type BetaJigVolumeNewParamsType added in v0.6.0

type BetaJigVolumeNewParamsType string

Type is the volume type (currently only "readOnly" is supported)

const (
	BetaJigVolumeNewParamsTypeReadOnly BetaJigVolumeNewParamsType = "readOnly"
)

type BetaJigVolumeService added in v0.6.0

type BetaJigVolumeService struct {
	Options []option.RequestOption
}

BetaJigVolumeService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaJigVolumeService method instead.

func NewBetaJigVolumeService added in v0.6.0

func NewBetaJigVolumeService(opts ...option.RequestOption) (r BetaJigVolumeService)

NewBetaJigVolumeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BetaJigVolumeService) Delete added in v0.6.0

Delete an existing volume

func (*BetaJigVolumeService) Get added in v0.6.0

Retrieve details of a specific volume by its ID or name

func (*BetaJigVolumeService) List added in v0.6.0

Retrieve all volumes in your project

func (*BetaJigVolumeService) New added in v0.6.0

Create a new volume to preload files in deployments

func (*BetaJigVolumeService) Update added in v0.6.0

Update an existing volume's configuration or contents

type BetaJigVolumeUpdateParams added in v0.6.0

type BetaJigVolumeUpdateParams struct {
	// Name is the new unique identifier for the volume within the project
	Name param.Opt[string] `json:"name,omitzero"`
	// Content specifies the new content to preload to this volume.
	Content BetaJigVolumeUpdateParamsContent `json:"content,omitzero"`
	// Type is the new volume type (currently only "readOnly" is supported)
	//
	// Any of "readOnly".
	Type BetaJigVolumeUpdateParamsType `json:"type,omitzero"`
	// contains filtered or unexported fields
}

func (BetaJigVolumeUpdateParams) MarshalJSON added in v0.6.0

func (r BetaJigVolumeUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaJigVolumeUpdateParams) UnmarshalJSON added in v0.6.0

func (r *BetaJigVolumeUpdateParams) UnmarshalJSON(data []byte) error

type BetaJigVolumeUpdateParamsContent added in v0.6.0

type BetaJigVolumeUpdateParamsContent struct {
	// SourcePrefix is the file path prefix for the content to be preloaded into the
	// volume. Mutually exclusive with Origin
	SourcePrefix param.Opt[string] `json:"source_prefix,omitzero"`
	// External source Together copies into a new volume version; mutually exclusive
	// with source_prefix.
	Origin VolumeOriginParam `json:"origin,omitzero"`
	// Type is the content type (currently only "files" is supported which allows
	// preloading files uploaded via Files API into the volume)
	//
	// Any of "files".
	Type string `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Content specifies the new content to preload to this volume.

func (BetaJigVolumeUpdateParamsContent) MarshalJSON added in v0.6.0

func (r BetaJigVolumeUpdateParamsContent) MarshalJSON() (data []byte, err error)

func (*BetaJigVolumeUpdateParamsContent) UnmarshalJSON added in v0.6.0

func (r *BetaJigVolumeUpdateParamsContent) UnmarshalJSON(data []byte) error

type BetaJigVolumeUpdateParamsType added in v0.6.0

type BetaJigVolumeUpdateParamsType string

Type is the new volume type (currently only "readOnly" is supported)

const (
	BetaJigVolumeUpdateParamsTypeReadOnly BetaJigVolumeUpdateParamsType = "readOnly"
)

type BetaService added in v0.4.0

type BetaService struct {
	Options []option.RequestOption
	Jig     BetaJigService
}

BetaService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaService method instead.

func NewBetaService added in v0.4.0

func NewBetaService(opts ...option.RequestOption) (r BetaService)

NewBetaService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type BillingUsageLineItem added in v0.13.0

type BillingUsageLineItem struct {
	// Resource identifiers for attribution, varying by product.
	Attributes map[string]string `json:"attributes" api:"required"`
	// Total cost for this line item in USD as a decimal string.
	Cost string `json:"cost" api:"required"`
	// Rate-determining dimensions (varies by product). Passthrough from Metronome
	// pricing group values.
	PricingDimensions map[string]string `json:"pricing_dimensions" api:"required"`
	// Metronome product name (e.g. 'Serverless Inference - Input Tokens').
	ProductName string `json:"product_name" api:"required"`
	// Total usage for the window in the product's native unit (GPU-hours, tokens, ...)
	// as a decimal string.
	Quantity string `json:"quantity" api:"required"`
	// Per-unit price in USD as a decimal string.
	UnitPrice string `json:"unit_price" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Attributes        respjson.Field
		Cost              respjson.Field
		PricingDimensions respjson.Field
		ProductName       respjson.Field
		Quantity          respjson.Field
		UnitPrice         respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BillingUsageLineItem) RawJSON added in v0.13.0

func (r BillingUsageLineItem) RawJSON() string

Returns the unmodified JSON received from the API

func (*BillingUsageLineItem) UnmarshalJSON added in v0.13.0

func (r *BillingUsageLineItem) UnmarshalJSON(data []byte) error

type BillingUsageReport added in v0.13.0

type BillingUsageReport struct {
	// Billing month (YYYY-MM).
	BillingPeriod string       `json:"billing_period" api:"required"`
	Currency      constant.Usd `json:"currency" default:"USD"`
	// Time windows containing usage line items.
	Data []BillingUsageWindow `json:"data" api:"required"`
	// Start of the earliest time window with usage in the month (UTC, ISO 8601); null
	// when the month has no usage.
	EarliestWindowStart time.Time `json:"earliest_window_start" api:"required" format:"date-time"`
	// Exclusive end of the latest time window with usage in the month (UTC, ISO 8601);
	// null when the month has no usage. Describes the whole month, not the current
	// page.
	LatestWindowEnd time.Time `json:"latest_window_end" api:"required" format:"date-time"`
	// Opaque cursor for the next page; null when this is the last page.
	NextCursor string        `json:"next_cursor" api:"required"`
	Object     constant.List `json:"object" default:"list"`
	// ID of the organization the report belongs to.
	OrganizationID string `json:"organization_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BillingPeriod       respjson.Field
		Currency            respjson.Field
		Data                respjson.Field
		EarliestWindowStart respjson.Field
		LatestWindowEnd     respjson.Field
		NextCursor          respjson.Field
		Object              respjson.Field
		OrganizationID      respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BillingUsageReport) RawJSON added in v0.13.0

func (r BillingUsageReport) RawJSON() string

Returns the unmodified JSON received from the API

func (*BillingUsageReport) UnmarshalJSON added in v0.13.0

func (r *BillingUsageReport) UnmarshalJSON(data []byte) error

type BillingUsageWindow added in v0.13.0

type BillingUsageWindow struct {
	// Day this window covers (UTC, YYYY-MM-DD). Present for both granularities.
	Date string `json:"date" api:"required"`
	// Window end (UTC, ISO 8601), exclusive. Start of the next day (daily) or hour
	// (hourly).
	EndTime time.Time `json:"end_time" api:"required" format:"date-time"`
	// Usage line items in this time window.
	LineItems []BillingUsageLineItem `json:"line_items" api:"required"`
	// Window start (UTC, ISO 8601). Start of the day (daily) or hour (hourly).
	StartTime time.Time `json:"start_time" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Date        respjson.Field
		EndTime     respjson.Field
		LineItems   respjson.Field
		StartTime   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BillingUsageWindow) RawJSON added in v0.13.0

func (r BillingUsageWindow) RawJSON() string

Returns the unmodified JSON received from the API

func (*BillingUsageWindow) UnmarshalJSON added in v0.13.0

func (r *BillingUsageWindow) UnmarshalJSON(data []byte) error

type BlueGreenConfig added in v0.13.0

type BlueGreenConfig struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Blue-green strategy configuration for a single cutover to the target deployment.

func (BlueGreenConfig) RawJSON added in v0.13.0

func (r BlueGreenConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (BlueGreenConfig) ToParam added in v0.13.0

ToParam converts this BlueGreenConfig to a BlueGreenConfigParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with BlueGreenConfigParam.Overrides()

func (*BlueGreenConfig) UnmarshalJSON added in v0.13.0

func (r *BlueGreenConfig) UnmarshalJSON(data []byte) error

type BlueGreenConfigParam added in v0.13.0

type BlueGreenConfigParam struct {
	// contains filtered or unexported fields
}

Blue-green strategy configuration for a single cutover to the target deployment.

func (BlueGreenConfigParam) MarshalJSON added in v0.13.0

func (r BlueGreenConfigParam) MarshalJSON() (data []byte, err error)

func (*BlueGreenConfigParam) UnmarshalJSON added in v0.13.0

func (r *BlueGreenConfigParam) UnmarshalJSON(data []byte) error

type CanaryConfig added in v0.13.0

type CanaryConfig struct {
	// Optional positive soak between steps. Defaults to 3m if omitted, and grows to
	// cover metric rule windows plus ingestion lag.
	StepInterval string `json:"stepInterval"`
	// Optional progression steps. Defaults to 5, 25, 50, 100 percent when empty;
	// explicit steps must increase and end at 100 percent.
	Steps []RolloutStep `json:"steps"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StepInterval respjson.Field
		Steps        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Canary strategy configuration for gradual traffic progression. An empty config uses the default 5, 25, 50, 100 percent ladder; over a frozen traffic-split pair left by cancel, the default ladder is derived at start from the pair's current served share so it begins above it.

func (CanaryConfig) RawJSON added in v0.13.0

func (r CanaryConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (CanaryConfig) ToParam added in v0.13.0

func (r CanaryConfig) ToParam() CanaryConfigParam

ToParam converts this CanaryConfig to a CanaryConfigParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with CanaryConfigParam.Overrides()

func (*CanaryConfig) UnmarshalJSON added in v0.13.0

func (r *CanaryConfig) UnmarshalJSON(data []byte) error

type CanaryConfigParam added in v0.13.0

type CanaryConfigParam struct {
	// Optional positive soak between steps. Defaults to 3m if omitted, and grows to
	// cover metric rule windows plus ingestion lag.
	StepInterval param.Opt[string] `json:"stepInterval,omitzero"`
	// Optional progression steps. Defaults to 5, 25, 50, 100 percent when empty;
	// explicit steps must increase and end at 100 percent.
	Steps []RolloutStepParam `json:"steps,omitzero"`
	// contains filtered or unexported fields
}

Canary strategy configuration for gradual traffic progression. An empty config uses the default 5, 25, 50, 100 percent ladder; over a frozen traffic-split pair left by cancel, the default ladder is derived at start from the pair's current served share so it begins above it.

func (CanaryConfigParam) MarshalJSON added in v0.13.0

func (r CanaryConfigParam) MarshalJSON() (data []byte, err error)

func (*CanaryConfigParam) UnmarshalJSON added in v0.13.0

func (r *CanaryConfigParam) UnmarshalJSON(data []byte) error

type Certification added in v0.13.0

type Certification struct {
	// Whether the model and config combination passed certification.
	//
	// Any of "CERTIFICATION_TYPE_CERTIFIED", "CERTIFICATION_TYPE_UNCERTIFIED".
	CertificationType CertificationCertificationType `json:"certificationType" api:"required"`
	// Time when the certification decision was recorded.
	CertifiedAt time.Time `json:"certifiedAt" api:"required" format:"date-time"`
	// Service or reviewer that recorded the certification.
	CertifiedBy string `json:"certifiedBy" api:"required"`
	// Resource name of the certified model.
	Model string `json:"model" api:"required"`
	// Revision identifier of the certified model.
	ModelRevisionID string `json:"modelRevisionId" api:"required"`
	// Product or serving environment for which the combination was evaluated.
	//
	// Any of "CERTIFICATION_TARGET_DE_SERVERLESS", "CERTIFICATION_TARGET_MRE".
	Target CertificationTarget `json:"target" api:"required"`
	// Resource name of the certified draft model.
	DraftModel string `json:"draftModel"`
	// Revision identifier of the certified draft model.
	DraftModelRevisionID string `json:"draftModelRevisionId"`
	// Human-readable certification notes or limitations.
	Notes string `json:"notes"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CertificationType    respjson.Field
		CertifiedAt          respjson.Field
		CertifiedBy          respjson.Field
		Model                respjson.Field
		ModelRevisionID      respjson.Field
		Target               respjson.Field
		DraftModel           respjson.Field
		DraftModelRevisionID respjson.Field
		Notes                respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Certification result for a model, config, and optional draft-model combination.

func (Certification) RawJSON added in v0.13.0

func (r Certification) RawJSON() string

Returns the unmodified JSON received from the API

func (*Certification) UnmarshalJSON added in v0.13.0

func (r *Certification) UnmarshalJSON(data []byte) error

type CertificationCertificationType added in v0.13.0

type CertificationCertificationType string

Whether the model and config combination passed certification.

const (
	CertificationCertificationTypeCertificationTypeCertified   CertificationCertificationType = "CERTIFICATION_TYPE_CERTIFIED"
	CertificationCertificationTypeCertificationTypeUncertified CertificationCertificationType = "CERTIFICATION_TYPE_UNCERTIFIED"
)

type CertificationTarget added in v0.13.0

type CertificationTarget string

Product or serving environment for which the combination was evaluated.

const (
	CertificationTargetCertificationTargetDeServerless CertificationTarget = "CERTIFICATION_TARGET_DE_SERVERLESS"
	CertificationTargetCertificationTargetMre          CertificationTarget = "CERTIFICATION_TARGET_MRE"
)

type ChatCompletion

type ChatCompletion struct {
	ID      string                 `json:"id" api:"required"`
	Choices []ChatCompletionChoice `json:"choices" api:"required"`
	Created int64                  `json:"created" api:"required"`
	Model   string                 `json:"model" api:"required"`
	// The object type, which is always `chat.completion`.
	Object constant.ChatCompletion `json:"object" default:"chat.completion"`
	// When `echo` is true, the prompt is included in the response. Additionally, when
	// `logprobs` is also provided, log probability information is provided on the
	// prompt.
	Prompt   ChatCompletionPrompt    `json:"prompt" api:"required"`
	Usage    ChatCompletionUsage     `json:"usage" api:"nullable"`
	Warnings []ChatCompletionWarning `json:"warnings"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Choices     respjson.Field
		Created     respjson.Field
		Model       respjson.Field
		Object      respjson.Field
		Prompt      respjson.Field
		Usage       respjson.Field
		Warnings    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletion) RawJSON

func (r ChatCompletion) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletion) UnmarshalJSON

func (r *ChatCompletion) UnmarshalJSON(data []byte) error

type ChatCompletionAssistantMessageParam added in v0.13.0

type ChatCompletionAssistantMessageParam struct {
	// Any of "assistant".
	Role             ChatCompletionAssistantMessageParamRole `json:"role,omitzero" api:"required"`
	Content          param.Opt[string]                       `json:"content,omitzero"`
	Reasoning        param.Opt[string]                       `json:"reasoning,omitzero"`
	ReasoningContent param.Opt[string]                       `json:"reasoning_content,omitzero"`
	Name             param.Opt[string]                       `json:"name,omitzero"`
	ToolCalls        []ToolChoiceParam                       `json:"tool_calls,omitzero"`
	// contains filtered or unexported fields
}

The property Role is required.

func (ChatCompletionAssistantMessageParam) MarshalJSON added in v0.13.0

func (r ChatCompletionAssistantMessageParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionAssistantMessageParam) UnmarshalJSON added in v0.13.0

func (r *ChatCompletionAssistantMessageParam) UnmarshalJSON(data []byte) error

type ChatCompletionAssistantMessageParamRole added in v0.13.0

type ChatCompletionAssistantMessageParamRole string
const (
	ChatCompletionAssistantMessageParamRoleAssistant ChatCompletionAssistantMessageParamRole = "assistant"
)

type ChatCompletionChoice

type ChatCompletionChoice struct {
	// Any of "stop", "eos", "length", "tool_calls", "function_call".
	FinishReason string                `json:"finish_reason"`
	Index        int64                 `json:"index"`
	Logprobs     LogProbs              `json:"logprobs" api:"nullable"`
	Message      ChatCompletionMessage `json:"message"`
	Seed         int64                 `json:"seed"`
	Text         string                `json:"text"`
	// Top log probabilities for the tokens.
	TopLogprobs map[string]float64 `json:"top_logprobs"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FinishReason respjson.Field
		Index        respjson.Field
		Logprobs     respjson.Field
		Message      respjson.Field
		Seed         respjson.Field
		Text         respjson.Field
		TopLogprobs  respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionChoice) RawJSON

func (r ChatCompletionChoice) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionChoice) UnmarshalJSON

func (r *ChatCompletionChoice) UnmarshalJSON(data []byte) error

type ChatCompletionChunk

type ChatCompletionChunk struct {
	ID      string                      `json:"id" api:"required"`
	Choices []ChatCompletionChunkChoice `json:"choices" api:"required"`
	Created int64                       `json:"created" api:"required"`
	Model   string                      `json:"model" api:"required"`
	// The object type, which is always `chat.completion.chunk`.
	Object            constant.ChatCompletionChunk `json:"object" default:"chat.completion.chunk"`
	SystemFingerprint string                       `json:"system_fingerprint"`
	Usage             ChatCompletionUsage          `json:"usage" api:"nullable"`
	Warnings          []ChatCompletionWarning      `json:"warnings"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		Choices           respjson.Field
		Created           respjson.Field
		Model             respjson.Field
		Object            respjson.Field
		SystemFingerprint respjson.Field
		Usage             respjson.Field
		Warnings          respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionChunk) RawJSON

func (r ChatCompletionChunk) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionChunk) UnmarshalJSON

func (r *ChatCompletionChunk) UnmarshalJSON(data []byte) error

type ChatCompletionChunkChoice

type ChatCompletionChunkChoice struct {
	Delta ChatCompletionChunkChoiceDelta `json:"delta" api:"required"`
	// Any of "stop", "eos", "length", "tool_calls", "function_call".
	FinishReason string  `json:"finish_reason" api:"required"`
	Index        int64   `json:"index" api:"required"`
	Logprobs     float64 `json:"logprobs" api:"nullable"`
	Seed         int64   `json:"seed" api:"nullable"`
	// Top log probabilities for the tokens.
	TopLogprobs map[string]float64 `json:"top_logprobs"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Delta        respjson.Field
		FinishReason respjson.Field
		Index        respjson.Field
		Logprobs     respjson.Field
		Seed         respjson.Field
		TopLogprobs  respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionChunkChoice) RawJSON

func (r ChatCompletionChunkChoice) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionChunkChoice) UnmarshalJSON

func (r *ChatCompletionChunkChoice) UnmarshalJSON(data []byte) error

type ChatCompletionChunkChoiceDelta

type ChatCompletionChunkChoiceDelta struct {
	// Any of "system", "user", "assistant", "function", "tool".
	Role             string       `json:"role" api:"required"`
	Content          string       `json:"content" api:"nullable"`
	Reasoning        string       `json:"reasoning" api:"nullable"`
	ReasoningContent string       `json:"reasoning_content" api:"nullable"`
	TokenID          int64        `json:"token_id"`
	ToolCalls        []ToolChoice `json:"tool_calls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Role             respjson.Field
		Content          respjson.Field
		Reasoning        respjson.Field
		ReasoningContent respjson.Field
		TokenID          respjson.Field
		ToolCalls        respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionChunkChoiceDelta) RawJSON

Returns the unmodified JSON received from the API

func (*ChatCompletionChunkChoiceDelta) UnmarshalJSON

func (r *ChatCompletionChunkChoiceDelta) UnmarshalJSON(data []byte) error

type ChatCompletionMessage added in v0.13.0

type ChatCompletionMessage struct {
	Content string `json:"content" api:"required"`
	// Any of "assistant".
	Role             ChatCompletionMessageRole `json:"role" api:"required"`
	Reasoning        string                    `json:"reasoning" api:"nullable"`
	ReasoningContent string                    `json:"reasoning_content" api:"nullable"`
	ToolCalls        []ToolChoice              `json:"tool_calls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content          respjson.Field
		Role             respjson.Field
		Reasoning        respjson.Field
		ReasoningContent respjson.Field
		ToolCalls        respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionMessage) RawJSON added in v0.13.0

func (r ChatCompletionMessage) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionMessage) UnmarshalJSON added in v0.13.0

func (r *ChatCompletionMessage) UnmarshalJSON(data []byte) error

type ChatCompletionMessageParamUnion added in v0.13.0

type ChatCompletionMessageParamUnion struct {
	OfChatCompletionSystemMessage    *ChatCompletionSystemMessageParam    `json:",omitzero,inline"`
	OfChatCompletionUserMessage      *ChatCompletionUserMessageParam      `json:",omitzero,inline"`
	OfChatCompletionAssistantMessage *ChatCompletionAssistantMessageParam `json:",omitzero,inline"`
	OfChatCompletionToolMessage      *ChatCompletionToolMessageParam      `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func ChatCompletionMessageParamOfChatCompletionAssistantMessage added in v0.13.0

func ChatCompletionMessageParamOfChatCompletionAssistantMessage(role ChatCompletionAssistantMessageParamRole) ChatCompletionMessageParamUnion

func ChatCompletionMessageParamOfChatCompletionSystemMessage added in v0.13.0

func ChatCompletionMessageParamOfChatCompletionSystemMessage(content string, role ChatCompletionSystemMessageParamRole) ChatCompletionMessageParamUnion

func ChatCompletionMessageParamOfChatCompletionToolMessage added in v0.13.0

func ChatCompletionMessageParamOfChatCompletionToolMessage(content string, role ChatCompletionToolMessageParamRole, toolCallID string) ChatCompletionMessageParamUnion

func (ChatCompletionMessageParamUnion) GetContent added in v0.13.0

func (u ChatCompletionMessageParamUnion) GetContent() (res chatCompletionMessageParamUnionContent)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (ChatCompletionMessageParamUnion) GetName added in v0.13.0

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionMessageParamUnion) GetReasoning added in v0.13.0

func (u ChatCompletionMessageParamUnion) GetReasoning() *string

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionMessageParamUnion) GetReasoningContent added in v0.13.0

func (u ChatCompletionMessageParamUnion) GetReasoningContent() *string

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionMessageParamUnion) GetRole added in v0.13.0

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionMessageParamUnion) GetToolCallID added in v0.13.0

func (u ChatCompletionMessageParamUnion) GetToolCallID() *string

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionMessageParamUnion) GetToolCalls added in v0.13.0

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionMessageParamUnion) MarshalJSON added in v0.13.0

func (u ChatCompletionMessageParamUnion) MarshalJSON() ([]byte, error)

func (*ChatCompletionMessageParamUnion) UnmarshalJSON added in v0.13.0

func (u *ChatCompletionMessageParamUnion) UnmarshalJSON(data []byte) error

type ChatCompletionMessageRole added in v0.13.0

type ChatCompletionMessageRole string
const (
	ChatCompletionMessageRoleAssistant ChatCompletionMessageRole = "assistant"
)

type ChatCompletionNewParams

type ChatCompletionNewParams struct {
	// A list of messages comprising the conversation so far.
	Messages []ChatCompletionMessageParamUnion `json:"messages,omitzero" api:"required"`
	// The name of the model to query.
	//
	// [See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#chat-models)
	Model string `json:"model" api:"required"`
	// If true, the response contains the prompt. Can be used with `logprobs` to return
	// prompt logprobs.
	Echo param.Opt[bool] `json:"echo,omitzero"`
	// A number between -2.0 and 2.0 where a positive value decreases the likelihood of
	// repeating tokens that have already been mentioned.
	FrequencyPenalty param.Opt[float64] `json:"frequency_penalty,omitzero"`
	// An integer between 0 and 20 of the top k tokens to return log probabilities for
	// at each generation step, instead of only the sampled token. Log probabilities
	// help assess model confidence in token predictions.
	Logprobs param.Opt[int64] `json:"logprobs,omitzero"`
	// The maximum number of tokens to generate.
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// A number between 0 and 1 that can be used as an alternative to top_p and top-k.
	MinP param.Opt[float64] `json:"min_p,omitzero"`
	// The number of completions to generate for each prompt.
	N param.Opt[int64] `json:"n,omitzero"`
	// A number between -2.0 and 2.0 where a positive value increases the likelihood of
	// a model talking about new topics.
	PresencePenalty param.Opt[float64] `json:"presence_penalty,omitzero"`
	// A number that controls the diversity of generated text by reducing the
	// likelihood of repeated sequences. Higher values decrease repetition.
	RepetitionPenalty param.Opt[float64] `json:"repetition_penalty,omitzero"`
	// The name of the moderation model used to validate tokens. Choose from the
	// available moderation models found
	// [here](https://docs.together.ai/docs/inference-models#moderation-models).
	SafetyModel param.Opt[string] `json:"safety_model,omitzero"`
	// Seed value for reproducibility.
	Seed param.Opt[int64] `json:"seed,omitzero"`
	// A decimal number from 0-1 that determines the degree of randomness in the
	// response. A temperature less than 1 favors more correctness and is appropriate
	// for question answering or summarization. A value closer to 1 introduces more
	// randomness in the output.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// An integer that's used to limit the number of choices for the next predicted
	// word or token. It specifies the maximum number of tokens to consider at each
	// step, based on their probability of occurrence. This technique helps to speed up
	// the generation process and can improve the quality of the generated text by
	// focusing on the most likely options.
	TopK param.Opt[int64] `json:"top_k,omitzero"`
	// A percentage (also called the nucleus parameter) that's used to dynamically
	// adjust the number of choices for each predicted token based on the cumulative
	// probabilities. It specifies a probability threshold below which all less likely
	// tokens are filtered out. This technique helps maintain diversity and generate
	// more fluent and natural-sounding text.
	TopP param.Opt[float64] `json:"top_p,omitzero"`
	// Additional configuration to pass to model engine.
	ChatTemplateKwargs any `json:"chat_template_kwargs,omitzero"`
	// Any of "hipaa".
	Compliance ChatCompletionNewParamsCompliance `json:"compliance,omitzero"`
	// Defines the behavior of the API when max_tokens exceed the maximum context
	// length of the model. When set to 'error', the API returns 400 with an
	// appropriate error message. When set to 'truncate', overrides max_tokens with the
	// maximum context length of the model.
	//
	// Any of "truncate", "error".
	ContextLengthExceededBehavior ChatCompletionNewParamsContextLengthExceededBehavior `json:"context_length_exceeded_behavior,omitzero"`
	FunctionCall                  ChatCompletionNewParamsFunctionCallUnion             `json:"function_call,omitzero"`
	// Adjusts the likelihood of specific tokens appearing in the generated output.
	LogitBias map[string]float64 `json:"logit_bias,omitzero"`
	// For models that support toggling reasoning functionality, this object can be
	// used to control that functionality.
	Reasoning ChatCompletionNewParamsReasoning `json:"reasoning,omitzero"`
	// Controls the level of reasoning effort the model should apply when generating
	// responses. Higher values may result in more thoughtful and detailed responses
	// but may take longer to generate.
	//
	// Any of "low", "medium", "high".
	ReasoningEffort ChatCompletionNewParamsReasoningEffort `json:"reasoning_effort,omitzero"`
	// An object specifying the format that the model must output.
	//
	// Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
	// Outputs which ensures the model will match your supplied JSON schema. Learn more
	// in the [Structured Outputs guide](https://docs.together.ai/docs/json-mode).
	//
	// Setting to `{ "type": "json_object" }` enables the older JSON mode, which
	// ensures the message the model generates is valid JSON. Using `json_schema` is
	// preferred for models that support it.
	ResponseFormat ChatCompletionNewParamsResponseFormatUnion `json:"response_format,omitzero"`
	// A list of string sequences that truncate (stop) inference text output. For
	// example, "</s>" stops generation as soon as the model generates the given token.
	Stop []string `json:"stop,omitzero"`
	// Controls which (if any) function is called by the model. By default uses `auto`,
	// which lets the model pick between generating a message or calling a function.
	ToolChoice ChatCompletionNewParamsToolChoiceUnion `json:"tool_choice,omitzero"`
	// A list of tools the model may call. Currently, only functions are supported as a
	// tool. Use this to provide a list of functions the model may generate JSON inputs
	// for.
	Tools []ToolsParam `json:"tools,omitzero"`
	// contains filtered or unexported fields
}

func (ChatCompletionNewParams) MarshalJSON

func (r ChatCompletionNewParams) MarshalJSON() (data []byte, err error)

func (*ChatCompletionNewParams) UnmarshalJSON

func (r *ChatCompletionNewParams) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsCompliance added in v0.4.0

type ChatCompletionNewParamsCompliance string
const (
	ChatCompletionNewParamsComplianceHipaa ChatCompletionNewParamsCompliance = "hipaa"
)

type ChatCompletionNewParamsContextLengthExceededBehavior

type ChatCompletionNewParamsContextLengthExceededBehavior string

Defines the behavior of the API when max_tokens exceed the maximum context length of the model. When set to 'error', the API returns 400 with an appropriate error message. When set to 'truncate', overrides max_tokens with the maximum context length of the model.

const (
	ChatCompletionNewParamsContextLengthExceededBehaviorTruncate ChatCompletionNewParamsContextLengthExceededBehavior = "truncate"
	ChatCompletionNewParamsContextLengthExceededBehaviorError    ChatCompletionNewParamsContextLengthExceededBehavior = "error"
)

type ChatCompletionNewParamsFunctionCallName

type ChatCompletionNewParamsFunctionCallName struct {
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

The property Name is required.

func (ChatCompletionNewParamsFunctionCallName) MarshalJSON

func (r ChatCompletionNewParamsFunctionCallName) MarshalJSON() (data []byte, err error)

func (*ChatCompletionNewParamsFunctionCallName) UnmarshalJSON

func (r *ChatCompletionNewParamsFunctionCallName) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsFunctionCallString

type ChatCompletionNewParamsFunctionCallString string
const (
	ChatCompletionNewParamsFunctionCallStringNone ChatCompletionNewParamsFunctionCallString = "none"
	ChatCompletionNewParamsFunctionCallStringAuto ChatCompletionNewParamsFunctionCallString = "auto"
)

type ChatCompletionNewParamsFunctionCallUnion

type ChatCompletionNewParamsFunctionCallUnion struct {
	// Check if union is this variant with
	// !param.IsOmitted(union.OfChatCompletionNewsFunctionCallString)
	OfChatCompletionNewsFunctionCallString param.Opt[string]                        `json:",omitzero,inline"`
	OfChatCompletionNewsFunctionCallName   *ChatCompletionNewParamsFunctionCallName `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ChatCompletionNewParamsFunctionCallUnion) MarshalJSON

func (*ChatCompletionNewParamsFunctionCallUnion) UnmarshalJSON

func (u *ChatCompletionNewParamsFunctionCallUnion) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsReasoning added in v0.6.0

type ChatCompletionNewParamsReasoning struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

For models that support toggling reasoning functionality, this object can be used to control that functionality.

func (ChatCompletionNewParamsReasoning) MarshalJSON added in v0.6.0

func (r ChatCompletionNewParamsReasoning) MarshalJSON() (data []byte, err error)

func (*ChatCompletionNewParamsReasoning) UnmarshalJSON added in v0.6.0

func (r *ChatCompletionNewParamsReasoning) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsReasoningEffort

type ChatCompletionNewParamsReasoningEffort string

Controls the level of reasoning effort the model should apply when generating responses. Higher values may result in more thoughtful and detailed responses but may take longer to generate.

const (
	ChatCompletionNewParamsReasoningEffortLow    ChatCompletionNewParamsReasoningEffort = "low"
	ChatCompletionNewParamsReasoningEffortMedium ChatCompletionNewParamsReasoningEffort = "medium"
	ChatCompletionNewParamsReasoningEffortHigh   ChatCompletionNewParamsReasoningEffort = "high"
)

type ChatCompletionNewParamsResponseFormatJsonObject

type ChatCompletionNewParamsResponseFormatJsonObject struct {
	// The type of response format being defined. Always `json_object`.
	Type constant.JsonObject `json:"type" default:"json_object"`
	// contains filtered or unexported fields
}

JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.

This struct has a constant value, construct it with NewChatCompletionNewParamsResponseFormatJsonObject.

func NewChatCompletionNewParamsResponseFormatJsonObject

func NewChatCompletionNewParamsResponseFormatJsonObject() ChatCompletionNewParamsResponseFormatJsonObject

func (ChatCompletionNewParamsResponseFormatJsonObject) MarshalJSON

func (r ChatCompletionNewParamsResponseFormatJsonObject) MarshalJSON() (data []byte, err error)

func (*ChatCompletionNewParamsResponseFormatJsonObject) UnmarshalJSON

type ChatCompletionNewParamsResponseFormatJsonSchema

type ChatCompletionNewParamsResponseFormatJsonSchema struct {
	// Structured Outputs configuration options, including a JSON Schema.
	JsonSchema ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema `json:"json_schema,omitzero" api:"required"`
	// The type of response format being defined. Always `json_schema`.
	//
	// This field can be elided, and will marshal its zero value as "json_schema".
	Type constant.JsonSchema `json:"type" default:"json_schema"`
	// contains filtered or unexported fields
}

JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](https://docs.together.ai/docs/json-mode).

The properties JsonSchema, Type are required.

func (ChatCompletionNewParamsResponseFormatJsonSchema) MarshalJSON

func (r ChatCompletionNewParamsResponseFormatJsonSchema) MarshalJSON() (data []byte, err error)

func (*ChatCompletionNewParamsResponseFormatJsonSchema) UnmarshalJSON

type ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema

type ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema struct {
	// The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
	// and dashes, with a maximum length of 64.
	Name string `json:"name" api:"required"`
	// Whether to enable strict schema adherence when generating the output. If set to
	// true, the model will always follow the exact schema defined in the `schema`
	// field. Only a subset of JSON Schema is supported when `strict` is `true`. To
	// learn more, read the
	// [Structured Outputs guide](https://docs.together.ai/docs/json-mode).
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// A description of what the response format is for, used by the model to determine
	// how to respond in the format.
	Description param.Opt[string] `json:"description,omitzero"`
	// The schema for the response format, described as a JSON Schema object. Learn how
	// to build JSON schemas [here](https://json-schema.org/).
	Schema map[string]any `json:"schema,omitzero"`
	// contains filtered or unexported fields
}

Structured Outputs configuration options, including a JSON Schema.

The property Name is required.

func (ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema) MarshalJSON

func (*ChatCompletionNewParamsResponseFormatJsonSchemaJsonSchema) UnmarshalJSON

type ChatCompletionNewParamsResponseFormatText

type ChatCompletionNewParamsResponseFormatText struct {
	// The type of response format being defined. Always `text`.
	Type constant.Text `json:"type" default:"text"`
	// contains filtered or unexported fields
}

Default response format. Used to generate text responses.

This struct has a constant value, construct it with NewChatCompletionNewParamsResponseFormatText.

func NewChatCompletionNewParamsResponseFormatText

func NewChatCompletionNewParamsResponseFormatText() ChatCompletionNewParamsResponseFormatText

func (ChatCompletionNewParamsResponseFormatText) MarshalJSON

func (r ChatCompletionNewParamsResponseFormatText) MarshalJSON() (data []byte, err error)

func (*ChatCompletionNewParamsResponseFormatText) UnmarshalJSON

func (r *ChatCompletionNewParamsResponseFormatText) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsResponseFormatUnion

type ChatCompletionNewParamsResponseFormatUnion struct {
	OfText       *ChatCompletionNewParamsResponseFormatText       `json:",omitzero,inline"`
	OfJsonSchema *ChatCompletionNewParamsResponseFormatJsonSchema `json:",omitzero,inline"`
	OfJsonObject *ChatCompletionNewParamsResponseFormatJsonObject `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ChatCompletionNewParamsResponseFormatUnion) GetJsonSchema

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsResponseFormatUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionNewParamsResponseFormatUnion) MarshalJSON

func (*ChatCompletionNewParamsResponseFormatUnion) UnmarshalJSON

func (u *ChatCompletionNewParamsResponseFormatUnion) UnmarshalJSON(data []byte) error

type ChatCompletionNewParamsToolChoiceUnion

type ChatCompletionNewParamsToolChoiceUnion struct {
	OfString     param.Opt[string] `json:",omitzero,inline"`
	OfToolChoice *ToolChoiceParam  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ChatCompletionNewParamsToolChoiceUnion) MarshalJSON

func (u ChatCompletionNewParamsToolChoiceUnion) MarshalJSON() ([]byte, error)

func (*ChatCompletionNewParamsToolChoiceUnion) UnmarshalJSON

func (u *ChatCompletionNewParamsToolChoiceUnion) UnmarshalJSON(data []byte) error

type ChatCompletionPrompt added in v0.7.0

type ChatCompletionPrompt []ChatCompletionPromptItem

type ChatCompletionPromptItem added in v0.7.0

type ChatCompletionPromptItem struct {
	Logprobs LogProbs `json:"logprobs"`
	Text     string   `json:"text"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Logprobs    respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionPromptItem) RawJSON added in v0.7.0

func (r ChatCompletionPromptItem) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionPromptItem) UnmarshalJSON added in v0.7.0

func (r *ChatCompletionPromptItem) UnmarshalJSON(data []byte) error

type ChatCompletionService

type ChatCompletionService struct {
	Options []option.RequestOption
}

ChatCompletionService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewChatCompletionService method instead.

func NewChatCompletionService

func NewChatCompletionService(opts ...option.RequestOption) (r ChatCompletionService)

NewChatCompletionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ChatCompletionService) New

Generate a model response for a given chat conversation. Supports single queries and multi-turn conversations with system, user, and assistant messages.

func (*ChatCompletionService) NewStreaming

Generate a model response for a given chat conversation. Supports single queries and multi-turn conversations with system, user, and assistant messages.

type ChatCompletionStructuredMessageImageURLImageURLParam

type ChatCompletionStructuredMessageImageURLImageURLParam struct {
	// The URL of the image
	URL string `json:"url" api:"required"`
	// contains filtered or unexported fields
}

The property URL is required.

func (ChatCompletionStructuredMessageImageURLImageURLParam) MarshalJSON

func (r ChatCompletionStructuredMessageImageURLImageURLParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionStructuredMessageImageURLImageURLParam) UnmarshalJSON

type ChatCompletionStructuredMessageImageURLParam

type ChatCompletionStructuredMessageImageURLParam struct {
	ImageURL ChatCompletionStructuredMessageImageURLImageURLParam `json:"image_url,omitzero"`
	// Any of "image_url".
	Type ChatCompletionStructuredMessageImageURLType `json:"type,omitzero"`
	// contains filtered or unexported fields
}

func (ChatCompletionStructuredMessageImageURLParam) MarshalJSON

func (r ChatCompletionStructuredMessageImageURLParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionStructuredMessageImageURLParam) UnmarshalJSON

func (r *ChatCompletionStructuredMessageImageURLParam) UnmarshalJSON(data []byte) error

type ChatCompletionStructuredMessageImageURLType

type ChatCompletionStructuredMessageImageURLType string
const (
	ChatCompletionStructuredMessageImageURLTypeImageURL ChatCompletionStructuredMessageImageURLType = "image_url"
)

type ChatCompletionStructuredMessageTextParam

type ChatCompletionStructuredMessageTextParam struct {
	Text string `json:"text" api:"required"`
	// Any of "text".
	Type ChatCompletionStructuredMessageTextType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Text, Type are required.

func (ChatCompletionStructuredMessageTextParam) MarshalJSON

func (r ChatCompletionStructuredMessageTextParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionStructuredMessageTextParam) UnmarshalJSON

func (r *ChatCompletionStructuredMessageTextParam) UnmarshalJSON(data []byte) error

type ChatCompletionStructuredMessageTextType

type ChatCompletionStructuredMessageTextType string
const (
	ChatCompletionStructuredMessageTextTypeText ChatCompletionStructuredMessageTextType = "text"
)

type ChatCompletionStructuredMessageVideoURLParam

type ChatCompletionStructuredMessageVideoURLParam struct {
	// Any of "video_url".
	Type     ChatCompletionStructuredMessageVideoURLType          `json:"type,omitzero" api:"required"`
	VideoURL ChatCompletionStructuredMessageVideoURLVideoURLParam `json:"video_url,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Type, VideoURL are required.

func (ChatCompletionStructuredMessageVideoURLParam) MarshalJSON

func (r ChatCompletionStructuredMessageVideoURLParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionStructuredMessageVideoURLParam) UnmarshalJSON

func (r *ChatCompletionStructuredMessageVideoURLParam) UnmarshalJSON(data []byte) error

type ChatCompletionStructuredMessageVideoURLType

type ChatCompletionStructuredMessageVideoURLType string
const (
	ChatCompletionStructuredMessageVideoURLTypeVideoURL ChatCompletionStructuredMessageVideoURLType = "video_url"
)

type ChatCompletionStructuredMessageVideoURLVideoURLParam

type ChatCompletionStructuredMessageVideoURLVideoURLParam struct {
	// The URL of the video
	URL string `json:"url" api:"required"`
	// contains filtered or unexported fields
}

The property URL is required.

func (ChatCompletionStructuredMessageVideoURLVideoURLParam) MarshalJSON

func (r ChatCompletionStructuredMessageVideoURLVideoURLParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionStructuredMessageVideoURLVideoURLParam) UnmarshalJSON

type ChatCompletionSystemMessageParam added in v0.13.0

type ChatCompletionSystemMessageParam struct {
	Content string `json:"content" api:"required"`
	// Any of "system".
	Role ChatCompletionSystemMessageParamRole `json:"role,omitzero" api:"required"`
	Name param.Opt[string]                    `json:"name,omitzero"`
	// contains filtered or unexported fields
}

The properties Content, Role are required.

func (ChatCompletionSystemMessageParam) MarshalJSON added in v0.13.0

func (r ChatCompletionSystemMessageParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionSystemMessageParam) UnmarshalJSON added in v0.13.0

func (r *ChatCompletionSystemMessageParam) UnmarshalJSON(data []byte) error

type ChatCompletionSystemMessageParamRole added in v0.13.0

type ChatCompletionSystemMessageParamRole string
const (
	ChatCompletionSystemMessageParamRoleSystem ChatCompletionSystemMessageParamRole = "system"
)

type ChatCompletionToolMessageParam added in v0.13.0

type ChatCompletionToolMessageParam struct {
	Content string `json:"content" api:"required"`
	// Any of "tool".
	Role       ChatCompletionToolMessageParamRole `json:"role,omitzero" api:"required"`
	ToolCallID string                             `json:"tool_call_id" api:"required"`
	Name       param.Opt[string]                  `json:"name,omitzero"`
	// contains filtered or unexported fields
}

The properties Content, Role, ToolCallID are required.

func (ChatCompletionToolMessageParam) MarshalJSON added in v0.13.0

func (r ChatCompletionToolMessageParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionToolMessageParam) UnmarshalJSON added in v0.13.0

func (r *ChatCompletionToolMessageParam) UnmarshalJSON(data []byte) error

type ChatCompletionToolMessageParamRole added in v0.13.0

type ChatCompletionToolMessageParamRole string
const (
	ChatCompletionToolMessageParamRoleTool ChatCompletionToolMessageParamRole = "tool"
)

type ChatCompletionUsage

type ChatCompletionUsage struct {
	CompletionTokens int64 `json:"completion_tokens" api:"required"`
	PromptTokens     int64 `json:"prompt_tokens" api:"required"`
	TotalTokens      int64 `json:"total_tokens" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompletionTokens respjson.Field
		PromptTokens     respjson.Field
		TotalTokens      respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionUsage) RawJSON

func (r ChatCompletionUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionUsage) UnmarshalJSON

func (r *ChatCompletionUsage) UnmarshalJSON(data []byte) error

type ChatCompletionUserMessageParam added in v0.13.0

type ChatCompletionUserMessageParam struct {
	// The content of the message, which can either be a simple string or a structured
	// format.
	Content ChatCompletionUserMessageParamContentUnion `json:"content,omitzero" api:"required"`
	// Any of "user".
	Role ChatCompletionUserMessageParamRole `json:"role,omitzero" api:"required"`
	Name param.Opt[string]                  `json:"name,omitzero"`
	// contains filtered or unexported fields
}

The properties Content, Role are required.

func (ChatCompletionUserMessageParam) MarshalJSON added in v0.13.0

func (r ChatCompletionUserMessageParam) MarshalJSON() (data []byte, err error)

func (*ChatCompletionUserMessageParam) UnmarshalJSON added in v0.13.0

func (r *ChatCompletionUserMessageParam) UnmarshalJSON(data []byte) error

type ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio added in v0.13.0

type ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio struct {
	AudioURL ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL `json:"audio_url,omitzero" api:"required"`
	// Any of "audio_url".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties AudioURL, Type are required.

func (ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio) MarshalJSON added in v0.13.0

func (*ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio) UnmarshalJSON added in v0.13.0

type ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL added in v0.13.0

type ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL struct {
	// The URL of the audio
	URL string `json:"url" api:"required"`
	// contains filtered or unexported fields
}

The property URL is required.

func (ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL) MarshalJSON added in v0.13.0

func (*ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudioAudioURL) UnmarshalJSON added in v0.13.0

type ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio added in v0.13.0

type ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio struct {
	InputAudio ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio `json:"input_audio,omitzero" api:"required"`
	// Any of "input_audio".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties InputAudio, Type are required.

func (ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio) MarshalJSON added in v0.13.0

func (*ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio) UnmarshalJSON added in v0.13.0

type ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio added in v0.13.0

type ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio struct {
	// The base64 encoded audio data
	Data string `json:"data" api:"required"`
	// The format of the audio data
	//
	// Any of "wav".
	Format string `json:"format,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Data, Format are required.

func (ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio) MarshalJSON added in v0.13.0

func (*ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudioInputAudio) UnmarshalJSON added in v0.13.0

type ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion added in v0.13.0

type ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion struct {
	OfChatCompletionStructuredMessageText     *ChatCompletionStructuredMessageTextParam                                                      `json:",omitzero,inline"`
	OfChatCompletionStructuredMessageImageURL *ChatCompletionStructuredMessageImageURLParam                                                  `json:",omitzero,inline"`
	OfVideo                                   *ChatCompletionStructuredMessageVideoURLParam                                                  `json:",omitzero,inline"`
	OfAudio                                   *ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemAudio      `json:",omitzero,inline"`
	OfInputAudio                              *ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemInputAudio `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetAudioURL added in v0.13.0

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetImageURL added in v0.13.0

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetInputAudio added in v0.13.0

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetText added in v0.13.0

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetType added in v0.13.0

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) GetVideoURL added in v0.13.0

Returns a pointer to the underlying variant's property, if present.

func (ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) MarshalJSON added in v0.13.0

func (*ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion) UnmarshalJSON added in v0.13.0

type ChatCompletionUserMessageParamContentUnion added in v0.13.0

type ChatCompletionUserMessageParamContentUnion struct {
	OfString                                                                          param.Opt[string]                                                                          `json:",omitzero,inline"`
	OfChatCompletionUserMessageContentChatCompletionUserMessageContentMultimodalArray []ChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalItemUnion `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ChatCompletionUserMessageParamContentUnion) MarshalJSON added in v0.13.0

func (*ChatCompletionUserMessageParamContentUnion) UnmarshalJSON added in v0.13.0

func (u *ChatCompletionUserMessageParamContentUnion) UnmarshalJSON(data []byte) error

type ChatCompletionUserMessageParamRole added in v0.13.0

type ChatCompletionUserMessageParamRole string
const (
	ChatCompletionUserMessageParamRoleUser ChatCompletionUserMessageParamRole = "user"
)

type ChatCompletionWarning

type ChatCompletionWarning struct {
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ChatCompletionWarning) RawJSON

func (r ChatCompletionWarning) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChatCompletionWarning) UnmarshalJSON

func (r *ChatCompletionWarning) UnmarshalJSON(data []byte) error

type ChatService

type ChatService struct {
	Options     []option.RequestOption
	Completions ChatCompletionService
}

ChatService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewChatService method instead.

func NewChatService

func NewChatService(opts ...option.RequestOption) (r ChatService)

NewChatService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type Client

type Client struct {
	Options      []option.RequestOption
	Beta         BetaService
	Organization OrganizationService
	Clusters     ClusterService
	Chat         ChatService
	Completions  CompletionService
	Embeddings   EmbeddingService
	Files        FileService
	FineTuning   FineTuningService
	Images       ImageService
	Videos       VideoService
	Audio        AudioService
	Models       ModelService
	Endpoints    EndpointService
	Projects     ProjectService
	Rerank       RerankService
	Batches      BatchService
	Evals        EvalService
}

Client creates a struct with services and top level methods that help with interacting with the together API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (TOGETHER_API_KEY, TOGETHER_PROJECT_ID, TOGETHER_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Whoami added in v0.11.0

func (r *Client) Whoami(ctx context.Context, opts ...option.RequestOption) (res *WhoamiResponseUnion, err error)

Returns identity information for the authenticated caller. Accepts project API keys and user session JWTs. The response `type` indicates which fields are present. For project-scoped credentials, `project.slug` can be used with an endpoint slug as `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint inference calls.

type Cluster added in v0.4.0

type Cluster struct {
	// Enabled add-ons on this cluster. Only add-ons with enabled=true in their config
	// are returned.
	AddOns []ClusterAddOn `json:"add_ons" api:"required"`
	// Actual number of preemptible GPUs currently allocated to the cluster. Updated
	// asynchronously by the fulfillment and reclamation workers; may be less than
	// desired_preemptible_gpus when capacity is constrained.
	AllocatedPreemptibleGPUs int64 `json:"allocated_preemptible_gpus" api:"required"`
	// Billing type for the cluster (RESERVED, ON_DEMAND, or SCHEDULED_CAPACITY).
	//
	// Any of "RESERVED", "ON_DEMAND", "SCHEDULED_CAPACITY".
	BillingType ClusterBillingType `json:"billing_type" api:"required"`
	ClusterID   string             `json:"cluster_id" api:"required"`
	ClusterName string             `json:"cluster_name" api:"required"`
	// Type of cluster.
	//
	// Any of "KUBERNETES", "SLURM".
	ClusterType       ClusterClusterType        `json:"cluster_type" api:"required"`
	ControlPlaneNodes []ClusterControlPlaneNode `json:"control_plane_nodes" api:"required"`
	CudaVersion       string                    `json:"cuda_version" api:"required"`
	// Customer's requested number of preemptible GPUs. Set on cluster create or
	// update; persists until changed.
	DesiredPreemptibleGPUs int64 `json:"desired_preemptible_gpus" api:"required"`
	// Any of "H100_SXM", "H200_SXM", "RTX_6000_PCI", "L40_PCIE", "B200_SXM",
	// "H100_SXM_INF", "B300_SXM".
	GPUType        ClusterGPUType         `json:"gpu_type" api:"required"`
	GPUWorkerNodes []ClusterGPUWorkerNode `json:"gpu_worker_nodes" api:"required"`
	KubeConfig     string                 `json:"kube_config" api:"required"`
	// Number of GPUs to draw from a capacity pool. A component of the overall
	// num_gpus, alongside num_reserved_gpus.
	NumCapacityPoolGPUs int64 `json:"num_capacity_pool_gpus" api:"required"`
	// Number of CPU-only worker nodes in the cluster.
	NumCPUWorkers int64 `json:"num_cpu_workers" api:"required"`
	NumGPUs       int64 `json:"num_gpus" api:"required"`
	// Number of prepaid reserved GPUs for this cluster. A component of the overall
	// num_gpus, alongside num_capacity_pool_gpus.
	NumReservedGPUs     int64  `json:"num_reserved_gpus" api:"required"`
	NvidiaDriverVersion string `json:"nvidia_driver_version" api:"required"`
	// Cluster-level phase transition history.
	PhaseTransitions []ClusterPhaseTransition `json:"phase_transitions" api:"required"`
	ProjectID        string                   `json:"project_id" api:"required"`
	Region           string                   `json:"region" api:"required"`
	// Current status of the GPU cluster.
	//
	// Any of "WaitingForControlPlaneNodes", "WaitingForDataPlaneNodes",
	// "WaitingForSubnet", "WaitingForSharedVolume", "InstallingDrivers",
	// "RunningAcceptanceTests", "Paused", "OnDemandComputePaused", "Ready",
	// "Degraded", "Deleting".
	Status         ClusterStatus        `json:"status" api:"required"`
	Volumes        []ClusterVolume      `json:"volumes" api:"required"`
	CapacityPoolID string               `json:"capacity_pool_id"`
	ClusterConfig  ClusterClusterConfig `json:"cluster_config"`
	// Whether the control plane is currently ready.
	ControlPlaneReady bool      `json:"control_plane_ready"`
	CreatedAt         time.Time `json:"created_at" format:"date-time"`
	// GPU worker nodes retained after they left the live data plane. These are
	// separate from gpu_worker_nodes and must not be counted as live capacity.
	DeletedGPUWorkerNodes []ClusterDeletedGPUWorkerNode `json:"deleted_gpu_worker_nodes"`
	DurationHours         int64                         `json:"duration_hours"`
	// Timestamp when the cluster first reached the Ready phase.
	FirstReadyAt   time.Time `json:"first_ready_at" format:"date-time"`
	InstallTraefik bool      `json:"install_traefik"`
	// Whether the cluster runs on the Together-managed GPU cluster platform.
	IsInSubstrate bool `json:"is_in_substrate"`
	// ID of the machine cluster backing this GPU cluster.
	MachineClusterID string `json:"machine_cluster_id"`
	// Recent node lifecycle events such as scale-up, scale-down, and preemption.
	// Combine these with live and deleted node lists to render the cluster timeline.
	NodeLifecycleEvents []ClusterNodeLifecycleEvent `json:"node_lifecycle_events"`
	// Internal NVIDIA version ID for this cluster's driver and CUDA combination.
	NvidiaDriverVersionID string            `json:"nvidia_driver_version_id"`
	OidcConfig            ClusterOidcConfig `json:"oidc_config"`
	// Data-volume image name for GPU worker nodes.
	OsImage              string    `json:"os_image"`
	ReservationEndTime   time.Time `json:"reservation_end_time" format:"date-time"`
	ReservationStartTime time.Time `json:"reservation_start_time" format:"date-time"`
	SlurmShmSizeGib      int64     `json:"slurm_shm_size_gib"`
	// UMS organization ID associated with this cluster.
	UmsOrgID string `json:"ums_org_id"`
	// UMS project ID associated with this cluster.
	UmsProjectID string `json:"ums_project_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AddOns                   respjson.Field
		AllocatedPreemptibleGPUs respjson.Field
		BillingType              respjson.Field
		ClusterID                respjson.Field
		ClusterName              respjson.Field
		ClusterType              respjson.Field
		ControlPlaneNodes        respjson.Field
		CudaVersion              respjson.Field
		DesiredPreemptibleGPUs   respjson.Field
		GPUType                  respjson.Field
		GPUWorkerNodes           respjson.Field
		KubeConfig               respjson.Field
		NumCapacityPoolGPUs      respjson.Field
		NumCPUWorkers            respjson.Field
		NumGPUs                  respjson.Field
		NumReservedGPUs          respjson.Field
		NvidiaDriverVersion      respjson.Field
		PhaseTransitions         respjson.Field
		ProjectID                respjson.Field
		Region                   respjson.Field
		Status                   respjson.Field
		Volumes                  respjson.Field
		CapacityPoolID           respjson.Field
		ClusterConfig            respjson.Field
		ControlPlaneReady        respjson.Field
		CreatedAt                respjson.Field
		DeletedGPUWorkerNodes    respjson.Field
		DurationHours            respjson.Field
		FirstReadyAt             respjson.Field
		InstallTraefik           respjson.Field
		IsInSubstrate            respjson.Field
		MachineClusterID         respjson.Field
		NodeLifecycleEvents      respjson.Field
		NvidiaDriverVersionID    respjson.Field
		OidcConfig               respjson.Field
		OsImage                  respjson.Field
		ReservationEndTime       respjson.Field
		ReservationStartTime     respjson.Field
		SlurmShmSizeGib          respjson.Field
		UmsOrgID                 respjson.Field
		UmsProjectID             respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Cluster) RawJSON added in v0.4.0

func (r Cluster) RawJSON() string

Returns the unmodified JSON received from the API

func (*Cluster) UnmarshalJSON added in v0.4.0

func (r *Cluster) UnmarshalJSON(data []byte) error

type ClusterAddOn added in v0.10.0

type ClusterAddOn struct {
	AddOnType string `json:"add_on_type" api:"required"`
	// Configuration for a cluster add-on.
	Config ClusterAddOnConfig `json:"config" api:"required"`
	Name   string             `json:"name" api:"required"`
	// State for a cluster add-on.
	State ClusterAddOnState `json:"state" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AddOnType   respjson.Field
		Config      respjson.Field
		Name        respjson.Field
		State       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AddOnInfo is returned in cluster responses and add-on CRUD operations.

func (ClusterAddOn) RawJSON added in v0.10.0

func (r ClusterAddOn) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOn) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOn) UnmarshalJSON(data []byte) error

type ClusterAddOnConfig added in v0.10.0

type ClusterAddOnConfig struct {
	Dashboard ClusterAddOnConfigDashboard `json:"dashboard"`
	// Configuration for the Headlamp Kubernetes dashboard add-on.
	Headlamp ClusterAddOnConfigHeadlamp `json:"headlamp"`
	Ingress  ClusterAddOnConfigIngress  `json:"ingress"`
	// Configuration for the Slurm Web add-on.
	SlurmWeb ClusterAddOnConfigSlurmWeb `json:"slurm_web"`
	// Configuration for the Model Aware TorchPass add-on.
	Torchpass ClusterAddOnConfigTorchpass `json:"torchpass"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Dashboard   respjson.Field
		Headlamp    respjson.Field
		Ingress     respjson.Field
		SlurmWeb    respjson.Field
		Torchpass   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for a cluster add-on.

func (ClusterAddOnConfig) RawJSON added in v0.10.0

func (r ClusterAddOnConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnConfig) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOnConfig) UnmarshalJSON(data []byte) error

type ClusterAddOnConfigDashboard added in v0.10.0

type ClusterAddOnConfigDashboard struct {
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterAddOnConfigDashboard) RawJSON added in v0.10.0

func (r ClusterAddOnConfigDashboard) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnConfigDashboard) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOnConfigDashboard) UnmarshalJSON(data []byte) error

type ClusterAddOnConfigHeadlamp added in v0.12.0

type ClusterAddOnConfigHeadlamp struct {
	// Whether to enable the Headlamp Kubernetes dashboard add-on.
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for the Headlamp Kubernetes dashboard add-on.

func (ClusterAddOnConfigHeadlamp) RawJSON added in v0.12.0

func (r ClusterAddOnConfigHeadlamp) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnConfigHeadlamp) UnmarshalJSON added in v0.12.0

func (r *ClusterAddOnConfigHeadlamp) UnmarshalJSON(data []byte) error

type ClusterAddOnConfigIngress added in v0.10.0

type ClusterAddOnConfigIngress struct {
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterAddOnConfigIngress) RawJSON added in v0.10.0

func (r ClusterAddOnConfigIngress) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnConfigIngress) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOnConfigIngress) UnmarshalJSON(data []byte) error

type ClusterAddOnConfigSlurmWeb added in v0.12.0

type ClusterAddOnConfigSlurmWeb struct {
	// Whether to enable the Slurm Web add-on.
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for the Slurm Web add-on.

func (ClusterAddOnConfigSlurmWeb) RawJSON added in v0.12.0

func (r ClusterAddOnConfigSlurmWeb) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnConfigSlurmWeb) UnmarshalJSON added in v0.12.0

func (r *ClusterAddOnConfigSlurmWeb) UnmarshalJSON(data []byte) error

type ClusterAddOnConfigTorchpass added in v0.11.0

type ClusterAddOnConfigTorchpass struct {
	// Whether to enable the Model Aware TorchPass add-on.
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for the Model Aware TorchPass add-on.

func (ClusterAddOnConfigTorchpass) RawJSON added in v0.11.0

func (r ClusterAddOnConfigTorchpass) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnConfigTorchpass) UnmarshalJSON added in v0.11.0

func (r *ClusterAddOnConfigTorchpass) UnmarshalJSON(data []byte) error

type ClusterAddOnState added in v0.10.0

type ClusterAddOnState struct {
	Dashboard ClusterAddOnStateDashboard `json:"dashboard"`
	// State for the Headlamp Kubernetes dashboard add-on.
	Headlamp ClusterAddOnStateHeadlamp `json:"headlamp"`
	Ingress  ClusterAddOnStateIngress  `json:"ingress"`
	// State for the Slurm Web add-on.
	SlurmWeb ClusterAddOnStateSlurmWeb `json:"slurm_web"`
	// State for the Model Aware TorchPass add-on.
	Torchpass ClusterAddOnStateTorchpass `json:"torchpass"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Dashboard   respjson.Field
		Headlamp    respjson.Field
		Ingress     respjson.Field
		SlurmWeb    respjson.Field
		Torchpass   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

State for a cluster add-on.

func (ClusterAddOnState) RawJSON added in v0.10.0

func (r ClusterAddOnState) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnState) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOnState) UnmarshalJSON(data []byte) error

type ClusterAddOnStateDashboard added in v0.10.0

type ClusterAddOnStateDashboard struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterAddOnStateDashboard) RawJSON added in v0.10.0

func (r ClusterAddOnStateDashboard) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnStateDashboard) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOnStateDashboard) UnmarshalJSON(data []byte) error

type ClusterAddOnStateHeadlamp added in v0.12.0

type ClusterAddOnStateHeadlamp struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

State for the Headlamp Kubernetes dashboard add-on.

func (ClusterAddOnStateHeadlamp) RawJSON added in v0.12.0

func (r ClusterAddOnStateHeadlamp) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnStateHeadlamp) UnmarshalJSON added in v0.12.0

func (r *ClusterAddOnStateHeadlamp) UnmarshalJSON(data []byte) error

type ClusterAddOnStateIngress added in v0.10.0

type ClusterAddOnStateIngress struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterAddOnStateIngress) RawJSON added in v0.10.0

func (r ClusterAddOnStateIngress) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnStateIngress) UnmarshalJSON added in v0.10.0

func (r *ClusterAddOnStateIngress) UnmarshalJSON(data []byte) error

type ClusterAddOnStateSlurmWeb added in v0.12.0

type ClusterAddOnStateSlurmWeb struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

State for the Slurm Web add-on.

func (ClusterAddOnStateSlurmWeb) RawJSON added in v0.12.0

func (r ClusterAddOnStateSlurmWeb) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnStateSlurmWeb) UnmarshalJSON added in v0.12.0

func (r *ClusterAddOnStateSlurmWeb) UnmarshalJSON(data []byte) error

type ClusterAddOnStateTorchpass added in v0.11.0

type ClusterAddOnStateTorchpass struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

State for the Model Aware TorchPass add-on.

func (ClusterAddOnStateTorchpass) RawJSON added in v0.11.0

func (r ClusterAddOnStateTorchpass) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterAddOnStateTorchpass) UnmarshalJSON added in v0.11.0

func (r *ClusterAddOnStateTorchpass) UnmarshalJSON(data []byte) error

type ClusterBillingType added in v0.10.0

type ClusterBillingType string

Billing type for the cluster (RESERVED, ON_DEMAND, or SCHEDULED_CAPACITY).

const (
	ClusterBillingTypeReserved          ClusterBillingType = "RESERVED"
	ClusterBillingTypeOnDemand          ClusterBillingType = "ON_DEMAND"
	ClusterBillingTypeScheduledCapacity ClusterBillingType = "SCHEDULED_CAPACITY"
)

type ClusterClusterConfig added in v0.10.0

type ClusterClusterConfig struct {
	// Any of "NONE", "TRAEFIK", "NGINX", "ISTIO".
	LoadBalancer string `json:"load_balancer" api:"required"`
	// NVIDIA GPU Operator chart/version for the tenant cluster (e.g. v24.6.2). When
	// omitted, a service default is applied.
	GPUOperatorVersion         string                      `json:"gpu_operator_version"`
	Ingress                    ClusterClusterConfigIngress `json:"ingress"`
	JumphostEnabled            bool                        `json:"jumphost_enabled"`
	KubernetesDashboardEnabled bool                        `json:"kubernetes_dashboard_enabled"`
	// NVIDIA Network Operator chart/version for the tenant cluster (e.g. v24.7.0).
	// When omitted, a service default is applied.
	NetworkOperatorVersion string                            `json:"network_operator_version"`
	Observability          ClusterClusterConfigObservability `json:"observability"`
	// SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog,
	// init, extra conf).
	SlurmStartupScripts ClusterClusterConfigSlurmStartupScripts `json:"slurm_startup_scripts"`
	// Whether this cluster uses a per-cluster SSH certificate authority for
	// OIDC-signed SSH access.
	SSHCaEnabled bool `json:"ssh_ca_enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LoadBalancer               respjson.Field
		GPUOperatorVersion         respjson.Field
		Ingress                    respjson.Field
		JumphostEnabled            respjson.Field
		KubernetesDashboardEnabled respjson.Field
		NetworkOperatorVersion     respjson.Field
		Observability              respjson.Field
		SlurmStartupScripts        respjson.Field
		SSHCaEnabled               respjson.Field
		ExtraFields                map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterClusterConfig) RawJSON added in v0.10.0

func (r ClusterClusterConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterClusterConfig) UnmarshalJSON added in v0.10.0

func (r *ClusterClusterConfig) UnmarshalJSON(data []byte) error

type ClusterClusterConfigIngress added in v0.10.0

type ClusterClusterConfigIngress struct {
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterClusterConfigIngress) RawJSON added in v0.10.0

func (r ClusterClusterConfigIngress) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterClusterConfigIngress) UnmarshalJSON added in v0.10.0

func (r *ClusterClusterConfigIngress) UnmarshalJSON(data []byte) error

type ClusterClusterConfigObservability added in v0.10.0

type ClusterClusterConfigObservability struct {
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterClusterConfigObservability) RawJSON added in v0.10.0

Returns the unmodified JSON received from the API

func (*ClusterClusterConfigObservability) UnmarshalJSON added in v0.10.0

func (r *ClusterClusterConfigObservability) UnmarshalJSON(data []byte) error

type ClusterClusterConfigSlurmStartupScripts added in v0.10.0

type ClusterClusterConfigSlurmStartupScripts struct {
	// Slurm controller epilog script.
	ControllerEpilog string `json:"controller_epilog"`
	// Slurm controller prolog script.
	ControllerProlog string `json:"controller_prolog"`
	// Additional slurm.conf fragments.
	ExtraSlurmConf string `json:"extra_slurm_conf"`
	// Script run on Slurm login node init.
	LoginInitScript string `json:"login_init_script"`
	// Script run on Slurm nodeset init.
	NodesetInitScript string `json:"nodeset_init_script"`
	// Slurm worker node epilog script.
	WorkerEpilog string `json:"worker_epilog"`
	// Slurm worker node prolog script.
	WorkerProlog string `json:"worker_prolog"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ControllerEpilog  respjson.Field
		ControllerProlog  respjson.Field
		ExtraSlurmConf    respjson.Field
		LoginInitScript   respjson.Field
		NodesetInitScript respjson.Field
		WorkerEpilog      respjson.Field
		WorkerProlog      respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog, init, extra conf).

func (ClusterClusterConfigSlurmStartupScripts) RawJSON added in v0.10.0

Returns the unmodified JSON received from the API

func (*ClusterClusterConfigSlurmStartupScripts) UnmarshalJSON added in v0.10.0

func (r *ClusterClusterConfigSlurmStartupScripts) UnmarshalJSON(data []byte) error

type ClusterClusterType added in v0.4.0

type ClusterClusterType string

Type of cluster.

const (
	ClusterClusterTypeKubernetes ClusterClusterType = "KUBERNETES"
	ClusterClusterTypeSlurm      ClusterClusterType = "SLURM"
)

type ClusterControlPlaneNode added in v0.4.0

type ClusterControlPlaneNode struct {
	HostName    string  `json:"host_name" api:"required"`
	MemoryGib   float64 `json:"memory_gib" api:"required"`
	Network     string  `json:"network" api:"required"`
	NodeID      string  `json:"node_id" api:"required"`
	NumCPUCores int64   `json:"num_cpu_cores" api:"required"`
	// Phase transition history for this control plane node.
	PhaseTransitions []ClusterControlPlaneNodePhaseTransition `json:"phase_transitions" api:"required"`
	Status           string                                   `json:"status" api:"required"`
	// Public IPv4 address of the control plane node.
	PublicIpv4 string `json:"public_ipv4"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HostName         respjson.Field
		MemoryGib        respjson.Field
		Network          respjson.Field
		NodeID           respjson.Field
		NumCPUCores      respjson.Field
		PhaseTransitions respjson.Field
		Status           respjson.Field
		PublicIpv4       respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterControlPlaneNode) RawJSON added in v0.4.0

func (r ClusterControlPlaneNode) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterControlPlaneNode) UnmarshalJSON added in v0.4.0

func (r *ClusterControlPlaneNode) UnmarshalJSON(data []byte) error

type ClusterControlPlaneNodePhaseTransition added in v0.10.0

type ClusterControlPlaneNodePhaseTransition struct {
	// Node phase.
	//
	// Any of "NODE_PHASE_PENDING", "NODE_PHASE_SCHEDULING", "NODE_PHASE_BOOTING",
	// "NODE_PHASE_BOOTSTRAPPING", "NODE_PHASE_RUNNING", "NODE_PHASE_SUCCEEDED",
	// "NODE_PHASE_FAILED", "NODE_PHASE_PAUSED".
	Phase string `json:"phase" api:"required"`
	// Timestamp when the phase transition occurred.
	TransitionTime time.Time `json:"transition_time" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Phase          respjson.Field
		TransitionTime respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterControlPlaneNodePhaseTransition) RawJSON added in v0.10.0

Returns the unmodified JSON received from the API

func (*ClusterControlPlaneNodePhaseTransition) UnmarshalJSON added in v0.10.0

func (r *ClusterControlPlaneNodePhaseTransition) UnmarshalJSON(data []byte) error

type ClusterDeleteResponse added in v0.13.0

type ClusterDeleteResponse struct {
	ClusterID string `json:"cluster_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClusterID   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterDeleteResponse) RawJSON added in v0.13.0

func (r ClusterDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterDeleteResponse) UnmarshalJSON added in v0.13.0

func (r *ClusterDeleteResponse) UnmarshalJSON(data []byte) error

type ClusterDeletedGPUWorkerNode added in v0.11.0

type ClusterDeletedGPUWorkerNode struct {
	HostName    string   `json:"host_name" api:"required"`
	MemoryGib   float64  `json:"memory_gib" api:"required"`
	Networks    []string `json:"networks" api:"required"`
	NodeID      string   `json:"node_id" api:"required"`
	NumCPUCores int64    `json:"num_cpu_cores" api:"required"`
	NumGPUs     int64    `json:"num_gpus" api:"required"`
	// Phase transition history for this GPU worker node.
	PhaseTransitions []ClusterDeletedGPUWorkerNodePhaseTransition `json:"phase_transitions" api:"required"`
	Status           string                                       `json:"status" api:"required"`
	// Whether auto-remediation is enabled for this node's instance.
	AutoRemediationEnabled bool `json:"auto_remediation_enabled"`
	// Timestamp when the node left the live data plane. Only set for
	// deleted_gpu_worker_nodes.
	DeletedAt time.Time `json:"deleted_at" format:"date-time"`
	// Ephemeral storage size, such as 1Ti.
	EphemeralStorage string `json:"ephemeral_storage"`
	// Number of InfiniBand HCAs.
	IbHcaCount int64 `json:"ib_hca_count"`
	// InfiniBand HCA type.
	IbHcaType  string `json:"ib_hca_type"`
	InstanceID string `json:"instance_id"`
	// Remediation represents a node remediation request for an instance. An instance
	// can have multiple remediations over time (e.g., failed attempts followed by
	// retries).
	LatestRemediation Remediation `json:"latest_remediation"`
	// Whether this node is marked for deletion by the operator.
	MarkedForDeletion bool `json:"marked_for_deletion"`
	// Number of NVSwitches.
	NvswitchCount int64 `json:"nvswitch_count"`
	// NVSwitch type.
	NvswitchType string `json:"nvswitch_type"`
	// Public IPv4 address of the GPU worker node.
	PublicIpv4          string `json:"public_ipv4"`
	SlurmWorkerHostname string `json:"slurm_worker_hostname"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HostName               respjson.Field
		MemoryGib              respjson.Field
		Networks               respjson.Field
		NodeID                 respjson.Field
		NumCPUCores            respjson.Field
		NumGPUs                respjson.Field
		PhaseTransitions       respjson.Field
		Status                 respjson.Field
		AutoRemediationEnabled respjson.Field
		DeletedAt              respjson.Field
		EphemeralStorage       respjson.Field
		IbHcaCount             respjson.Field
		IbHcaType              respjson.Field
		InstanceID             respjson.Field
		LatestRemediation      respjson.Field
		MarkedForDeletion      respjson.Field
		NvswitchCount          respjson.Field
		NvswitchType           respjson.Field
		PublicIpv4             respjson.Field
		SlurmWorkerHostname    respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterDeletedGPUWorkerNode) RawJSON added in v0.11.0

func (r ClusterDeletedGPUWorkerNode) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterDeletedGPUWorkerNode) UnmarshalJSON added in v0.11.0

func (r *ClusterDeletedGPUWorkerNode) UnmarshalJSON(data []byte) error

type ClusterDeletedGPUWorkerNodePhaseTransition added in v0.11.0

type ClusterDeletedGPUWorkerNodePhaseTransition struct {
	// Node phase.
	//
	// Any of "NODE_PHASE_PENDING", "NODE_PHASE_SCHEDULING", "NODE_PHASE_BOOTING",
	// "NODE_PHASE_BOOTSTRAPPING", "NODE_PHASE_RUNNING", "NODE_PHASE_SUCCEEDED",
	// "NODE_PHASE_FAILED", "NODE_PHASE_PAUSED".
	Phase string `json:"phase" api:"required"`
	// Timestamp when the phase transition occurred.
	TransitionTime time.Time `json:"transition_time" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Phase          respjson.Field
		TransitionTime respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterDeletedGPUWorkerNodePhaseTransition) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*ClusterDeletedGPUWorkerNodePhaseTransition) UnmarshalJSON added in v0.11.0

func (r *ClusterDeletedGPUWorkerNodePhaseTransition) UnmarshalJSON(data []byte) error

type ClusterGPUType added in v0.4.0

type ClusterGPUType string
const (
	ClusterGPUTypeH100Sxm    ClusterGPUType = "H100_SXM"
	ClusterGPUTypeH200Sxm    ClusterGPUType = "H200_SXM"
	ClusterGPUTypeRtx6000Pci ClusterGPUType = "RTX_6000_PCI"
	ClusterGPUTypeL40Pcie    ClusterGPUType = "L40_PCIE"
	ClusterGPUTypeB200Sxm    ClusterGPUType = "B200_SXM"
	ClusterGPUTypeH100SxmInf ClusterGPUType = "H100_SXM_INF"
	ClusterGPUTypeB300Sxm    ClusterGPUType = "B300_SXM"
)

type ClusterGPUWorkerNode added in v0.4.0

type ClusterGPUWorkerNode struct {
	HostName    string   `json:"host_name" api:"required"`
	MemoryGib   float64  `json:"memory_gib" api:"required"`
	Networks    []string `json:"networks" api:"required"`
	NodeID      string   `json:"node_id" api:"required"`
	NumCPUCores int64    `json:"num_cpu_cores" api:"required"`
	NumGPUs     int64    `json:"num_gpus" api:"required"`
	// Phase transition history for this GPU worker node.
	PhaseTransitions []ClusterGPUWorkerNodePhaseTransition `json:"phase_transitions" api:"required"`
	Status           string                                `json:"status" api:"required"`
	// Whether auto-remediation is enabled for this node's instance.
	AutoRemediationEnabled bool `json:"auto_remediation_enabled"`
	// Timestamp when the node left the live data plane. Only set for
	// deleted_gpu_worker_nodes.
	DeletedAt time.Time `json:"deleted_at" format:"date-time"`
	// Ephemeral storage size, such as 1Ti.
	EphemeralStorage string `json:"ephemeral_storage"`
	// Number of InfiniBand HCAs.
	IbHcaCount int64 `json:"ib_hca_count"`
	// InfiniBand HCA type.
	IbHcaType  string `json:"ib_hca_type"`
	InstanceID string `json:"instance_id"`
	// Remediation represents a node remediation request for an instance. An instance
	// can have multiple remediations over time (e.g., failed attempts followed by
	// retries).
	LatestRemediation Remediation `json:"latest_remediation"`
	// Whether this node is marked for deletion by the operator.
	MarkedForDeletion bool `json:"marked_for_deletion"`
	// Number of NVSwitches.
	NvswitchCount int64 `json:"nvswitch_count"`
	// NVSwitch type.
	NvswitchType string `json:"nvswitch_type"`
	// Public IPv4 address of the GPU worker node.
	PublicIpv4          string `json:"public_ipv4"`
	SlurmWorkerHostname string `json:"slurm_worker_hostname"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HostName               respjson.Field
		MemoryGib              respjson.Field
		Networks               respjson.Field
		NodeID                 respjson.Field
		NumCPUCores            respjson.Field
		NumGPUs                respjson.Field
		PhaseTransitions       respjson.Field
		Status                 respjson.Field
		AutoRemediationEnabled respjson.Field
		DeletedAt              respjson.Field
		EphemeralStorage       respjson.Field
		IbHcaCount             respjson.Field
		IbHcaType              respjson.Field
		InstanceID             respjson.Field
		LatestRemediation      respjson.Field
		MarkedForDeletion      respjson.Field
		NvswitchCount          respjson.Field
		NvswitchType           respjson.Field
		PublicIpv4             respjson.Field
		SlurmWorkerHostname    respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterGPUWorkerNode) RawJSON added in v0.4.0

func (r ClusterGPUWorkerNode) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterGPUWorkerNode) UnmarshalJSON added in v0.4.0

func (r *ClusterGPUWorkerNode) UnmarshalJSON(data []byte) error

type ClusterGPUWorkerNodePhaseTransition added in v0.10.0

type ClusterGPUWorkerNodePhaseTransition struct {
	// Node phase.
	//
	// Any of "NODE_PHASE_PENDING", "NODE_PHASE_SCHEDULING", "NODE_PHASE_BOOTING",
	// "NODE_PHASE_BOOTSTRAPPING", "NODE_PHASE_RUNNING", "NODE_PHASE_SUCCEEDED",
	// "NODE_PHASE_FAILED", "NODE_PHASE_PAUSED".
	Phase string `json:"phase" api:"required"`
	// Timestamp when the phase transition occurred.
	TransitionTime time.Time `json:"transition_time" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Phase          respjson.Field
		TransitionTime respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterGPUWorkerNodePhaseTransition) RawJSON added in v0.10.0

Returns the unmodified JSON received from the API

func (*ClusterGPUWorkerNodePhaseTransition) UnmarshalJSON added in v0.10.0

func (r *ClusterGPUWorkerNodePhaseTransition) UnmarshalJSON(data []byte) error

type ClusterListParams added in v0.13.0

type ClusterListParams struct {
	// Optional UMS project ID to filter clusters by. When set, only clusters belonging
	// to this project are returned. The caller must be a member of the project;
	// otherwise the result set will be empty.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `query:"projectId,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ClusterListParams) URLQuery added in v0.13.0

func (r ClusterListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ClusterListParams's query parameters as `url.Values`.

type ClusterListRegionsResponse added in v0.13.0

type ClusterListRegionsResponse struct {
	Regions []ClusterListRegionsResponseRegion `json:"regions" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Regions     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterListRegionsResponse) RawJSON added in v0.13.0

func (r ClusterListRegionsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterListRegionsResponse) UnmarshalJSON added in v0.13.0

func (r *ClusterListRegionsResponse) UnmarshalJSON(data []byte) error

type ClusterListRegionsResponseRegion added in v0.13.0

type ClusterListRegionsResponseRegion struct {
	// List of supported identifiable cuda/nvidia driver versions pairs available in
	// the region.
	DriverVersions []ClusterListRegionsResponseRegionDriverVersion `json:"driver_versions" api:"required"`
	// Identifiable name of the region.
	Name string `json:"name" api:"required"`
	// List of supported identifiable gpus available in the region.
	SupportedInstanceTypes []string `json:"supported_instance_types" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DriverVersions         respjson.Field
		Name                   respjson.Field
		SupportedInstanceTypes respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterListRegionsResponseRegion) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ClusterListRegionsResponseRegion) UnmarshalJSON added in v0.13.0

func (r *ClusterListRegionsResponseRegion) UnmarshalJSON(data []byte) error

type ClusterListRegionsResponseRegionDriverVersion added in v0.13.0

type ClusterListRegionsResponseRegionDriverVersion struct {
	// Region-specific NVIDIA catalog ID to send as nvidia_version_id when creating a
	// cluster.
	ID string `json:"id" api:"required"`
	// Semantic CUDA version without operating system text.
	CudaVersion string `json:"cuda_version" api:"required"`
	// NVIDIA driver version.
	NvidiaDriverVersion string `json:"nvidia_driver_version" api:"required"`
	// Operating system image family for this catalog entry.
	Os string `json:"os" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		CudaVersion         respjson.Field
		NvidiaDriverVersion respjson.Field
		Os                  respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

NVIDIA software configuration available in the region.

func (ClusterListRegionsResponseRegionDriverVersion) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ClusterListRegionsResponseRegionDriverVersion) UnmarshalJSON added in v0.13.0

func (r *ClusterListRegionsResponseRegionDriverVersion) UnmarshalJSON(data []byte) error

type ClusterListResponse added in v0.13.0

type ClusterListResponse struct {
	Clusters []Cluster `json:"clusters" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Clusters    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterListResponse) RawJSON added in v0.13.0

func (r ClusterListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterListResponse) UnmarshalJSON added in v0.13.0

func (r *ClusterListResponse) UnmarshalJSON(data []byte) error

type ClusterNewParams added in v0.13.0

type ClusterNewParams struct {

	// This field is a request body variant, only one variant field can be set. Create
	// a cluster with a canonical NVIDIA version id. Do not also set cuda_version or
	// nvidia_driver_version.
	OfGPUClusterCreateRequestNvidiaVersion *ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersion `json:",inline"`
	// This field is a request body variant, only one variant field can be set. Create
	// a cluster with the legacy CUDA and NVIDIA driver selectors. nvidia_version_id
	// may also be set when it resolves to the same catalog entry.
	OfGPUClusterCreateRequestLegacyNvidia *ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidia `json:",inline"`
	// contains filtered or unexported fields
}

func (ClusterNewParams) MarshalJSON added in v0.13.0

func (u ClusterNewParams) MarshalJSON() ([]byte, error)

func (*ClusterNewParams) UnmarshalJSON added in v0.13.0

func (r *ClusterNewParams) UnmarshalJSON(data []byte) error

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidia added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidia struct {
	// RESERVED billing types allow you to specify the duration of the cluster
	// reservation via the duration_days field. ON_DEMAND billing types will give you
	// ownership of the cluster until you delete it. SCHEDULED_CAPACITY billing types
	// allow you to reserve capacity for a scheduled time window. You must specify the
	// reservation_start_time and reservation_end_time with this request.
	//
	// Any of "RESERVED", "ON_DEMAND", "SCHEDULED_CAPACITY".
	BillingType string `json:"billing_type,omitzero" api:"required"`
	// Name of the GPU cluster.
	ClusterName string `json:"cluster_name" api:"required"`
	// Legacy CUDA selector for this cluster. Bare semantic values such as 12.5 select
	// ubuntu-22.04; existing OS-suffixed values remain accepted for compatibility.
	// Must be paired with nvidia_driver_version. Prefer nvidia_version_id for new
	// integrations.
	CudaVersion string `json:"cuda_version" api:"required"`
	// Type of GPU to use in the cluster
	//
	// Any of "H100_SXM", "H200_SXM", "RTX_6000_PCI", "L40_PCIE", "B200_SXM",
	// "H100_SXM_INF", "B300_SXM".
	GPUType string `json:"gpu_type,omitzero" api:"required"`
	// Number of GPUs to allocate in the cluster. This must be multiple of 8. For
	// example, 8, 16 or 24
	NumGPUs int64 `json:"num_gpus" api:"required"`
	// Legacy NVIDIA driver selector for this cluster. For example, 550. Must be paired
	// with cuda_version. Prefer nvidia_version_id for new integrations.
	NvidiaDriverVersion string `json:"nvidia_driver_version" api:"required"`
	// Region to create the GPU cluster in. Usable regions can be found from
	// `client.clusters.list_regions()`
	Region string `json:"region" api:"required"`
	// Whether to enable auto-scaling for the cluster. If true, the cluster will
	// automatically scale the number of GPU worker nodes between num_gpus and
	// auto_scale_max_gpus based on the workload.
	AutoScale param.Opt[bool] `json:"auto_scale,omitzero"`
	// Maximum number of GPUs to which the cluster can be auto-scaled up.
	AutoScaleMaxGPUs param.Opt[int64] `json:"auto_scale_max_gpus,omitzero"`
	// ID of the capacity pool to use for the cluster. This field is optional and only
	// applicable if the cluster is created from a capacity pool.
	CapacityPoolID param.Opt[string] `json:"capacity_pool_id,omitzero"`
	// Duration in days to keep the cluster running.
	DurationDays param.Opt[int64] `json:"duration_days,omitzero"`
	// Whether to install Traefik ingress controller in the cluster. This field is only
	// applicable for Kubernetes clusters and is false by default.
	InstallTraefik param.Opt[bool] `json:"install_traefik,omitzero"`
	// Number of GPUs to allocate from the capacity pool. Must be a multiple of 8 and
	// not exceed num_gpus.
	NumCapacityPoolGPUs param.Opt[int64] `json:"num_capacity_pool_gpus,omitzero"`
	// Number of preemptible GPUs to request alongside on-demand capacity. Must be a
	// multiple of 8. Preemptible nodes are cheaper but may be reclaimed when on-demand
	// capacity is needed elsewhere; the system fulfills this asynchronously and
	// surfaces the actual count in allocated_preemptible_gpus.
	NumPreemptibleGPUs param.Opt[int64] `json:"num_preemptible_gpus,omitzero"`
	// Number of prepaid (PLG) reserved GPUs for this cluster. When omitted for
	// RESERVED billing on create, the server defaults this to num_gpus.
	NumReservedGPUs param.Opt[int64] `json:"num_reserved_gpus,omitzero"`
	// Canonical region-specific NVIDIA version ID. If cuda_version and
	// nvidia_driver_version are also set, they must resolve to the same catalog entry.
	NvidiaVersionID param.Opt[string] `json:"nvidia_version_id,omitzero"`
	// Project ID for the cluster. If not set, the project from the request context is
	// used.
	ProjectID param.Opt[string] `json:"project_id,omitzero"`
	// Reservation end time of the cluster. This field is required for SCHEDULED
	// billing to specify the reservation end time for the cluster.
	ReservationEndTime param.Opt[time.Time] `json:"reservation_end_time,omitzero" format:"date-time"`
	// Reservation start time of the cluster. This field is required for SCHEDULED
	// billing to specify the reservation start time for the cluster. If not provided,
	// the cluster provisions immediately.
	ReservationStartTime param.Opt[time.Time] `json:"reservation_start_time,omitzero" format:"date-time"`
	// Custom Slurm image for Slurm clusters.
	SlurmImage param.Opt[string] `json:"slurm_image,omitzero"`
	// Shared memory size in GiB for Slurm cluster. This field is required if
	// cluster_type is SLURM.
	SlurmShmSizeGib param.Opt[int64] `json:"slurm_shm_size_gib,omitzero"`
	// ID of an existing volume to use with the cluster creation.
	VolumeID param.Opt[string] `json:"volume_id,omitzero"`
	// AcceptanceTestsParams groups all GPU acceptance test options when enabled is
	// true.
	AcceptanceTestsParams ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAcceptanceTestsParams `json:"acceptance_tests_params,omitzero"`
	// Add-ons to enable on the cluster at creation time.
	AddOns        []ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOn       `json:"add_ons,omitzero"`
	ClusterConfig ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfig `json:"cluster_config,omitzero"`
	// Type of cluster to create.
	//
	// Any of "KUBERNETES", "SLURM".
	ClusterType string                                                            `json:"cluster_type,omitzero"`
	OidcConfig  ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaOidcConfig `json:"oidc_config,omitzero"`
	// Inline configuration to create a shared volume with the cluster creation.
	SharedVolume ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaSharedVolume `json:"shared_volume,omitzero"`
	// contains filtered or unexported fields
}

Create a cluster with the legacy CUDA and NVIDIA driver selectors. nvidia_version_id may also be set when it resolves to the same catalog entry.

The properties BillingType, ClusterName, CudaVersion, GPUType, NumGPUs, NvidiaDriverVersion, Region are required.

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidia) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidia) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAcceptanceTestsParams added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAcceptanceTestsParams struct {
	// Skip DCGM diagnostics acceptance test.
	DcgmDiagSkipped param.Opt[bool] `json:"dcgm_diag_skipped,omitzero"`
	// Whether to run GPU acceptance tests during cluster bring-up.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// GPU burn duration in seconds; 0 means use the default when enabled.
	GPUBurnDuration param.Opt[int64] `json:"gpu_burn_duration,omitzero"`
	// Skip GPU burn acceptance test.
	GPUBurnSkipped param.Opt[bool] `json:"gpu_burn_skipped,omitzero"`
	// Skip NCCL multi-node acceptance test.
	NcclMultiNodeSkipped param.Opt[bool] `json:"nccl_multi_node_skipped,omitzero"`
	// Skip NCCL single-node acceptance test.
	NcclSingleNodeSkipped param.Opt[bool] `json:"nccl_single_node_skipped,omitzero"`
	// Skip storage-performance acceptance test.
	StorageSkipped param.Opt[bool] `json:"storage_skipped,omitzero"`
	// DCGM diagnostic depth. SHORT = readiness; MEDIUM = default; LONG = system
	// validation; EXTENDED = memtest. An omitted value selects MEDIUM when enabled.
	//
	// Any of "DCGM_DIAG_LEVEL_SHORT", "DCGM_DIAG_LEVEL_MEDIUM",
	// "DCGM_DIAG_LEVEL_LONG", "DCGM_DIAG_LEVEL_EXTENDED".
	DcgmDiagLevel string `json:"dcgm_diag_level,omitzero"`
	// contains filtered or unexported fields
}

AcceptanceTestsParams groups all GPU acceptance test options when enabled is true.

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAcceptanceTestsParams) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAcceptanceTestsParams) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOn added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOn struct {
	// Type of add-on. Valid values: 'dashboard', 'ingress', 'torchpass'.
	AddOnType string `json:"add_on_type" api:"required"`
	// Human-readable name for this add-on instance.
	Name string `json:"name" api:"required"`
	// Configuration for a cluster add-on.
	Config ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfig `json:"config,omitzero"`
	// contains filtered or unexported fields
}

The properties AddOnType, Name are required.

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOn) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOn) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfig added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfig struct {
	Dashboard ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigDashboard `json:"dashboard,omitzero"`
	// Configuration for the Headlamp Kubernetes dashboard add-on.
	Headlamp ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigHeadlamp `json:"headlamp,omitzero"`
	Ingress  ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigIngress  `json:"ingress,omitzero"`
	// Configuration for the Slurm Web add-on.
	SlurmWeb ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigSlurmWeb `json:"slurm_web,omitzero"`
	// Configuration for the Model Aware TorchPass add-on.
	Torchpass ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigTorchpass `json:"torchpass,omitzero"`
	// contains filtered or unexported fields
}

Configuration for a cluster add-on.

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfig) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfig) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigDashboard added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigDashboard struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigDashboard) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigDashboard) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigHeadlamp added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigHeadlamp struct {
	// Whether to enable the Headlamp Kubernetes dashboard add-on.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the Headlamp Kubernetes dashboard add-on.

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigHeadlamp) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigHeadlamp) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigIngress added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigIngress struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigIngress) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigIngress) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigSlurmWeb added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigSlurmWeb struct {
	// Whether to enable the Slurm Web add-on.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the Slurm Web add-on.

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigSlurmWeb) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigSlurmWeb) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigTorchpass added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigTorchpass struct {
	// Whether to enable the Model Aware TorchPass add-on.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the Model Aware TorchPass add-on.

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigTorchpass) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaAddOnConfigTorchpass) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfig added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfig struct {
	// Any of "NONE", "TRAEFIK", "NGINX", "ISTIO".
	LoadBalancer string `json:"load_balancer,omitzero" api:"required"`
	// NVIDIA GPU Operator chart/version for the tenant cluster (e.g. v24.6.2). When
	// omitted, a service default is applied.
	GPUOperatorVersion         param.Opt[string] `json:"gpu_operator_version,omitzero"`
	JumphostEnabled            param.Opt[bool]   `json:"jumphost_enabled,omitzero"`
	KubernetesDashboardEnabled param.Opt[bool]   `json:"kubernetes_dashboard_enabled,omitzero"`
	// NVIDIA Network Operator chart/version for the tenant cluster (e.g. v24.7.0).
	// When omitted, a service default is applied.
	NetworkOperatorVersion param.Opt[string] `json:"network_operator_version,omitzero"`
	// Whether this cluster uses a per-cluster SSH certificate authority for
	// OIDC-signed SSH access.
	SSHCaEnabled  param.Opt[bool]                                                                   `json:"ssh_ca_enabled,omitzero"`
	Ingress       ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigIngress       `json:"ingress,omitzero"`
	Observability ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigObservability `json:"observability,omitzero"`
	// SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog,
	// init, extra conf).
	SlurmStartupScripts ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigSlurmStartupScripts `json:"slurm_startup_scripts,omitzero"`
	// contains filtered or unexported fields
}

The property LoadBalancer is required.

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfig) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfig) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigIngress added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigIngress struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigIngress) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigIngress) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigObservability added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigObservability struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigObservability) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigObservability) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigSlurmStartupScripts added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigSlurmStartupScripts struct {
	// Slurm controller epilog script.
	ControllerEpilog param.Opt[string] `json:"controller_epilog,omitzero"`
	// Slurm controller prolog script.
	ControllerProlog param.Opt[string] `json:"controller_prolog,omitzero"`
	// Additional slurm.conf fragments.
	ExtraSlurmConf param.Opt[string] `json:"extra_slurm_conf,omitzero"`
	// Script run on Slurm login node init.
	LoginInitScript param.Opt[string] `json:"login_init_script,omitzero"`
	// Script run on Slurm nodeset init.
	NodesetInitScript param.Opt[string] `json:"nodeset_init_script,omitzero"`
	// Slurm worker node epilog script.
	WorkerEpilog param.Opt[string] `json:"worker_epilog,omitzero"`
	// Slurm worker node prolog script.
	WorkerProlog param.Opt[string] `json:"worker_prolog,omitzero"`
	// contains filtered or unexported fields
}

SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog, init, extra conf).

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigSlurmStartupScripts) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaClusterConfigSlurmStartupScripts) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaOidcConfig added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaOidcConfig struct {
	// OIDC client ID for authentication.
	ClientID string `json:"client_id" api:"required"`
	// JWT claim to use for user groups. For example, 'groups'
	GroupClaim string `json:"group_claim" api:"required"`
	// Prefix to add to the group claim to form the final group name. For example,
	// 'oidc:'
	GroupPrefix string `json:"group_prefix" api:"required"`
	// OIDC issuer URL for authentication. For example, https://accounts.google.com
	IssuerURL string `json:"issuer_url" api:"required"`
	// JWT claim to use as the username. For example, 'sub' or 'email'
	UsernameClaim string `json:"username_claim" api:"required"`
	// Prefix to add to the username claim to form the final username. For example,
	// 'oidc:'
	UsernamePrefix string `json:"username_prefix" api:"required"`
	// CA certificate in PEM format to validate the OIDC issuer's TLS certificate. This
	// field is optional but recommended if the issuer uses a private CA or self-signed
	// certificate.
	CaCert param.Opt[string] `json:"ca_cert,omitzero"`
	// contains filtered or unexported fields
}

The properties ClientID, GroupClaim, GroupPrefix, IssuerURL, UsernameClaim, UsernamePrefix are required.

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaOidcConfig) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaOidcConfig) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaSharedVolume added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaSharedVolume struct {
	// Region name. Usable regions can be found from `clusters.list_regions()`
	Region string `json:"region" api:"required"`
	// Volume size in whole tebibytes (TiB).
	SizeTib int64 `json:"size_tib" api:"required"`
	// User provided name of the volume.
	VolumeName string `json:"volume_name" api:"required"`
	// Cluster ID to place the volume on the same infrastructure as that GPU cluster.
	InstanceClusterID param.Opt[string] `json:"instance_cluster_id,omitzero"`
	// When true, the shared volume is not deleted when the cluster is decommissioned.
	IsLifecycleIndependent param.Opt[bool] `json:"is_lifecycle_independent,omitzero"`
	// Project ID that will own the volume. When omitted, the caller's default project
	// is used.
	ProjectID param.Opt[string] `json:"project_id,omitzero"`
	// contains filtered or unexported fields
}

Inline configuration to create a shared volume with the cluster creation.

The properties Region, SizeTib, VolumeName are required.

func (ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaSharedVolume) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestLegacyNvidiaSharedVolume) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersion added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersion struct {
	// RESERVED billing types allow you to specify the duration of the cluster
	// reservation via the duration_days field. ON_DEMAND billing types will give you
	// ownership of the cluster until you delete it. SCHEDULED_CAPACITY billing types
	// allow you to reserve capacity for a scheduled time window. You must specify the
	// reservation_start_time and reservation_end_time with this request.
	//
	// Any of "RESERVED", "ON_DEMAND", "SCHEDULED_CAPACITY".
	BillingType string `json:"billing_type,omitzero" api:"required"`
	// Name of the GPU cluster.
	ClusterName string `json:"cluster_name" api:"required"`
	// Type of GPU to use in the cluster
	//
	// Any of "H100_SXM", "H200_SXM", "RTX_6000_PCI", "L40_PCIE", "B200_SXM",
	// "H100_SXM_INF", "B300_SXM".
	GPUType string `json:"gpu_type,omitzero" api:"required"`
	// Number of GPUs to allocate in the cluster. This must be multiple of 8. For
	// example, 8, 16 or 24
	NumGPUs int64 `json:"num_gpus" api:"required"`
	// Canonical region-specific NVIDIA version ID. If cuda_version and
	// nvidia_driver_version are also set, they must resolve to the same catalog entry.
	NvidiaVersionID string `json:"nvidia_version_id" api:"required"`
	// Region to create the GPU cluster in. Usable regions can be found from
	// `client.clusters.list_regions()`
	Region string `json:"region" api:"required"`
	// Whether to enable auto-scaling for the cluster. If true, the cluster will
	// automatically scale the number of GPU worker nodes between num_gpus and
	// auto_scale_max_gpus based on the workload.
	AutoScale param.Opt[bool] `json:"auto_scale,omitzero"`
	// Maximum number of GPUs to which the cluster can be auto-scaled up.
	AutoScaleMaxGPUs param.Opt[int64] `json:"auto_scale_max_gpus,omitzero"`
	// ID of the capacity pool to use for the cluster. This field is optional and only
	// applicable if the cluster is created from a capacity pool.
	CapacityPoolID param.Opt[string] `json:"capacity_pool_id,omitzero"`
	// Legacy CUDA selector for this cluster. Bare semantic values such as 12.5 select
	// ubuntu-22.04; existing OS-suffixed values remain accepted for compatibility.
	// Must be paired with nvidia_driver_version. Prefer nvidia_version_id for new
	// integrations.
	CudaVersion param.Opt[string] `json:"cuda_version,omitzero"`
	// Duration in days to keep the cluster running.
	DurationDays param.Opt[int64] `json:"duration_days,omitzero"`
	// Whether to install Traefik ingress controller in the cluster. This field is only
	// applicable for Kubernetes clusters and is false by default.
	InstallTraefik param.Opt[bool] `json:"install_traefik,omitzero"`
	// Number of GPUs to allocate from the capacity pool. Must be a multiple of 8 and
	// not exceed num_gpus.
	NumCapacityPoolGPUs param.Opt[int64] `json:"num_capacity_pool_gpus,omitzero"`
	// Number of preemptible GPUs to request alongside on-demand capacity. Must be a
	// multiple of 8. Preemptible nodes are cheaper but may be reclaimed when on-demand
	// capacity is needed elsewhere; the system fulfills this asynchronously and
	// surfaces the actual count in allocated_preemptible_gpus.
	NumPreemptibleGPUs param.Opt[int64] `json:"num_preemptible_gpus,omitzero"`
	// Number of prepaid (PLG) reserved GPUs for this cluster. When omitted for
	// RESERVED billing on create, the server defaults this to num_gpus.
	NumReservedGPUs param.Opt[int64] `json:"num_reserved_gpus,omitzero"`
	// Legacy NVIDIA driver selector for this cluster. For example, 550. Must be paired
	// with cuda_version. Prefer nvidia_version_id for new integrations.
	NvidiaDriverVersion param.Opt[string] `json:"nvidia_driver_version,omitzero"`
	// Project ID for the cluster. If not set, the project from the request context is
	// used.
	ProjectID param.Opt[string] `json:"project_id,omitzero"`
	// Reservation end time of the cluster. This field is required for SCHEDULED
	// billing to specify the reservation end time for the cluster.
	ReservationEndTime param.Opt[time.Time] `json:"reservation_end_time,omitzero" format:"date-time"`
	// Reservation start time of the cluster. This field is required for SCHEDULED
	// billing to specify the reservation start time for the cluster. If not provided,
	// the cluster provisions immediately.
	ReservationStartTime param.Opt[time.Time] `json:"reservation_start_time,omitzero" format:"date-time"`
	// Custom Slurm image for Slurm clusters.
	SlurmImage param.Opt[string] `json:"slurm_image,omitzero"`
	// Shared memory size in GiB for Slurm cluster. This field is required if
	// cluster_type is SLURM.
	SlurmShmSizeGib param.Opt[int64] `json:"slurm_shm_size_gib,omitzero"`
	// ID of an existing volume to use with the cluster creation.
	VolumeID param.Opt[string] `json:"volume_id,omitzero"`
	// AcceptanceTestsParams groups all GPU acceptance test options when enabled is
	// true.
	AcceptanceTestsParams ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAcceptanceTestsParams `json:"acceptance_tests_params,omitzero"`
	// Add-ons to enable on the cluster at creation time.
	AddOns        []ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOn       `json:"add_ons,omitzero"`
	ClusterConfig ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfig `json:"cluster_config,omitzero"`
	// Type of cluster to create.
	//
	// Any of "KUBERNETES", "SLURM".
	ClusterType string                                                             `json:"cluster_type,omitzero"`
	OidcConfig  ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionOidcConfig `json:"oidc_config,omitzero"`
	// Inline configuration to create a shared volume with the cluster creation.
	SharedVolume ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionSharedVolume `json:"shared_volume,omitzero"`
	// contains filtered or unexported fields
}

Create a cluster with a canonical NVIDIA version id. Do not also set cuda_version or nvidia_driver_version.

The properties BillingType, ClusterName, GPUType, NumGPUs, NvidiaVersionID, Region are required.

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersion) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersion) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAcceptanceTestsParams added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAcceptanceTestsParams struct {
	// Skip DCGM diagnostics acceptance test.
	DcgmDiagSkipped param.Opt[bool] `json:"dcgm_diag_skipped,omitzero"`
	// Whether to run GPU acceptance tests during cluster bring-up.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// GPU burn duration in seconds; 0 means use the default when enabled.
	GPUBurnDuration param.Opt[int64] `json:"gpu_burn_duration,omitzero"`
	// Skip GPU burn acceptance test.
	GPUBurnSkipped param.Opt[bool] `json:"gpu_burn_skipped,omitzero"`
	// Skip NCCL multi-node acceptance test.
	NcclMultiNodeSkipped param.Opt[bool] `json:"nccl_multi_node_skipped,omitzero"`
	// Skip NCCL single-node acceptance test.
	NcclSingleNodeSkipped param.Opt[bool] `json:"nccl_single_node_skipped,omitzero"`
	// Skip storage-performance acceptance test.
	StorageSkipped param.Opt[bool] `json:"storage_skipped,omitzero"`
	// DCGM diagnostic depth. SHORT = readiness; MEDIUM = default; LONG = system
	// validation; EXTENDED = memtest. An omitted value selects MEDIUM when enabled.
	//
	// Any of "DCGM_DIAG_LEVEL_SHORT", "DCGM_DIAG_LEVEL_MEDIUM",
	// "DCGM_DIAG_LEVEL_LONG", "DCGM_DIAG_LEVEL_EXTENDED".
	DcgmDiagLevel string `json:"dcgm_diag_level,omitzero"`
	// contains filtered or unexported fields
}

AcceptanceTestsParams groups all GPU acceptance test options when enabled is true.

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAcceptanceTestsParams) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAcceptanceTestsParams) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOn added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOn struct {
	// Type of add-on. Valid values: 'dashboard', 'ingress', 'torchpass'.
	AddOnType string `json:"add_on_type" api:"required"`
	// Human-readable name for this add-on instance.
	Name string `json:"name" api:"required"`
	// Configuration for a cluster add-on.
	Config ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfig `json:"config,omitzero"`
	// contains filtered or unexported fields
}

The properties AddOnType, Name are required.

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOn) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOn) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfig added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfig struct {
	Dashboard ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigDashboard `json:"dashboard,omitzero"`
	// Configuration for the Headlamp Kubernetes dashboard add-on.
	Headlamp ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigHeadlamp `json:"headlamp,omitzero"`
	Ingress  ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigIngress  `json:"ingress,omitzero"`
	// Configuration for the Slurm Web add-on.
	SlurmWeb ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigSlurmWeb `json:"slurm_web,omitzero"`
	// Configuration for the Model Aware TorchPass add-on.
	Torchpass ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigTorchpass `json:"torchpass,omitzero"`
	// contains filtered or unexported fields
}

Configuration for a cluster add-on.

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfig) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfig) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigDashboard added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigDashboard struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigDashboard) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigDashboard) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigHeadlamp added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigHeadlamp struct {
	// Whether to enable the Headlamp Kubernetes dashboard add-on.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the Headlamp Kubernetes dashboard add-on.

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigHeadlamp) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigHeadlamp) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigIngress added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigIngress struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigIngress) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigIngress) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigSlurmWeb added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigSlurmWeb struct {
	// Whether to enable the Slurm Web add-on.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the Slurm Web add-on.

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigSlurmWeb) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigSlurmWeb) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigTorchpass added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigTorchpass struct {
	// Whether to enable the Model Aware TorchPass add-on.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the Model Aware TorchPass add-on.

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigTorchpass) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionAddOnConfigTorchpass) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfig added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfig struct {
	// Any of "NONE", "TRAEFIK", "NGINX", "ISTIO".
	LoadBalancer string `json:"load_balancer,omitzero" api:"required"`
	// NVIDIA GPU Operator chart/version for the tenant cluster (e.g. v24.6.2). When
	// omitted, a service default is applied.
	GPUOperatorVersion         param.Opt[string] `json:"gpu_operator_version,omitzero"`
	JumphostEnabled            param.Opt[bool]   `json:"jumphost_enabled,omitzero"`
	KubernetesDashboardEnabled param.Opt[bool]   `json:"kubernetes_dashboard_enabled,omitzero"`
	// NVIDIA Network Operator chart/version for the tenant cluster (e.g. v24.7.0).
	// When omitted, a service default is applied.
	NetworkOperatorVersion param.Opt[string] `json:"network_operator_version,omitzero"`
	// Whether this cluster uses a per-cluster SSH certificate authority for
	// OIDC-signed SSH access.
	SSHCaEnabled  param.Opt[bool]                                                                    `json:"ssh_ca_enabled,omitzero"`
	Ingress       ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigIngress       `json:"ingress,omitzero"`
	Observability ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigObservability `json:"observability,omitzero"`
	// SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog,
	// init, extra conf).
	SlurmStartupScripts ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigSlurmStartupScripts `json:"slurm_startup_scripts,omitzero"`
	// contains filtered or unexported fields
}

The property LoadBalancer is required.

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfig) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfig) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigIngress added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigIngress struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigIngress) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigIngress) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigObservability added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigObservability struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigObservability) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigObservability) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigSlurmStartupScripts added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigSlurmStartupScripts struct {
	// Slurm controller epilog script.
	ControllerEpilog param.Opt[string] `json:"controller_epilog,omitzero"`
	// Slurm controller prolog script.
	ControllerProlog param.Opt[string] `json:"controller_prolog,omitzero"`
	// Additional slurm.conf fragments.
	ExtraSlurmConf param.Opt[string] `json:"extra_slurm_conf,omitzero"`
	// Script run on Slurm login node init.
	LoginInitScript param.Opt[string] `json:"login_init_script,omitzero"`
	// Script run on Slurm nodeset init.
	NodesetInitScript param.Opt[string] `json:"nodeset_init_script,omitzero"`
	// Slurm worker node epilog script.
	WorkerEpilog param.Opt[string] `json:"worker_epilog,omitzero"`
	// Slurm worker node prolog script.
	WorkerProlog param.Opt[string] `json:"worker_prolog,omitzero"`
	// contains filtered or unexported fields
}

SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog, init, extra conf).

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigSlurmStartupScripts) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionClusterConfigSlurmStartupScripts) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionOidcConfig added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionOidcConfig struct {
	// OIDC client ID for authentication.
	ClientID string `json:"client_id" api:"required"`
	// JWT claim to use for user groups. For example, 'groups'
	GroupClaim string `json:"group_claim" api:"required"`
	// Prefix to add to the group claim to form the final group name. For example,
	// 'oidc:'
	GroupPrefix string `json:"group_prefix" api:"required"`
	// OIDC issuer URL for authentication. For example, https://accounts.google.com
	IssuerURL string `json:"issuer_url" api:"required"`
	// JWT claim to use as the username. For example, 'sub' or 'email'
	UsernameClaim string `json:"username_claim" api:"required"`
	// Prefix to add to the username claim to form the final username. For example,
	// 'oidc:'
	UsernamePrefix string `json:"username_prefix" api:"required"`
	// CA certificate in PEM format to validate the OIDC issuer's TLS certificate. This
	// field is optional but recommended if the issuer uses a private CA or self-signed
	// certificate.
	CaCert param.Opt[string] `json:"ca_cert,omitzero"`
	// contains filtered or unexported fields
}

The properties ClientID, GroupClaim, GroupPrefix, IssuerURL, UsernameClaim, UsernamePrefix are required.

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionOidcConfig) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionOidcConfig) UnmarshalJSON added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionSharedVolume added in v0.13.0

type ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionSharedVolume struct {
	// Region name. Usable regions can be found from `clusters.list_regions()`
	Region string `json:"region" api:"required"`
	// Volume size in whole tebibytes (TiB).
	SizeTib int64 `json:"size_tib" api:"required"`
	// User provided name of the volume.
	VolumeName string `json:"volume_name" api:"required"`
	// Cluster ID to place the volume on the same infrastructure as that GPU cluster.
	InstanceClusterID param.Opt[string] `json:"instance_cluster_id,omitzero"`
	// When true, the shared volume is not deleted when the cluster is decommissioned.
	IsLifecycleIndependent param.Opt[bool] `json:"is_lifecycle_independent,omitzero"`
	// Project ID that will own the volume. When omitted, the caller's default project
	// is used.
	ProjectID param.Opt[string] `json:"project_id,omitzero"`
	// contains filtered or unexported fields
}

Inline configuration to create a shared volume with the cluster creation.

The properties Region, SizeTib, VolumeName are required.

func (ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionSharedVolume) MarshalJSON added in v0.13.0

func (*ClusterNewParamsBodyGPUClusterCreateRequestNvidiaVersionSharedVolume) UnmarshalJSON added in v0.13.0

type ClusterNodeLifecycleEvent added in v0.11.0

type ClusterNodeLifecycleEvent struct {
	// Human-readable lifecycle event message.
	Message string `json:"message" api:"required"`
	// Tenant node name this lifecycle event applies to.
	NodeID string `json:"node_id" api:"required"`
	// Lifecycle event reason, for example TogetherScaledUp, TogetherScaledDown, or
	// TogetherPreempted.
	Reason string `json:"reason" api:"required"`
	// Event timestamp.
	Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		NodeID      respjson.Field
		Reason      respjson.Field
		Timestamp   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Node lifecycle event included in a GPU cluster timeline.

func (ClusterNodeLifecycleEvent) RawJSON added in v0.11.0

func (r ClusterNodeLifecycleEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterNodeLifecycleEvent) UnmarshalJSON added in v0.11.0

func (r *ClusterNodeLifecycleEvent) UnmarshalJSON(data []byte) error

type ClusterOidcConfig added in v0.10.0

type ClusterOidcConfig struct {
	// OIDC client ID for authentication.
	ClientID string `json:"client_id" api:"required"`
	// JWT claim to use for user groups. For example, 'groups'
	GroupClaim string `json:"group_claim" api:"required"`
	// Prefix to add to the group claim to form the final group name. For example,
	// 'oidc:'
	GroupPrefix string `json:"group_prefix" api:"required"`
	// OIDC issuer URL for authentication. For example, https://accounts.google.com
	IssuerURL string `json:"issuer_url" api:"required"`
	// JWT claim to use as the username. For example, 'sub' or 'email'
	UsernameClaim string `json:"username_claim" api:"required"`
	// Prefix to add to the username claim to form the final username. For example,
	// 'oidc:'
	UsernamePrefix string `json:"username_prefix" api:"required"`
	// CA certificate in PEM format to validate the OIDC issuer's TLS certificate. This
	// field is optional but recommended if the issuer uses a private CA or self-signed
	// certificate.
	CaCert string `json:"ca_cert"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClientID       respjson.Field
		GroupClaim     respjson.Field
		GroupPrefix    respjson.Field
		IssuerURL      respjson.Field
		UsernameClaim  respjson.Field
		UsernamePrefix respjson.Field
		CaCert         respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterOidcConfig) RawJSON added in v0.10.0

func (r ClusterOidcConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterOidcConfig) UnmarshalJSON added in v0.10.0

func (r *ClusterOidcConfig) UnmarshalJSON(data []byte) error

type ClusterPhaseTransition added in v0.10.0

type ClusterPhaseTransition struct {
	// Cluster phase.
	//
	// Any of "CLUSTER_PHASE_QUEUED", "CLUSTER_PHASE_SCHEDULED",
	// "CLUSTER_PHASE_WAITING_FOR_CONTROL_PLANE_NODES",
	// "CLUSTER_PHASE_WAITING_FOR_DATA_PLANE_NODES",
	// "CLUSTER_PHASE_WAITING_FOR_SUBNET", "CLUSTER_PHASE_WAITING_FOR_SHARED_VOLUME",
	// "CLUSTER_PHASE_WAITING_FOR_AUTO_SCALER", "CLUSTER_PHASE_INSTALLING_DRIVERS",
	// "CLUSTER_PHASE_RUNNING_ACCEPTANCE_TESTS",
	// "CLUSTER_PHASE_ACCEPTANCE_TESTS_FAILED", "CLUSTER_PHASE_RUNNING_NCCL_TESTS",
	// "CLUSTER_PHASE_NCCL_TESTS_FAILED", "CLUSTER_PHASE_READY",
	// "CLUSTER_PHASE_PAUSED", "CLUSTER_PHASE_ON_DEMAND_COMPUTE_PAUSED",
	// "CLUSTER_PHASE_DEGRADED", "CLUSTER_PHASE_DELETING".
	Phase string `json:"phase" api:"required"`
	// Timestamp when the phase transition occurred.
	TransitionTime time.Time `json:"transition_time" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Phase          respjson.Field
		TransitionTime respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterPhaseTransition) RawJSON added in v0.10.0

func (r ClusterPhaseTransition) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterPhaseTransition) UnmarshalJSON added in v0.10.0

func (r *ClusterPhaseTransition) UnmarshalJSON(data []byte) error

type ClusterRemediationApproveParams added in v0.13.0

type ClusterRemediationApproveParams struct {
	ClusterID  string `path:"cluster_id" api:"required" json:"-"`
	InstanceID string `path:"instance_id" api:"required" json:"-"`
	// Approval comment explaining the decision.
	Comment param.Opt[string] `json:"comment,omitzero"`
	// Remediation mode to use after approval. When omitted, the remediation keeps its
	// existing mode.
	//
	// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any
	//   available host.
	// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and
	//   provisions a new one on a different host.
	// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without
	//   provisioning a replacement.
	// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
	// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Power-cycles the bare-metal host after
	//   cordoning it. This mode cannot be set as an approval override; create a host
	//   power-cycle remediation directly.
	//
	// Any of "REMEDIATION_MODE_VM_ONLY", "REMEDIATION_MODE_HOST_AWARE",
	// "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", "REMEDIATION_MODE_REBOOT_VM",
	// "REMEDIATION_MODE_HOST_POWER_CYCLE".
	Mode ClusterRemediationApproveParamsMode `json:"mode,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterRemediationApproveParams) MarshalJSON added in v0.13.0

func (r ClusterRemediationApproveParams) MarshalJSON() (data []byte, err error)

func (*ClusterRemediationApproveParams) UnmarshalJSON added in v0.13.0

func (r *ClusterRemediationApproveParams) UnmarshalJSON(data []byte) error

type ClusterRemediationApproveParamsMode added in v0.13.0

type ClusterRemediationApproveParamsMode string

Remediation mode to use after approval. When omitted, the remediation keeps its existing mode.

  • `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
  • `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
  • `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
  • `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
  • `REMEDIATION_MODE_HOST_POWER_CYCLE`: Power-cycles the bare-metal host after cordoning it. This mode cannot be set as an approval override; create a host power-cycle remediation directly.
const (
	ClusterRemediationApproveParamsModeRemediationModeVmOnly                  ClusterRemediationApproveParamsMode = "REMEDIATION_MODE_VM_ONLY"
	ClusterRemediationApproveParamsModeRemediationModeHostAware               ClusterRemediationApproveParamsMode = "REMEDIATION_MODE_HOST_AWARE"
	ClusterRemediationApproveParamsModeRemediationModeEvictWithoutReplacement ClusterRemediationApproveParamsMode = "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT"
	ClusterRemediationApproveParamsModeRemediationModeRebootVm                ClusterRemediationApproveParamsMode = "REMEDIATION_MODE_REBOOT_VM"
	ClusterRemediationApproveParamsModeRemediationModeHostPowerCycle          ClusterRemediationApproveParamsMode = "REMEDIATION_MODE_HOST_POWER_CYCLE"
)

type ClusterRemediationCancelParams added in v0.13.0

type ClusterRemediationCancelParams struct {
	// The cluster ID.
	ClusterID string `path:"cluster_id" api:"required" json:"-"`
	// The instance ID.
	InstanceID string `path:"instance_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type ClusterRemediationGetParams added in v0.13.0

type ClusterRemediationGetParams struct {
	ClusterID  string `path:"cluster_id" api:"required" json:"-"`
	InstanceID string `path:"instance_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type ClusterRemediationListParams added in v0.13.0

type ClusterRemediationListParams struct {
	ClusterID string `path:"cluster_id" api:"required" json:"-"`
	// Order by expression.
	OrderBy param.Opt[string] `query:"order_by,omitzero" json:"-"`
	// Maximum results to return.
	PageSize param.Opt[int64] `query:"page_size,omitzero" json:"-"`
	// Pagination token from previous request.
	PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
	// Filter by remediation mode(s). Returns remediations matching any of the
	// specified modes.
	//
	// Any of "REMEDIATION_MODE_VM_ONLY", "REMEDIATION_MODE_HOST_AWARE",
	// "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", "REMEDIATION_MODE_REBOOT_VM",
	// "REMEDIATION_MODE_HOST_POWER_CYCLE".
	Mode []string `query:"mode,omitzero" json:"-"`
	// Filter by state(s). Returns remediations matching any of the specified states.
	//
	// - `PENDING_APPROVAL`: Awaiting approval before processing can begin.
	// - `PENDING`: Approved and queued for processing.
	// - `RUNNING`: Actively being processed.
	// - `SUCCEEDED`: Successfully completed.
	// - `FAILED`: Failed with an error.
	// - `CANCELLED`: Cancelled by user or system.
	// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before
	//   processing.
	// - `QUARANTINING`: Cordoning or preparing the host before remediation.
	// - `QUARANTINED`: Host has been cordoned or isolated for remediation.
	//
	// Any of "PENDING_APPROVAL", "PENDING", "RUNNING", "SUCCEEDED", "FAILED",
	// "CANCELLED", "AUTO_RESOLVED", "QUARANTINING", "QUARANTINED".
	State []string `query:"state,omitzero" json:"-"`
	// Filter by trigger type(s). Returns remediations matching any of the specified
	// triggers.
	//
	// Any of "REMEDIATION_TRIGGER_MANUAL", "REMEDIATION_TRIGGER_AUTOMATED".
	Trigger []string `query:"trigger,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ClusterRemediationListParams) URLQuery added in v0.13.0

func (r ClusterRemediationListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ClusterRemediationListParams's query parameters as `url.Values`.

type ClusterRemediationListResponse added in v0.13.0

type ClusterRemediationListResponse struct {
	// Indicates if there are more results available.
	HasNext bool `json:"has_next" api:"required"`
	// Token for the next page.
	NextPageToken string `json:"next_page_token" api:"required"`
	// The list of remediations.
	Remediations []Remediation `json:"remediations" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HasNext       respjson.Field
		NextPageToken respjson.Field
		Remediations  respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ListRemediationsResponse is the response for ListRemediations.

func (ClusterRemediationListResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ClusterRemediationListResponse) UnmarshalJSON added in v0.13.0

func (r *ClusterRemediationListResponse) UnmarshalJSON(data []byte) error

type ClusterRemediationNewParams added in v0.13.0

type ClusterRemediationNewParams struct {
	ClusterID string `path:"cluster_id" api:"required" json:"-"`
	// Remediation represents a node remediation request for an instance. An instance
	// can have multiple remediations over time (e.g., failed attempts followed by
	// retries).
	Remediation RemediationParam
	// contains filtered or unexported fields
}

func (ClusterRemediationNewParams) MarshalJSON added in v0.13.0

func (r ClusterRemediationNewParams) MarshalJSON() (data []byte, err error)

func (*ClusterRemediationNewParams) UnmarshalJSON added in v0.13.0

func (r *ClusterRemediationNewParams) UnmarshalJSON(data []byte) error

type ClusterRemediationRejectParams added in v0.13.0

type ClusterRemediationRejectParams struct {
	ClusterID  string `path:"cluster_id" api:"required" json:"-"`
	InstanceID string `path:"instance_id" api:"required" json:"-"`
	// Comment explaining the action.
	Comment param.Opt[string] `json:"comment,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterRemediationRejectParams) MarshalJSON added in v0.13.0

func (r ClusterRemediationRejectParams) MarshalJSON() (data []byte, err error)

func (*ClusterRemediationRejectParams) UnmarshalJSON added in v0.13.0

func (r *ClusterRemediationRejectParams) UnmarshalJSON(data []byte) error

type ClusterRemediationService added in v0.13.0

type ClusterRemediationService struct {
	Options []option.RequestOption
}

ClusterRemediationService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClusterRemediationService method instead.

func NewClusterRemediationService added in v0.13.0

func NewClusterRemediationService(opts ...option.RequestOption) (r ClusterRemediationService)

NewClusterRemediationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ClusterRemediationService) Approve added in v0.13.0

func (r *ClusterRemediationService) Approve(ctx context.Context, remediationID string, params ClusterRemediationApproveParams, opts ...option.RequestOption) (res *Remediation, err error)

Approves a pending remediation.

Only remediations with state PENDING_APPROVAL can be approved.

On APPROVE: state changes to PENDING and the remediation process begins. The reviewed_by, review_time, and review_comment fields are populated on the remediation after approval.

func (*ClusterRemediationService) Cancel added in v0.13.0

func (r *ClusterRemediationService) Cancel(ctx context.Context, remediationID string, body ClusterRemediationCancelParams, opts ...option.RequestOption) (res *Remediation, err error)

Cancels a pending remediation.

Only remediations in PENDING_APPROVAL or PENDING state can be cancelled.

func (*ClusterRemediationService) Get added in v0.13.0

func (r *ClusterRemediationService) Get(ctx context.Context, remediationID string, query ClusterRemediationGetParams, opts ...option.RequestOption) (res *Remediation, err error)

Retrieve the status of a specific remdiation on a specific instance in a specific cluster.

func (*ClusterRemediationService) List added in v0.13.0

Lists remediations for an instance or cluster.

func (*ClusterRemediationService) New added in v0.13.0

Creates a new remediation for an instance.

Remediations created via the API goes directly to PENDING state.

Our system may trigger automated remediations that require approval. These remediations are created with PENDING_APPROVAL state. The user must call /approve to start the actual remediation process. These operations can also be rejected by calling /reject.

func (*ClusterRemediationService) Reject added in v0.13.0

func (r *ClusterRemediationService) Reject(ctx context.Context, remediationID string, params ClusterRemediationRejectParams, opts ...option.RequestOption) (res *Remediation, err error)

Rejects a pending remediation.

Only remediations with state PENDING_APPROVAL can be rejected.

On REJECT: state changes to CANCELLED. The reviewed_by, review_time, and review_comment fields are populated on the remediation after rejection.

type ClusterService added in v0.13.0

type ClusterService struct {
	Options      []option.RequestOption
	Remediations ClusterRemediationService
	Storage      ClusterStorageService
}

ClusterService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClusterService method instead.

func NewClusterService added in v0.13.0

func NewClusterService(opts ...option.RequestOption) (r ClusterService)

NewClusterService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ClusterService) Delete added in v0.13.0

func (r *ClusterService) Delete(ctx context.Context, clusterID string, opts ...option.RequestOption) (res *ClusterDeleteResponse, err error)

Delete a GPU cluster by cluster ID.

func (*ClusterService) Get added in v0.13.0

func (r *ClusterService) Get(ctx context.Context, clusterID string, opts ...option.RequestOption) (res *Cluster, err error)

Retrieve information about a specific GPU cluster.

func (*ClusterService) List added in v0.13.0

List all GPU clusters.

func (*ClusterService) ListRegions added in v0.13.0

func (r *ClusterService) ListRegions(ctx context.Context, opts ...option.RequestOption) (res *ClusterListRegionsResponse, err error)

List regions and corresponding supported driver versions

func (*ClusterService) New added in v0.13.0

func (r *ClusterService) New(ctx context.Context, body ClusterNewParams, opts ...option.RequestOption) (res *Cluster, err error)

Create an Instant Cluster on Together's high-performance GPU clusters. With features like on-demand scaling, long-lived resizable high-bandwidth shared DC-local storage, Kubernetes and Slurm cluster flavors, a REST API, and Terraform support, you can run workloads flexibly without complex infrastructure management.

func (*ClusterService) Update added in v0.13.0

func (r *ClusterService) Update(ctx context.Context, clusterID string, body ClusterUpdateParams, opts ...option.RequestOption) (res *Cluster, err error)

Update the configuration of an existing GPU cluster.

type ClusterStatus added in v0.4.0

type ClusterStatus string

Current status of the GPU cluster.

const (
	ClusterStatusWaitingForControlPlaneNodes ClusterStatus = "WaitingForControlPlaneNodes"
	ClusterStatusWaitingForDataPlaneNodes    ClusterStatus = "WaitingForDataPlaneNodes"
	ClusterStatusWaitingForSubnet            ClusterStatus = "WaitingForSubnet"
	ClusterStatusWaitingForSharedVolume      ClusterStatus = "WaitingForSharedVolume"
	ClusterStatusInstallingDrivers           ClusterStatus = "InstallingDrivers"
	ClusterStatusRunningAcceptanceTests      ClusterStatus = "RunningAcceptanceTests"
	ClusterStatusPaused                      ClusterStatus = "Paused"
	ClusterStatusOnDemandComputePaused       ClusterStatus = "OnDemandComputePaused"
	ClusterStatusReady                       ClusterStatus = "Ready"
	ClusterStatusDegraded                    ClusterStatus = "Degraded"
	ClusterStatusDeleting                    ClusterStatus = "Deleting"
)

type ClusterStorage added in v0.4.0

type ClusterStorage struct {
	// Size of the volume in TiB.
	SizeTib int64 `json:"size_tib" api:"required"`
	// Current status of the shared volume.
	//
	// Any of "scheduled", "available", "bound", "provisioning", "deleting", "failed",
	// "access_revoked", "unknown".
	Status ClusterStorageStatus `json:"status" api:"required"`
	// ID of the volume.
	VolumeID string `json:"volume_id" api:"required"`
	// User provided name of the volume.
	VolumeName string `json:"volume_name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		SizeTib     respjson.Field
		Status      respjson.Field
		VolumeID    respjson.Field
		VolumeName  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterStorage) RawJSON added in v0.4.0

func (r ClusterStorage) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterStorage) UnmarshalJSON added in v0.4.0

func (r *ClusterStorage) UnmarshalJSON(data []byte) error

type ClusterStorageDeleteResponse added in v0.13.0

type ClusterStorageDeleteResponse struct {
	Success bool `json:"success" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterStorageDeleteResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ClusterStorageDeleteResponse) UnmarshalJSON added in v0.13.0

func (r *ClusterStorageDeleteResponse) UnmarshalJSON(data []byte) error

type ClusterStorageListParams added in v0.13.0

type ClusterStorageListParams struct {
	// Optional UMS project ID to filter volumes by. When set, only volumes belonging
	// to this project are returned. The caller must be a member of the project;
	// otherwise the result set will be empty.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `query:"projectId,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ClusterStorageListParams) URLQuery added in v0.13.0

func (r ClusterStorageListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ClusterStorageListParams's query parameters as `url.Values`.

type ClusterStorageListResponse added in v0.13.0

type ClusterStorageListResponse struct {
	Volumes []ClusterStorage `json:"volumes" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Volumes     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterStorageListResponse) RawJSON added in v0.13.0

func (r ClusterStorageListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterStorageListResponse) UnmarshalJSON added in v0.13.0

func (r *ClusterStorageListResponse) UnmarshalJSON(data []byte) error

type ClusterStorageNewParams added in v0.13.0

type ClusterStorageNewParams struct {
	// Region name. Usable regions can be found from `clusters.list_regions()`
	Region string `json:"region" api:"required"`
	// Volume size in whole tebibytes (TiB).
	SizeTib int64 `json:"size_tib" api:"required"`
	// User provided name of the volume.
	VolumeName string `json:"volume_name" api:"required"`
	// Cluster ID to place the volume on the same infrastructure as that GPU cluster.
	InstanceClusterID param.Opt[string] `json:"instance_cluster_id,omitzero"`
	// When true, the shared volume is not deleted when the cluster is decommissioned.
	IsLifecycleIndependent param.Opt[bool] `json:"is_lifecycle_independent,omitzero"`
	// Project ID that will own the volume. When omitted, the caller's default project
	// is used.
	ProjectID param.Opt[string] `json:"project_id,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterStorageNewParams) MarshalJSON added in v0.13.0

func (r ClusterStorageNewParams) MarshalJSON() (data []byte, err error)

func (*ClusterStorageNewParams) UnmarshalJSON added in v0.13.0

func (r *ClusterStorageNewParams) UnmarshalJSON(data []byte) error

type ClusterStorageService added in v0.13.0

type ClusterStorageService struct {
	Options []option.RequestOption
}

ClusterStorageService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClusterStorageService method instead.

func NewClusterStorageService added in v0.13.0

func NewClusterStorageService(opts ...option.RequestOption) (r ClusterStorageService)

NewClusterStorageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ClusterStorageService) Delete added in v0.13.0

func (r *ClusterStorageService) Delete(ctx context.Context, volumeID string, opts ...option.RequestOption) (res *ClusterStorageDeleteResponse, err error)

Delete a shared volume. Note that if this volume is attached to a cluster, deleting will fail.

func (*ClusterStorageService) Get added in v0.13.0

func (r *ClusterStorageService) Get(ctx context.Context, volumeID string, opts ...option.RequestOption) (res *ClusterStorage, err error)

Retrieve information about a specific shared volume.

func (*ClusterStorageService) List added in v0.13.0

List all shared volumes.

func (*ClusterStorageService) New added in v0.13.0

Instant Clusters supports long-lived, resizable in-DC shared storage with user data persistence. You can dynamically create and attach volumes to your cluster at cluster creation time, and resize as your data grows. All shared storage is backed by multi-NIC bare metal paths, ensuring high-throughput and low-latency performance for shared storage.

func (*ClusterStorageService) Update added in v0.13.0

Update the configuration of an existing shared volume.

type ClusterStorageStatus added in v0.5.0

type ClusterStorageStatus string

Current status of the shared volume.

const (
	ClusterStorageStatusScheduled     ClusterStorageStatus = "scheduled"
	ClusterStorageStatusAvailable     ClusterStorageStatus = "available"
	ClusterStorageStatusBound         ClusterStorageStatus = "bound"
	ClusterStorageStatusProvisioning  ClusterStorageStatus = "provisioning"
	ClusterStorageStatusDeleting      ClusterStorageStatus = "deleting"
	ClusterStorageStatusFailed        ClusterStorageStatus = "failed"
	ClusterStorageStatusAccessRevoked ClusterStorageStatus = "access_revoked"
	ClusterStorageStatusUnknown       ClusterStorageStatus = "unknown"
)

type ClusterStorageUpdateParams added in v0.13.0

type ClusterStorageUpdateParams struct {
	// ID of the volume.
	VolumeID string `json:"volume_id" api:"required"`
	// Size of the volume in TiB.
	SizeTib param.Opt[int64] `json:"size_tib,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterStorageUpdateParams) MarshalJSON added in v0.13.0

func (r ClusterStorageUpdateParams) MarshalJSON() (data []byte, err error)

func (*ClusterStorageUpdateParams) UnmarshalJSON added in v0.13.0

func (r *ClusterStorageUpdateParams) UnmarshalJSON(data []byte) error

type ClusterUpdateParams added in v0.13.0

type ClusterUpdateParams struct {
	// Number of GPUs to draw from the cluster's capacity pool. Only valid for clusters
	// created with a capacity_pool_id. Must be a multiple of 8 and not exceed
	// num_gpus. When omitted, the current value is preserved.
	NumCapacityPoolGPUs param.Opt[int64] `json:"num_capacity_pool_gpus,omitzero"`
	// Target GPU count for the cluster. When omitted, the server keeps the current GPU
	// count from cluster metadata (use for config-only or decommission-time-only
	// updates).
	NumGPUs param.Opt[int64] `json:"num_gpus,omitzero"`
	// Updated desired number of preemptible GPUs for the cluster. When omitted, the
	// current value is preserved. Must be a multiple of 8.
	NumPreemptibleGPUs param.Opt[int64] `json:"num_preemptible_gpus,omitzero"`
	// Number of reserved GPUs to update to. This field is only applicable for clusters
	// with RESERVED billing type.
	NumReservedGPUs param.Opt[int64] `json:"num_reserved_gpus,omitzero"`
	// Timestamp at which the cluster should be decommissioned. Only accepted for
	// prepaid clusters.
	ReservationEndTime param.Opt[time.Time] `json:"reservation_end_time,omitzero" format:"date-time"`
	// Add-ons to update on the cluster. Each entry identifies an existing add-on by
	// name and provides the new external config to merge.
	AddOns        []ClusterUpdateParamsAddOn       `json:"add_ons,omitzero"`
	ClusterConfig ClusterUpdateParamsClusterConfig `json:"cluster_config,omitzero"`
	// Type of cluster to update.
	//
	// Any of "KUBERNETES", "SLURM".
	ClusterType ClusterUpdateParamsClusterType `json:"cluster_type,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterUpdateParams) MarshalJSON added in v0.13.0

func (r ClusterUpdateParams) MarshalJSON() (data []byte, err error)

func (*ClusterUpdateParams) UnmarshalJSON added in v0.13.0

func (r *ClusterUpdateParams) UnmarshalJSON(data []byte) error

type ClusterUpdateParamsAddOn added in v0.13.0

type ClusterUpdateParamsAddOn struct {
	// Name of the add-on to update. Must match an existing add-on on the cluster.
	Name string `json:"name" api:"required"`
	// Configuration for a cluster add-on.
	Config ClusterUpdateParamsAddOnConfig `json:"config,omitzero"`
	// contains filtered or unexported fields
}

The property Name is required.

func (ClusterUpdateParamsAddOn) MarshalJSON added in v0.13.0

func (r ClusterUpdateParamsAddOn) MarshalJSON() (data []byte, err error)

func (*ClusterUpdateParamsAddOn) UnmarshalJSON added in v0.13.0

func (r *ClusterUpdateParamsAddOn) UnmarshalJSON(data []byte) error

type ClusterUpdateParamsAddOnConfig added in v0.13.0

type ClusterUpdateParamsAddOnConfig struct {
	Dashboard ClusterUpdateParamsAddOnConfigDashboard `json:"dashboard,omitzero"`
	// Configuration for the Headlamp Kubernetes dashboard add-on.
	Headlamp ClusterUpdateParamsAddOnConfigHeadlamp `json:"headlamp,omitzero"`
	Ingress  ClusterUpdateParamsAddOnConfigIngress  `json:"ingress,omitzero"`
	// Configuration for the Slurm Web add-on.
	SlurmWeb ClusterUpdateParamsAddOnConfigSlurmWeb `json:"slurm_web,omitzero"`
	// Configuration for the Model Aware TorchPass add-on.
	Torchpass ClusterUpdateParamsAddOnConfigTorchpass `json:"torchpass,omitzero"`
	// contains filtered or unexported fields
}

Configuration for a cluster add-on.

func (ClusterUpdateParamsAddOnConfig) MarshalJSON added in v0.13.0

func (r ClusterUpdateParamsAddOnConfig) MarshalJSON() (data []byte, err error)

func (*ClusterUpdateParamsAddOnConfig) UnmarshalJSON added in v0.13.0

func (r *ClusterUpdateParamsAddOnConfig) UnmarshalJSON(data []byte) error

type ClusterUpdateParamsAddOnConfigDashboard added in v0.13.0

type ClusterUpdateParamsAddOnConfigDashboard struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterUpdateParamsAddOnConfigDashboard) MarshalJSON added in v0.13.0

func (r ClusterUpdateParamsAddOnConfigDashboard) MarshalJSON() (data []byte, err error)

func (*ClusterUpdateParamsAddOnConfigDashboard) UnmarshalJSON added in v0.13.0

func (r *ClusterUpdateParamsAddOnConfigDashboard) UnmarshalJSON(data []byte) error

type ClusterUpdateParamsAddOnConfigHeadlamp added in v0.13.0

type ClusterUpdateParamsAddOnConfigHeadlamp struct {
	// Whether to enable the Headlamp Kubernetes dashboard add-on.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the Headlamp Kubernetes dashboard add-on.

func (ClusterUpdateParamsAddOnConfigHeadlamp) MarshalJSON added in v0.13.0

func (r ClusterUpdateParamsAddOnConfigHeadlamp) MarshalJSON() (data []byte, err error)

func (*ClusterUpdateParamsAddOnConfigHeadlamp) UnmarshalJSON added in v0.13.0

func (r *ClusterUpdateParamsAddOnConfigHeadlamp) UnmarshalJSON(data []byte) error

type ClusterUpdateParamsAddOnConfigIngress added in v0.13.0

type ClusterUpdateParamsAddOnConfigIngress struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterUpdateParamsAddOnConfigIngress) MarshalJSON added in v0.13.0

func (r ClusterUpdateParamsAddOnConfigIngress) MarshalJSON() (data []byte, err error)

func (*ClusterUpdateParamsAddOnConfigIngress) UnmarshalJSON added in v0.13.0

func (r *ClusterUpdateParamsAddOnConfigIngress) UnmarshalJSON(data []byte) error

type ClusterUpdateParamsAddOnConfigSlurmWeb added in v0.13.0

type ClusterUpdateParamsAddOnConfigSlurmWeb struct {
	// Whether to enable the Slurm Web add-on.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the Slurm Web add-on.

func (ClusterUpdateParamsAddOnConfigSlurmWeb) MarshalJSON added in v0.13.0

func (r ClusterUpdateParamsAddOnConfigSlurmWeb) MarshalJSON() (data []byte, err error)

func (*ClusterUpdateParamsAddOnConfigSlurmWeb) UnmarshalJSON added in v0.13.0

func (r *ClusterUpdateParamsAddOnConfigSlurmWeb) UnmarshalJSON(data []byte) error

type ClusterUpdateParamsAddOnConfigTorchpass added in v0.13.0

type ClusterUpdateParamsAddOnConfigTorchpass struct {
	// Whether to enable the Model Aware TorchPass add-on.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the Model Aware TorchPass add-on.

func (ClusterUpdateParamsAddOnConfigTorchpass) MarshalJSON added in v0.13.0

func (r ClusterUpdateParamsAddOnConfigTorchpass) MarshalJSON() (data []byte, err error)

func (*ClusterUpdateParamsAddOnConfigTorchpass) UnmarshalJSON added in v0.13.0

func (r *ClusterUpdateParamsAddOnConfigTorchpass) UnmarshalJSON(data []byte) error

type ClusterUpdateParamsClusterConfig added in v0.13.0

type ClusterUpdateParamsClusterConfig struct {
	// Any of "NONE", "TRAEFIK", "NGINX", "ISTIO".
	LoadBalancer string `json:"load_balancer,omitzero" api:"required"`
	// NVIDIA GPU Operator chart/version for the tenant cluster (e.g. v24.6.2). When
	// omitted, a service default is applied.
	GPUOperatorVersion         param.Opt[string] `json:"gpu_operator_version,omitzero"`
	JumphostEnabled            param.Opt[bool]   `json:"jumphost_enabled,omitzero"`
	KubernetesDashboardEnabled param.Opt[bool]   `json:"kubernetes_dashboard_enabled,omitzero"`
	// NVIDIA Network Operator chart/version for the tenant cluster (e.g. v24.7.0).
	// When omitted, a service default is applied.
	NetworkOperatorVersion param.Opt[string] `json:"network_operator_version,omitzero"`
	// Whether this cluster uses a per-cluster SSH certificate authority for
	// OIDC-signed SSH access.
	SSHCaEnabled  param.Opt[bool]                               `json:"ssh_ca_enabled,omitzero"`
	Ingress       ClusterUpdateParamsClusterConfigIngress       `json:"ingress,omitzero"`
	Observability ClusterUpdateParamsClusterConfigObservability `json:"observability,omitzero"`
	// SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog,
	// init, extra conf).
	SlurmStartupScripts ClusterUpdateParamsClusterConfigSlurmStartupScripts `json:"slurm_startup_scripts,omitzero"`
	// contains filtered or unexported fields
}

The property LoadBalancer is required.

func (ClusterUpdateParamsClusterConfig) MarshalJSON added in v0.13.0

func (r ClusterUpdateParamsClusterConfig) MarshalJSON() (data []byte, err error)

func (*ClusterUpdateParamsClusterConfig) UnmarshalJSON added in v0.13.0

func (r *ClusterUpdateParamsClusterConfig) UnmarshalJSON(data []byte) error

type ClusterUpdateParamsClusterConfigIngress added in v0.13.0

type ClusterUpdateParamsClusterConfigIngress struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterUpdateParamsClusterConfigIngress) MarshalJSON added in v0.13.0

func (r ClusterUpdateParamsClusterConfigIngress) MarshalJSON() (data []byte, err error)

func (*ClusterUpdateParamsClusterConfigIngress) UnmarshalJSON added in v0.13.0

func (r *ClusterUpdateParamsClusterConfigIngress) UnmarshalJSON(data []byte) error

type ClusterUpdateParamsClusterConfigObservability added in v0.13.0

type ClusterUpdateParamsClusterConfigObservability struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (ClusterUpdateParamsClusterConfigObservability) MarshalJSON added in v0.13.0

func (r ClusterUpdateParamsClusterConfigObservability) MarshalJSON() (data []byte, err error)

func (*ClusterUpdateParamsClusterConfigObservability) UnmarshalJSON added in v0.13.0

func (r *ClusterUpdateParamsClusterConfigObservability) UnmarshalJSON(data []byte) error

type ClusterUpdateParamsClusterConfigSlurmStartupScripts added in v0.13.0

type ClusterUpdateParamsClusterConfigSlurmStartupScripts struct {
	// Slurm controller epilog script.
	ControllerEpilog param.Opt[string] `json:"controller_epilog,omitzero"`
	// Slurm controller prolog script.
	ControllerProlog param.Opt[string] `json:"controller_prolog,omitzero"`
	// Additional slurm.conf fragments.
	ExtraSlurmConf param.Opt[string] `json:"extra_slurm_conf,omitzero"`
	// Script run on Slurm login node init.
	LoginInitScript param.Opt[string] `json:"login_init_script,omitzero"`
	// Script run on Slurm nodeset init.
	NodesetInitScript param.Opt[string] `json:"nodeset_init_script,omitzero"`
	// Slurm worker node epilog script.
	WorkerEpilog param.Opt[string] `json:"worker_epilog,omitzero"`
	// Slurm worker node prolog script.
	WorkerProlog param.Opt[string] `json:"worker_prolog,omitzero"`
	// contains filtered or unexported fields
}

SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog, init, extra conf).

func (ClusterUpdateParamsClusterConfigSlurmStartupScripts) MarshalJSON added in v0.13.0

func (r ClusterUpdateParamsClusterConfigSlurmStartupScripts) MarshalJSON() (data []byte, err error)

func (*ClusterUpdateParamsClusterConfigSlurmStartupScripts) UnmarshalJSON added in v0.13.0

type ClusterUpdateParamsClusterType added in v0.13.0

type ClusterUpdateParamsClusterType string

Type of cluster to update.

const (
	ClusterUpdateParamsClusterTypeKubernetes ClusterUpdateParamsClusterType = "KUBERNETES"
	ClusterUpdateParamsClusterTypeSlurm      ClusterUpdateParamsClusterType = "SLURM"
)

type ClusterVolume added in v0.4.0

type ClusterVolume struct {
	// Size of the volume in TiB.
	SizeTib int64 `json:"size_tib" api:"required"`
	// Current status of the volume.
	Status string `json:"status" api:"required"`
	// ID of the volume.
	VolumeID string `json:"volume_id" api:"required"`
	// User provided name of the volume.
	VolumeName string `json:"volume_name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		SizeTib     respjson.Field
		Status      respjson.Field
		VolumeID    respjson.Field
		VolumeName  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ClusterVolume) RawJSON added in v0.4.0

func (r ClusterVolume) RawJSON() string

Returns the unmodified JSON received from the API

func (*ClusterVolume) UnmarshalJSON added in v0.4.0

func (r *ClusterVolume) UnmarshalJSON(data []byte) error

type Completion

type Completion struct {
	ID      string             `json:"id" api:"required"`
	Choices []CompletionChoice `json:"choices" api:"required"`
	Created int64              `json:"created" api:"required"`
	Model   string             `json:"model" api:"required"`
	// The object type, which is always `text.completion`.
	Object constant.TextCompletion `json:"object" default:"text.completion"`
	// When `echo` is true, the prompt is included in the response. Additionally, when
	// `logprobs` is also provided, log probability information is provided on the
	// prompt.
	Prompt ChatCompletionPrompt `json:"prompt" api:"required"`
	Usage  ChatCompletionUsage  `json:"usage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Choices     respjson.Field
		Created     respjson.Field
		Model       respjson.Field
		Object      respjson.Field
		Prompt      respjson.Field
		Usage       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Completion) RawJSON

func (r Completion) RawJSON() string

Returns the unmodified JSON received from the API

func (*Completion) UnmarshalJSON

func (r *Completion) UnmarshalJSON(data []byte) error

type CompletionChoice

type CompletionChoice struct {
	// Any of "stop", "eos", "length", "tool_calls", "function_call".
	FinishReason string   `json:"finish_reason"`
	Logprobs     LogProbs `json:"logprobs"`
	Seed         int64    `json:"seed"`
	Text         string   `json:"text"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FinishReason respjson.Field
		Logprobs     respjson.Field
		Seed         respjson.Field
		Text         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CompletionChoice) RawJSON

func (r CompletionChoice) RawJSON() string

Returns the unmodified JSON received from the API

func (*CompletionChoice) UnmarshalJSON

func (r *CompletionChoice) UnmarshalJSON(data []byte) error

type CompletionChunk

type CompletionChunk struct {
	ID      string                  `json:"id" api:"required"`
	Token   CompletionChunkToken    `json:"token" api:"required"`
	Choices []CompletionChunkChoice `json:"choices" api:"required"`
	// Any of "stop", "eos", "length", "tool_calls", "function_call".
	FinishReason CompletionChunkFinishReason `json:"finish_reason" api:"required"`
	Usage        ChatCompletionUsage         `json:"usage" api:"required"`
	Created      int64                       `json:"created"`
	// The object type, which is always `completion.chunk`.
	//
	// Any of "completion.chunk".
	Object CompletionChunkObject `json:"object"`
	Seed   int64                 `json:"seed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Token        respjson.Field
		Choices      respjson.Field
		FinishReason respjson.Field
		Usage        respjson.Field
		Created      respjson.Field
		Object       respjson.Field
		Seed         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CompletionChunk) RawJSON

func (r CompletionChunk) RawJSON() string

Returns the unmodified JSON received from the API

func (*CompletionChunk) UnmarshalJSON

func (r *CompletionChunk) UnmarshalJSON(data []byte) error

type CompletionChunkChoice

type CompletionChunkChoice struct {
	Index int64                      `json:"index" api:"required"`
	Delta CompletionChunkChoiceDelta `json:"delta"`
	Text  string                     `json:"text"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Index       respjson.Field
		Delta       respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CompletionChunkChoice) RawJSON

func (r CompletionChunkChoice) RawJSON() string

Returns the unmodified JSON received from the API

func (*CompletionChunkChoice) UnmarshalJSON

func (r *CompletionChunkChoice) UnmarshalJSON(data []byte) error

type CompletionChunkChoiceDelta

type CompletionChunkChoiceDelta struct {
	// Any of "system", "user", "assistant", "function", "tool".
	Role             string       `json:"role" api:"required"`
	Content          string       `json:"content" api:"nullable"`
	Reasoning        string       `json:"reasoning" api:"nullable"`
	ReasoningContent string       `json:"reasoning_content" api:"nullable"`
	TokenID          int64        `json:"token_id"`
	ToolCalls        []ToolChoice `json:"tool_calls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Role             respjson.Field
		Content          respjson.Field
		Reasoning        respjson.Field
		ReasoningContent respjson.Field
		TokenID          respjson.Field
		ToolCalls        respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CompletionChunkChoiceDelta) RawJSON

func (r CompletionChunkChoiceDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*CompletionChunkChoiceDelta) UnmarshalJSON

func (r *CompletionChunkChoiceDelta) UnmarshalJSON(data []byte) error

type CompletionChunkFinishReason

type CompletionChunkFinishReason string
const (
	CompletionChunkFinishReasonStop         CompletionChunkFinishReason = "stop"
	CompletionChunkFinishReasonEos          CompletionChunkFinishReason = "eos"
	CompletionChunkFinishReasonLength       CompletionChunkFinishReason = "length"
	CompletionChunkFinishReasonToolCalls    CompletionChunkFinishReason = "tool_calls"
	CompletionChunkFinishReasonFunctionCall CompletionChunkFinishReason = "function_call"
)

type CompletionChunkObject

type CompletionChunkObject string

The object type, which is always `completion.chunk`.

const (
	CompletionChunkObjectCompletionChunk CompletionChunkObject = "completion.chunk"
)

type CompletionChunkToken

type CompletionChunkToken struct {
	ID      int64   `json:"id" api:"required"`
	Logprob float64 `json:"logprob" api:"required"`
	Special bool    `json:"special" api:"required"`
	Text    string  `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Logprob     respjson.Field
		Special     respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CompletionChunkToken) RawJSON

func (r CompletionChunkToken) RawJSON() string

Returns the unmodified JSON received from the API

func (*CompletionChunkToken) UnmarshalJSON

func (r *CompletionChunkToken) UnmarshalJSON(data []byte) error

type CompletionNewParams

type CompletionNewParams struct {
	// The name of the model to query.
	//
	// [See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#chat-models)
	Model CompletionNewParamsModel `json:"model,omitzero" api:"required"`
	// A string providing context for the model to complete.
	Prompt string `json:"prompt" api:"required"`
	// If true, the response contains the prompt. Can be used with `logprobs` to return
	// prompt logprobs.
	Echo param.Opt[bool] `json:"echo,omitzero"`
	// A number between -2.0 and 2.0 where a positive value decreases the likelihood of
	// repeating tokens that have already been mentioned.
	FrequencyPenalty param.Opt[float64] `json:"frequency_penalty,omitzero"`
	// An integer between 0 and 20 of the top k tokens to return log probabilities for
	// at each generation step, instead of only the sampled token. Log probabilities
	// help assess model confidence in token predictions.
	Logprobs param.Opt[int64] `json:"logprobs,omitzero"`
	// The maximum number of tokens to generate.
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// A number between 0 and 1 that can be used as an alternative to top-p and top-k.
	MinP param.Opt[float64] `json:"min_p,omitzero"`
	// The number of completions to generate for each prompt.
	N param.Opt[int64] `json:"n,omitzero"`
	// A number between -2.0 and 2.0 where a positive value increases the likelihood of
	// a model talking about new topics.
	PresencePenalty param.Opt[float64] `json:"presence_penalty,omitzero"`
	// A number that controls the diversity of generated text by reducing the
	// likelihood of repeated sequences. Higher values decrease repetition.
	RepetitionPenalty param.Opt[float64] `json:"repetition_penalty,omitzero"`
	// Seed value for reproducibility.
	Seed param.Opt[int64] `json:"seed,omitzero"`
	// A decimal number from 0-1 that determines the degree of randomness in the
	// response. A temperature less than 1 favors more correctness and is appropriate
	// for question answering or summarization. A value closer to 1 introduces more
	// randomness in the output.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// An integer that's used to limit the number of choices for the next predicted
	// word or token. It specifies the maximum number of tokens to consider at each
	// step, based on their probability of occurrence. This technique helps to speed up
	// the generation process and can improve the quality of the generated text by
	// focusing on the most likely options.
	TopK param.Opt[int64] `json:"top_k,omitzero"`
	// A percentage (also called the nucleus parameter) that's used to dynamically
	// adjust the number of choices for each predicted token based on the cumulative
	// probabilities. It specifies a probability threshold below which all less likely
	// tokens are filtered out. This technique helps maintain diversity and generate
	// more fluent and natural-sounding text.
	TopP param.Opt[float64] `json:"top_p,omitzero"`
	// Adjusts the likelihood of specific tokens appearing in the generated output.
	LogitBias map[string]float64 `json:"logit_bias,omitzero"`
	// The name of the moderation model used to validate tokens. Choose from the
	// available moderation models found
	// [here](https://docs.together.ai/docs/inference-models#moderation-models).
	SafetyModel CompletionNewParamsSafetyModel `json:"safety_model,omitzero"`
	// A list of string sequences that truncate (stop) inference text output. For
	// example, "</s>" stops generation as soon as the model generates the given token.
	Stop []string `json:"stop,omitzero"`
	// contains filtered or unexported fields
}

func (CompletionNewParams) MarshalJSON

func (r CompletionNewParams) MarshalJSON() (data []byte, err error)

func (*CompletionNewParams) UnmarshalJSON

func (r *CompletionNewParams) UnmarshalJSON(data []byte) error

type CompletionNewParamsModel

type CompletionNewParamsModel string

The name of the model to query.

[See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#chat-models)

const (
	CompletionNewParamsModelMetaLlamaLlama2_70bHf    CompletionNewParamsModel = "meta-llama/Llama-2-70b-hf"
	CompletionNewParamsModelMistralaiMistral7BV0_1   CompletionNewParamsModel = "mistralai/Mistral-7B-v0.1"
	CompletionNewParamsModelMistralaiMixtral8x7BV0_1 CompletionNewParamsModel = "mistralai/Mixtral-8x7B-v0.1"
	CompletionNewParamsModelMetaLlamaLlamaGuard7b    CompletionNewParamsModel = "Meta-Llama/Llama-Guard-7b"
)

type CompletionNewParamsSafetyModel

type CompletionNewParamsSafetyModel string

The name of the moderation model used to validate tokens. Choose from the available moderation models found [here](https://docs.together.ai/docs/inference-models#moderation-models).

const (
	CompletionNewParamsSafetyModelMetaLlamaLlamaGuard7b CompletionNewParamsSafetyModel = "Meta-Llama/Llama-Guard-7b"
)

type CompletionService

type CompletionService struct {
	Options []option.RequestOption
}

CompletionService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCompletionService method instead.

func NewCompletionService

func NewCompletionService(opts ...option.RequestOption) (r CompletionService)

NewCompletionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CompletionService) New

Generate text completions for a given prompt using a language, code, or image model.

func (*CompletionService) NewStreaming

Generate text completions for a given prompt using a language, code, or image model.

type Config added in v0.11.0

type Config struct {
	// Config revision identifier.
	ID string `json:"id" api:"required"`
	// Model, hardware, and runtime combinations certified for this config revision.
	Certifications []Certification `json:"certifications" api:"required"`
	// ID of the project that owns the config revision. Public configs may be owned by
	// a different project than the deployment.
	ProjectID string `json:"projectId" api:"required"`
	// Resource name of the referenced model, using
	// `projects/{modelProject}/models/{modelId}`.
	ReferenceModel string `json:"referenceModel" api:"required"`
	// Deprecated. Use `referenceModel`. Reference model identifier.
	ReferenceModelID string `json:"referenceModelId" api:"required"`
	// Hardware and runtime selectors used to place and configure replicas.
	Selectors []Selector `json:"selectors" api:"required"`
	// Resource name of the draft model, using
	// `projects/{draftProject}/models/{modelId}`; empty when speculative decoding is
	// not enabled.
	DraftModel string `json:"draftModel"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		Certifications   respjson.Field
		ProjectID        respjson.Field
		ReferenceModel   respjson.Field
		ReferenceModelID respjson.Field
		Selectors        respjson.Field
		DraftModel       respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Immutable, user-facing configuration revision that defines how a compatible model runs, including engine and hardware selectors.

func (Config) RawJSON added in v0.11.0

func (r Config) RawJSON() string

Returns the unmodified JSON received from the API

func (*Config) UnmarshalJSON added in v0.11.0

func (r *Config) UnmarshalJSON(data []byte) error

type ContainerDeploymentStatus added in v0.11.0

type ContainerDeploymentStatus string
const (
	ContainerDeploymentStatusUpdating     ContainerDeploymentStatus = "Updating"
	ContainerDeploymentStatusScaling      ContainerDeploymentStatus = "Scaling"
	ContainerDeploymentStatusReady        ContainerDeploymentStatus = "Ready"
	ContainerDeploymentStatusFailed       ContainerDeploymentStatus = "Failed"
	ContainerDeploymentStatusScaledToZero ContainerDeploymentStatus = "ScaledToZero"
)

type Deployment added in v0.6.0

type Deployment struct {
	// ID is the unique identifier of the deployment
	ID string `json:"id"`
	// Args are the arguments passed to the container's command
	Args []string `json:"args"`
	// Autoscaling contains autoscaling configuration parameters for this deployment.
	// Omitted when autoscaling is disabled (nil)
	Autoscaling DeploymentAutoscalingUnion `json:"autoscaling"`
	// Controls how replicas above reserved capacity behave. `stable` replicas stay
	// running after scale-up; `preemptible` replicas may be evicted during capacity
	// contention.
	//
	// Any of "stable", "preemptible".
	CapacityType DeploymentCapacityType `json:"capacity_type"`
	// Command is the entrypoint command run in the container
	Command []string `json:"command"`
	// CPU is the amount of CPU resource allocated to each replica in cores (fractional
	// value is allowed)
	CPU float64 `json:"cpu"`
	// CreatedAt is the ISO8601 timestamp when this deployment was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Description provides a human-readable explanation of the deployment's purpose or
	// content
	Description string `json:"description"`
	// DesiredReplicas is the number of replicas that the orchestrator is targeting
	DesiredReplicas int64 `json:"desired_replicas"`
	// EnvironmentVariables is a list of environment variables set in the container
	EnvironmentVariables []DeploymentEnvironmentVariable `json:"environment_variables"`
	// GPUCount is the number of GPUs allocated to each replica in this deployment
	GPUCount int64 `json:"gpu_count"`
	// GPUType specifies the type of GPU requested (if any) for this deployment
	//
	// Any of "h100-80gb", "h100-40gb-mig", "h200-140gb", "b200-192gb".
	GPUType DeploymentGPUType `json:"gpu_type"`
	// HealthCheckPath is the HTTP path used for health checks of the application
	HealthCheckPath string `json:"health_check_path"`
	// Image specifies the container image used for this deployment
	Image string `json:"image"`
	// MaxReplicas is the maximum number of replicas to run for this deployment
	MaxReplicas int64 `json:"max_replicas"`
	// Memory is the amount of memory allocated to each replica in GiB (fractional
	// value is allowed)
	Memory float64 `json:"memory"`
	// MinReplicas is the minimum number of replicas to run for this deployment
	MinReplicas int64 `json:"min_replicas"`
	// Model weights mounted into this deployment, including the pinned revisions.
	ModelMounts []DeploymentModelMount `json:"model_mounts"`
	// Name is the name of the deployment
	Name string `json:"name"`
	// The object type, which is always `deployment`.
	//
	// Any of "deployment".
	Object DeploymentObject `json:"object"`
	// Port is the container port that the deployment exposes
	Port int64 `json:"port"`
	// ReadyReplicas is the current number of replicas that are in the Ready state
	ReadyReplicas int64 `json:"ready_replicas"`
	// ReplicaEvents is a mapping of replica names or IDs to their status events
	ReplicaEvents map[string]DeploymentReplicaEvent `json:"replica_events"`
	// Status represents the overall status of the deployment (e.g., Updating, Scaling,
	// Ready, Failed)
	//
	// Any of "Updating", "Scaling", "Ready", "Failed", "ScaledToZero".
	Status ContainerDeploymentStatus `json:"status"`
	// Storage is the amount of storage (in MB or units as defined by the platform)
	// allocated to each replica
	Storage int64 `json:"storage"`
	// TerminationGracePeriodSeconds is the time in seconds to wait for graceful
	// shutdown before forcefully terminating the replica
	TerminationGracePeriodSeconds int64 `json:"termination_grace_period_seconds"`
	// UpdatedAt is the ISO8601 timestamp when this deployment was last updated
	UpdatedAt time.Time `json:"updated_at" format:"date-time"`
	// Volumes is a list of volume mounts for this deployment
	Volumes []DeploymentVolume `json:"volumes"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                            respjson.Field
		Args                          respjson.Field
		Autoscaling                   respjson.Field
		CapacityType                  respjson.Field
		Command                       respjson.Field
		CPU                           respjson.Field
		CreatedAt                     respjson.Field
		Description                   respjson.Field
		DesiredReplicas               respjson.Field
		EnvironmentVariables          respjson.Field
		GPUCount                      respjson.Field
		GPUType                       respjson.Field
		HealthCheckPath               respjson.Field
		Image                         respjson.Field
		MaxReplicas                   respjson.Field
		Memory                        respjson.Field
		MinReplicas                   respjson.Field
		ModelMounts                   respjson.Field
		Name                          respjson.Field
		Object                        respjson.Field
		Port                          respjson.Field
		ReadyReplicas                 respjson.Field
		ReplicaEvents                 respjson.Field
		Status                        respjson.Field
		Storage                       respjson.Field
		TerminationGracePeriodSeconds respjson.Field
		UpdatedAt                     respjson.Field
		Volumes                       respjson.Field
		ExtraFields                   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Deployment) RawJSON added in v0.6.0

func (r Deployment) RawJSON() string

Returns the unmodified JSON received from the API

func (*Deployment) UnmarshalJSON added in v0.6.0

func (r *Deployment) UnmarshalJSON(data []byte) error

type DeploymentAdapterStatus added in v0.13.0

type DeploymentAdapterStatus struct {
	// Adapter model identifier for this status row.
	AdapterModelID string `json:"adapterModelId" api:"required"`
	// Cluster reporting this adapter status.
	ClusterID string `json:"clusterId" api:"required"`
	// Number of pods that failed to load the adapter.
	FailedPodCount int64 `json:"failedPodCount" api:"required"`
	// Number of pods with the adapter ready to serve.
	ReadyPodCount int64 `json:"readyPodCount" api:"required"`
	// Current adapter load state in this cluster.
	//
	// Any of "ADAPTER_LOAD_STATE_PENDING", "ADAPTER_LOAD_STATE_LOADING",
	// "ADAPTER_LOAD_STATE_READY", "ADAPTER_LOAD_STATE_REMOVING",
	// "ADAPTER_LOAD_STATE_FAILED".
	State DeploymentAdapterStatusState `json:"state" api:"required"`
	// Total pods expected to report adapter load state.
	TotalPodCount int64 `json:"totalPodCount" api:"required"`
	// Resource name of the adapter model, using
	// projects/{projectId}/models/{adapterModelId}.
	AdapterModel string `json:"adapterModel"`
	// Optional inference-probe verdict for this adapter on this cluster; absent until
	// validation concludes.
	AdapterValid bool `json:"adapterValid"`
	// Human-readable probe rejection detail when adapterValid is false.
	AdapterValidReason string `json:"adapterValidReason"`
	// Time when the adapter first reached READY in this cluster.
	LoadedAt time.Time `json:"loadedAt" format:"date-time"`
	// Human-readable details about the current adapter state.
	Message string `json:"message"`
	// Adapter row etag observed by the controller when it wrote this status.
	RealizedEtag string `json:"realizedEtag"`
	// Resource name of the adapter model revision currently loaded in this cluster,
	// using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
	RealizedRevision string `json:"realizedRevision"`
	// Adapter revision currently loaded on pods in this cluster.
	RealizedRevisionID string `json:"realizedRevisionId"`
	// Stable reason code for the current adapter state.
	Reason string `json:"reason"`
	// Time when this adapter status was last updated.
	UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AdapterModelID     respjson.Field
		ClusterID          respjson.Field
		FailedPodCount     respjson.Field
		ReadyPodCount      respjson.Field
		State              respjson.Field
		TotalPodCount      respjson.Field
		AdapterModel       respjson.Field
		AdapterValid       respjson.Field
		AdapterValidReason respjson.Field
		LoadedAt           respjson.Field
		Message            respjson.Field
		RealizedEtag       respjson.Field
		RealizedRevision   respjson.Field
		RealizedRevisionID respjson.Field
		Reason             respjson.Field
		UpdatedAt          respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controller-reported load state for an adapter on one deployment cluster.

func (DeploymentAdapterStatus) RawJSON added in v0.13.0

func (r DeploymentAdapterStatus) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentAdapterStatus) UnmarshalJSON added in v0.13.0

func (r *DeploymentAdapterStatus) UnmarshalJSON(data []byte) error

type DeploymentAdapterStatusState added in v0.13.0

type DeploymentAdapterStatusState string

Current adapter load state in this cluster.

const (
	DeploymentAdapterStatusStateAdapterLoadStatePending  DeploymentAdapterStatusState = "ADAPTER_LOAD_STATE_PENDING"
	DeploymentAdapterStatusStateAdapterLoadStateLoading  DeploymentAdapterStatusState = "ADAPTER_LOAD_STATE_LOADING"
	DeploymentAdapterStatusStateAdapterLoadStateReady    DeploymentAdapterStatusState = "ADAPTER_LOAD_STATE_READY"
	DeploymentAdapterStatusStateAdapterLoadStateRemoving DeploymentAdapterStatusState = "ADAPTER_LOAD_STATE_REMOVING"
	DeploymentAdapterStatusStateAdapterLoadStateFailed   DeploymentAdapterStatusState = "ADAPTER_LOAD_STATE_FAILED"
)

type DeploymentAutoscaling added in v0.11.0

type DeploymentAutoscaling struct {
	// Maximum number of replicas. Defaults to `minReplicas`; omitting it on update
	// preserves the current value.
	MaxReplicas int64 `json:"maxReplicas"`
	// Minimum number of replicas. Omit on update to preserve the current value. Set
	// both `minReplicas` and `maxReplicas` to `0` to stop the deployment.
	MinReplicas int64 `json:"minReplicas"`
	// Rate limits applied after stabilization and before replica bounds.
	ScaleDown ScalingRules `json:"scaleDown"`
	// Time a lower replica recommendation must remain stable before scaling down.
	// Defaults to `5m`.
	ScaleDownWindow string `json:"scaleDownWindow"`
	// Idle period after which the deployment automatically stops and releases its
	// replicas.
	ScaleToZeroWindow string `json:"scaleToZeroWindow"`
	// Rate limits applied after stabilization and before replica bounds.
	ScaleUp ScalingRules `json:"scaleUp"`
	// Stabilization window before scaling up.
	ScaleUpWindow string `json:"scaleUpWindow"`
	// Metrics and targets that drive replica recommendations. When omitted, the
	// platform uses concurrent in-flight requests per replica.
	ScalingMetrics []ScalingMetric `json:"scalingMetrics"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MaxReplicas       respjson.Field
		MinReplicas       respjson.Field
		ScaleDown         respjson.Field
		ScaleDownWindow   respjson.Field
		ScaleToZeroWindow respjson.Field
		ScaleUp           respjson.Field
		ScaleUpWindow     respjson.Field
		ScalingMetrics    respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Autoscaling configuration for a deployment.

func (DeploymentAutoscaling) RawJSON added in v0.11.0

func (r DeploymentAutoscaling) RawJSON() string

Returns the unmodified JSON received from the API

func (DeploymentAutoscaling) ToParam added in v0.11.0

ToParam converts this DeploymentAutoscaling to a DeploymentAutoscalingParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with DeploymentAutoscalingParam.Overrides()

func (*DeploymentAutoscaling) UnmarshalJSON added in v0.11.0

func (r *DeploymentAutoscaling) UnmarshalJSON(data []byte) error

type DeploymentAutoscalingCustomMetricAutoscalingConfig added in v0.7.0

type DeploymentAutoscalingCustomMetricAutoscalingConfig struct {
	// CustomMetricName is the Prometheus metric name. Must match
	// [a-zA-Z\_:][a-zA-Z0-9_:]\*
	CustomMetricName string `json:"custom_metric_name"`
	// Metric must be CustomMetric
	//
	// Any of "CustomMetric".
	Metric string `json:"metric"`
	// Target is the threshold value. Default: 500
	Target float64 `json:"target"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomMetricName respjson.Field
		Metric           respjson.Field
		Target           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Autoscaling config for CustomMetric metric

func (DeploymentAutoscalingCustomMetricAutoscalingConfig) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*DeploymentAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON added in v0.7.0

type DeploymentAutoscalingHTTPAutoscalingConfig added in v0.7.0

type DeploymentAutoscalingHTTPAutoscalingConfig struct {
	// Metric must be HTTPTotalRequests or HTTPAvgRequestDuration
	//
	// Any of "HTTPTotalRequests", "HTTPAvgRequestDuration".
	Metric string `json:"metric"`
	// Target is the threshold value. Default: 100 for HTTPTotalRequests, 500 (ms) for
	// HTTPAvgRequestDuration
	Target float64 `json:"target"`
	// TimeIntervalMinutes is the rate window in minutes. Default: 10
	TimeIntervalMinutes int64 `json:"time_interval_minutes"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metric              respjson.Field
		Target              respjson.Field
		TimeIntervalMinutes respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Autoscaling config for HTTPTotalRequests and HTTPAvgRequestDuration metrics

func (DeploymentAutoscalingHTTPAutoscalingConfig) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*DeploymentAutoscalingHTTPAutoscalingConfig) UnmarshalJSON added in v0.7.0

func (r *DeploymentAutoscalingHTTPAutoscalingConfig) UnmarshalJSON(data []byte) error

type DeploymentAutoscalingParam added in v0.11.0

type DeploymentAutoscalingParam struct {
	// Maximum number of replicas. Defaults to `minReplicas`; omitting it on update
	// preserves the current value.
	MaxReplicas param.Opt[int64] `json:"maxReplicas,omitzero"`
	// Minimum number of replicas. Omit on update to preserve the current value. Set
	// both `minReplicas` and `maxReplicas` to `0` to stop the deployment.
	MinReplicas param.Opt[int64] `json:"minReplicas,omitzero"`
	// Time a lower replica recommendation must remain stable before scaling down.
	// Defaults to `5m`.
	ScaleDownWindow param.Opt[string] `json:"scaleDownWindow,omitzero"`
	// Idle period after which the deployment automatically stops and releases its
	// replicas.
	ScaleToZeroWindow param.Opt[string] `json:"scaleToZeroWindow,omitzero"`
	// Stabilization window before scaling up.
	ScaleUpWindow param.Opt[string] `json:"scaleUpWindow,omitzero"`
	// Rate limits applied after stabilization and before replica bounds.
	ScaleDown ScalingRulesParam `json:"scaleDown,omitzero"`
	// Rate limits applied after stabilization and before replica bounds.
	ScaleUp ScalingRulesParam `json:"scaleUp,omitzero"`
	// Metrics and targets that drive replica recommendations. When omitted, the
	// platform uses concurrent in-flight requests per replica.
	ScalingMetrics []ScalingMetricParam `json:"scalingMetrics,omitzero"`
	// contains filtered or unexported fields
}

Autoscaling configuration for a deployment.

func (DeploymentAutoscalingParam) MarshalJSON added in v0.11.0

func (r DeploymentAutoscalingParam) MarshalJSON() (data []byte, err error)

func (*DeploymentAutoscalingParam) UnmarshalJSON added in v0.11.0

func (r *DeploymentAutoscalingParam) UnmarshalJSON(data []byte) error

type DeploymentAutoscalingQueueAutoscalingConfig added in v0.7.0

type DeploymentAutoscalingQueueAutoscalingConfig struct {
	// Metric must be QueueBacklogPerWorker
	//
	// Any of "QueueBacklogPerWorker".
	Metric string `json:"metric"`
	// Model overrides the model name for queue status lookup. Defaults to the
	// deployment app name
	Model string `json:"model"`
	// Target is the threshold value. Default: 1.01
	Target float64 `json:"target"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metric      respjson.Field
		Model       respjson.Field
		Target      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Autoscaling config for QueueBacklogPerWorker metric

func (DeploymentAutoscalingQueueAutoscalingConfig) RawJSON added in v0.7.0

Returns the unmodified JSON received from the API

func (*DeploymentAutoscalingQueueAutoscalingConfig) UnmarshalJSON added in v0.7.0

func (r *DeploymentAutoscalingQueueAutoscalingConfig) UnmarshalJSON(data []byte) error

type DeploymentAutoscalingUnion added in v0.7.0

type DeploymentAutoscalingUnion struct {
	Metric string  `json:"metric"`
	Target float64 `json:"target"`
	// This field is from variant [DeploymentAutoscalingHTTPAutoscalingConfig].
	TimeIntervalMinutes int64 `json:"time_interval_minutes"`
	// This field is from variant [DeploymentAutoscalingQueueAutoscalingConfig].
	Model string `json:"model"`
	// This field is from variant [DeploymentAutoscalingCustomMetricAutoscalingConfig].
	CustomMetricName string `json:"custom_metric_name"`
	JSON             struct {
		Metric              respjson.Field
		Target              respjson.Field
		TimeIntervalMinutes respjson.Field
		Model               respjson.Field
		CustomMetricName    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

DeploymentAutoscalingUnion contains all possible properties and values from DeploymentAutoscalingHTTPAutoscalingConfig, DeploymentAutoscalingQueueAutoscalingConfig, DeploymentAutoscalingCustomMetricAutoscalingConfig.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (DeploymentAutoscalingUnion) AsDeploymentAutoscalingCustomMetricAutoscalingConfig added in v0.7.0

func (u DeploymentAutoscalingUnion) AsDeploymentAutoscalingCustomMetricAutoscalingConfig() (v DeploymentAutoscalingCustomMetricAutoscalingConfig)

func (DeploymentAutoscalingUnion) AsDeploymentAutoscalingHTTPAutoscalingConfig added in v0.7.0

func (u DeploymentAutoscalingUnion) AsDeploymentAutoscalingHTTPAutoscalingConfig() (v DeploymentAutoscalingHTTPAutoscalingConfig)

func (DeploymentAutoscalingUnion) AsDeploymentAutoscalingQueueAutoscalingConfig added in v0.7.0

func (u DeploymentAutoscalingUnion) AsDeploymentAutoscalingQueueAutoscalingConfig() (v DeploymentAutoscalingQueueAutoscalingConfig)

func (DeploymentAutoscalingUnion) RawJSON added in v0.7.0

func (u DeploymentAutoscalingUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentAutoscalingUnion) UnmarshalJSON added in v0.7.0

func (r *DeploymentAutoscalingUnion) UnmarshalJSON(data []byte) error

type DeploymentCapacityType added in v0.13.0

type DeploymentCapacityType string

Controls how replicas above reserved capacity behave. `stable` replicas stay running after scale-up; `preemptible` replicas may be evicted during capacity contention.

const (
	DeploymentCapacityTypeStable      DeploymentCapacityType = "stable"
	DeploymentCapacityTypePreemptible DeploymentCapacityType = "preemptible"
)

type DeploymentEnvironmentVariable added in v0.6.0

type DeploymentEnvironmentVariable struct {
	// Name is the environment variable name (e.g., "DATABASE_URL"). Must start with a
	// letter or underscore, followed by letters, numbers, or underscores
	Name string `json:"name" api:"required"`
	// Value is the plain text value for the environment variable. Use this for
	// non-sensitive values. Either Value or ValueFromSecret must be set, but not both
	Value string `json:"value"`
	// ValueFromSecret references a secret by name or ID to use as the value. Use this
	// for sensitive values like API keys or passwords. Either Value or ValueFromSecret
	// must be set, but not both
	ValueFromSecret string `json:"value_from_secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name            respjson.Field
		Value           respjson.Field
		ValueFromSecret respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeploymentEnvironmentVariable) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*DeploymentEnvironmentVariable) UnmarshalJSON added in v0.6.0

func (r *DeploymentEnvironmentVariable) UnmarshalJSON(data []byte) error

type DeploymentGPUType added in v0.6.0

type DeploymentGPUType string

GPUType specifies the type of GPU requested (if any) for this deployment

const (
	DeploymentGPUTypeH100_80gb    DeploymentGPUType = "h100-80gb"
	DeploymentGPUTypeH100_40gbMig DeploymentGPUType = "h100-40gb-mig"
	DeploymentGPUTypeH200_140gb   DeploymentGPUType = "h200-140gb"
	DeploymentGPUTypeB200_192gb   DeploymentGPUType = "b200-192gb"
)

type DeploymentLogs added in v0.6.0

type DeploymentLogs struct {
	Lines []string `json:"lines"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Lines       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeploymentLogs) RawJSON added in v0.6.0

func (r DeploymentLogs) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentLogs) UnmarshalJSON added in v0.6.0

func (r *DeploymentLogs) UnmarshalJSON(data []byte) error

type DeploymentMetrics added in v0.13.0

type DeploymentMetrics struct {
	// ID of the deployment summarized by these metrics.
	DeploymentID string `json:"deploymentId"`
	// ID of the deployment's parent endpoint.
	EndpointID string `json:"endpointId"`
	// Error rate and counts by error type.
	ErrorMetrics ErrorMetrics `json:"errorMetrics"`
	// Time-to-first-token, end-to-end, and inter-token latency percentiles.
	LatencyMetrics LatencyMetrics `json:"latencyMetrics"`
	// Request counts and rates.
	RequestMetrics RequestMetrics `json:"requestMetrics"`
	// Average CPU, GPU, memory, and network utilization.
	ResourceUtilization ResourceUtilization `json:"resourceUtilization"`
	// Token, request, and batching throughput.
	ThroughputMetrics ThroughputMetrics `json:"throughputMetrics"`
	// Closed-open time range covered by the metrics.
	TimeRange MetricsTimeRange `json:"timeRange"`
	// Input and output token totals and averages.
	TokenMetrics TokenMetrics `json:"tokenMetrics"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DeploymentID        respjson.Field
		EndpointID          respjson.Field
		ErrorMetrics        respjson.Field
		LatencyMetrics      respjson.Field
		RequestMetrics      respjson.Field
		ResourceUtilization respjson.Field
		ThroughputMetrics   respjson.Field
		TimeRange           respjson.Field
		TokenMetrics        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Operational metrics for one deployment under an endpoint.

func (DeploymentMetrics) RawJSON added in v0.13.0

func (r DeploymentMetrics) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentMetrics) UnmarshalJSON added in v0.13.0

func (r *DeploymentMetrics) UnmarshalJSON(data []byte) error

type DeploymentModelMount added in v0.13.0

type DeploymentModelMount struct {
	// Model registry identifier (`ml_...`) whose weights are mounted.
	ModelID string `json:"model_id" api:"required"`
	// Container path where model weights are mounted, such as `/models`.
	MountPath string `json:"mount_path" api:"required"`
	// Optional validated revision identifier (`rv_...`) to pin; defaults to the latest
	// validated revision.
	RevisionID string `json:"revision_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ModelID     respjson.Field
		MountPath   respjson.Field
		RevisionID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeploymentModelMount) RawJSON added in v0.13.0

func (r DeploymentModelMount) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentModelMount) UnmarshalJSON added in v0.13.0

func (r *DeploymentModelMount) UnmarshalJSON(data []byte) error

type DeploymentObject added in v0.7.0

type DeploymentObject string

The object type, which is always `deployment`.

const (
	DeploymentObjectDeployment DeploymentObject = "deployment"
)

type DeploymentPlacementConfig added in v0.11.0

type DeploymentPlacementConfig struct {
	// Compliance regimes required by a deployment placement policy.
	CompliancePolicy DeploymentPlacementConfigCompliancePolicy `json:"compliancePolicy"`
	// How strictly the regions list is enforced.
	//
	// Any of "ENFORCEMENT_REQUIRED", "ENFORCEMENT_PREFERRED".
	Constraint DeploymentPlacementConfigConstraint `json:"constraint"`
	// Regions where the deployment is allowed to run. Multiple regions allow
	// best-effort replica spreading.
	Regions []string `json:"regions"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompliancePolicy respjson.Field
		Constraint       respjson.Field
		Regions          respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Inline placement parameters expanded into scheduling rules by the server.

func (DeploymentPlacementConfig) RawJSON added in v0.11.0

func (r DeploymentPlacementConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (DeploymentPlacementConfig) ToParam added in v0.11.0

ToParam converts this DeploymentPlacementConfig to a DeploymentPlacementConfigParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with DeploymentPlacementConfigParam.Overrides()

func (*DeploymentPlacementConfig) UnmarshalJSON added in v0.11.0

func (r *DeploymentPlacementConfig) UnmarshalJSON(data []byte) error

type DeploymentPlacementConfigCompliancePolicy added in v0.13.0

type DeploymentPlacementConfigCompliancePolicy struct {
	// Restrict placement to HIPAA-attested clusters.
	Hipaa bool `json:"hipaa"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hipaa       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compliance regimes required by a deployment placement policy.

func (DeploymentPlacementConfigCompliancePolicy) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*DeploymentPlacementConfigCompliancePolicy) UnmarshalJSON added in v0.13.0

func (r *DeploymentPlacementConfigCompliancePolicy) UnmarshalJSON(data []byte) error

type DeploymentPlacementConfigCompliancePolicyParam added in v0.13.0

type DeploymentPlacementConfigCompliancePolicyParam struct {
	// Restrict placement to HIPAA-attested clusters.
	Hipaa param.Opt[bool] `json:"hipaa,omitzero"`
	// contains filtered or unexported fields
}

Compliance regimes required by a deployment placement policy.

func (DeploymentPlacementConfigCompliancePolicyParam) MarshalJSON added in v0.13.0

func (r DeploymentPlacementConfigCompliancePolicyParam) MarshalJSON() (data []byte, err error)

func (*DeploymentPlacementConfigCompliancePolicyParam) UnmarshalJSON added in v0.13.0

type DeploymentPlacementConfigConstraint added in v0.11.0

type DeploymentPlacementConfigConstraint string

How strictly the regions list is enforced.

const (
	DeploymentPlacementConfigConstraintEnforcementRequired  DeploymentPlacementConfigConstraint = "ENFORCEMENT_REQUIRED"
	DeploymentPlacementConfigConstraintEnforcementPreferred DeploymentPlacementConfigConstraint = "ENFORCEMENT_PREFERRED"
)

type DeploymentPlacementConfigParam added in v0.11.0

type DeploymentPlacementConfigParam struct {
	// Compliance regimes required by a deployment placement policy.
	CompliancePolicy DeploymentPlacementConfigCompliancePolicyParam `json:"compliancePolicy,omitzero"`
	// How strictly the regions list is enforced.
	//
	// Any of "ENFORCEMENT_REQUIRED", "ENFORCEMENT_PREFERRED".
	Constraint DeploymentPlacementConfigConstraint `json:"constraint,omitzero"`
	// Regions where the deployment is allowed to run. Multiple regions allow
	// best-effort replica spreading.
	Regions []string `json:"regions,omitzero"`
	// contains filtered or unexported fields
}

Inline placement parameters expanded into scheduling rules by the server.

func (DeploymentPlacementConfigParam) MarshalJSON added in v0.11.0

func (r DeploymentPlacementConfigParam) MarshalJSON() (data []byte, err error)

func (*DeploymentPlacementConfigParam) UnmarshalJSON added in v0.11.0

func (r *DeploymentPlacementConfigParam) UnmarshalJSON(data []byte) error

type DeploymentReplicaEvent added in v0.6.0

type DeploymentReplicaEvent struct {
	// Image is the container image used for this replica
	Image string `json:"image"`
	// ReplicaReadySince is the timestamp when the replica became ready to serve
	// traffic
	ReplicaReadySince string `json:"replica_ready_since"`
	// ReplicaStatus is the current status of the replica (e.g., "Running", "Waiting",
	// "Terminated")
	ReplicaStatus string `json:"replica_status"`
	// ReplicaStatusMessage provides a human-readable message explaining the replica's
	// status
	ReplicaStatusMessage string `json:"replica_status_message"`
	// ReplicaStatusReason provides a brief machine-readable reason for the replica's
	// status
	ReplicaStatusReason string `json:"replica_status_reason"`
	// RevisionID is the deployment revision ID associated with this replica
	RevisionID string `json:"revision_id"`
	// VolumePreloadCompletedAt is the timestamp when the volume preload completed
	VolumePreloadCompletedAt string `json:"volume_preload_completed_at"`
	// VolumePreloadStartedAt is the timestamp when the volume preload started
	VolumePreloadStartedAt string `json:"volume_preload_started_at"`
	// VolumePreloadStatus is the status of the volume preload (e.g., "InProgress",
	// "Completed", "Failed")
	VolumePreloadStatus string `json:"volume_preload_status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Image                    respjson.Field
		ReplicaReadySince        respjson.Field
		ReplicaStatus            respjson.Field
		ReplicaStatusMessage     respjson.Field
		ReplicaStatusReason      respjson.Field
		RevisionID               respjson.Field
		VolumePreloadCompletedAt respjson.Field
		VolumePreloadStartedAt   respjson.Field
		VolumePreloadStatus      respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeploymentReplicaEvent) RawJSON added in v0.6.0

func (r DeploymentReplicaEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentReplicaEvent) UnmarshalJSON added in v0.6.0

func (r *DeploymentReplicaEvent) UnmarshalJSON(data []byte) error

type DeploymentRevision added in v0.13.0

type DeploymentRevision struct {
	// Arguments passed to the container command.
	Args []string `json:"args" api:"required"`
	// Capacity behavior for replicas above reserved capacity.
	//
	// Any of "stable", "preemptible".
	CapacityType DeploymentRevisionCapacityType `json:"capacity_type" api:"required"`
	// Entrypoint command run by the container.
	Command []string `json:"command" api:"required"`
	// CPU cores allocated to each replica.
	CPU float64 `json:"cpu" api:"required"`
	// Time when this revision was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Environment variables configured on this revision.
	EnvironmentVariables []DeploymentRevisionEnvironmentVariable `json:"environment_variables" api:"required"`
	// Number of GPUs allocated to each replica.
	GPUCount int64 `json:"gpu_count" api:"required"`
	// GPU hardware type configured for this revision.
	GPUType string `json:"gpu_type" api:"required"`
	// HTTP path used for health checks.
	HealthCheckPath string `json:"health_check_path" api:"required"`
	// Container image used by this revision.
	Image string `json:"image" api:"required"`
	// Maximum number of replicas configured for this revision.
	MaxReplicas int64 `json:"max_replicas" api:"required"`
	// Memory allocated to each replica in GiB.
	Memory float64 `json:"memory" api:"required"`
	// Minimum number of replicas configured for this revision.
	MinReplicas int64 `json:"min_replicas" api:"required"`
	// The object type, which is always `revision`.
	Object constant.Revision `json:"object" default:"revision"`
	// Container port exposed by this revision.
	Port int64 `json:"port" api:"required"`
	// Network protocol served by the deployment revision.
	Protocol string `json:"protocol" api:"required"`
	// Unique revision identifier.
	RevisionID string `json:"revision_id" api:"required"`
	// Ephemeral storage allocated to each replica.
	Storage int64 `json:"storage" api:"required"`
	// Volume mounts attached to this revision.
	Volumes []DeploymentRevisionVolume `json:"volumes" api:"required"`
	// Autoscaling configuration captured for this revision.
	Autoscaling DeploymentRevisionAutoscalingUnion `json:"autoscaling"`
	// Seconds to wait for graceful shutdown before forcefully terminating a replica.
	TerminationGracePeriodSeconds int64 `json:"termination_grace_period_seconds"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Args                          respjson.Field
		CapacityType                  respjson.Field
		Command                       respjson.Field
		CPU                           respjson.Field
		CreatedAt                     respjson.Field
		EnvironmentVariables          respjson.Field
		GPUCount                      respjson.Field
		GPUType                       respjson.Field
		HealthCheckPath               respjson.Field
		Image                         respjson.Field
		MaxReplicas                   respjson.Field
		Memory                        respjson.Field
		MinReplicas                   respjson.Field
		Object                        respjson.Field
		Port                          respjson.Field
		Protocol                      respjson.Field
		RevisionID                    respjson.Field
		Storage                       respjson.Field
		Volumes                       respjson.Field
		Autoscaling                   respjson.Field
		TerminationGracePeriodSeconds respjson.Field
		ExtraFields                   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Deployment configuration captured for one retained revision.

func (DeploymentRevision) RawJSON added in v0.13.0

func (r DeploymentRevision) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentRevision) UnmarshalJSON added in v0.13.0

func (r *DeploymentRevision) UnmarshalJSON(data []byte) error

type DeploymentRevisionAutoscalingCustomMetricAutoscalingConfig added in v0.13.0

type DeploymentRevisionAutoscalingCustomMetricAutoscalingConfig struct {
	// CustomMetricName is the Prometheus metric name. Must match
	// [a-zA-Z\_:][a-zA-Z0-9_:]\*
	CustomMetricName string `json:"custom_metric_name"`
	// Metric must be CustomMetric
	//
	// Any of "CustomMetric".
	Metric string `json:"metric"`
	// Target is the threshold value. Default: 500
	Target float64 `json:"target"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomMetricName respjson.Field
		Metric           respjson.Field
		Target           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Autoscaling config for CustomMetric metric

func (DeploymentRevisionAutoscalingCustomMetricAutoscalingConfig) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*DeploymentRevisionAutoscalingCustomMetricAutoscalingConfig) UnmarshalJSON added in v0.13.0

type DeploymentRevisionAutoscalingHTTPAutoscalingConfig added in v0.13.0

type DeploymentRevisionAutoscalingHTTPAutoscalingConfig struct {
	// Metric must be HTTPTotalRequests or HTTPAvgRequestDuration
	//
	// Any of "HTTPTotalRequests", "HTTPAvgRequestDuration".
	Metric string `json:"metric"`
	// Target is the threshold value. Default: 100 for HTTPTotalRequests, 500 (ms) for
	// HTTPAvgRequestDuration
	Target float64 `json:"target"`
	// TimeIntervalMinutes is the rate window in minutes. Default: 10
	TimeIntervalMinutes int64 `json:"time_interval_minutes"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metric              respjson.Field
		Target              respjson.Field
		TimeIntervalMinutes respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Autoscaling config for HTTPTotalRequests and HTTPAvgRequestDuration metrics

func (DeploymentRevisionAutoscalingHTTPAutoscalingConfig) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*DeploymentRevisionAutoscalingHTTPAutoscalingConfig) UnmarshalJSON added in v0.13.0

type DeploymentRevisionAutoscalingQueueAutoscalingConfig added in v0.13.0

type DeploymentRevisionAutoscalingQueueAutoscalingConfig struct {
	// Metric must be QueueBacklogPerWorker
	//
	// Any of "QueueBacklogPerWorker".
	Metric string `json:"metric"`
	// Model overrides the model name for queue status lookup. Defaults to the
	// deployment app name
	Model string `json:"model"`
	// Target is the threshold value. Default: 1.01
	Target float64 `json:"target"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metric      respjson.Field
		Model       respjson.Field
		Target      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Autoscaling config for QueueBacklogPerWorker metric

func (DeploymentRevisionAutoscalingQueueAutoscalingConfig) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*DeploymentRevisionAutoscalingQueueAutoscalingConfig) UnmarshalJSON added in v0.13.0

type DeploymentRevisionAutoscalingUnion added in v0.13.0

type DeploymentRevisionAutoscalingUnion struct {
	Metric string  `json:"metric"`
	Target float64 `json:"target"`
	// This field is from variant [DeploymentRevisionAutoscalingHTTPAutoscalingConfig].
	TimeIntervalMinutes int64 `json:"time_interval_minutes"`
	// This field is from variant
	// [DeploymentRevisionAutoscalingQueueAutoscalingConfig].
	Model string `json:"model"`
	// This field is from variant
	// [DeploymentRevisionAutoscalingCustomMetricAutoscalingConfig].
	CustomMetricName string `json:"custom_metric_name"`
	JSON             struct {
		Metric              respjson.Field
		Target              respjson.Field
		TimeIntervalMinutes respjson.Field
		Model               respjson.Field
		CustomMetricName    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

DeploymentRevisionAutoscalingUnion contains all possible properties and values from DeploymentRevisionAutoscalingHTTPAutoscalingConfig, DeploymentRevisionAutoscalingQueueAutoscalingConfig, DeploymentRevisionAutoscalingCustomMetricAutoscalingConfig.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (DeploymentRevisionAutoscalingUnion) AsDeploymentRevisionAutoscalingCustomMetricAutoscalingConfig added in v0.13.0

func (u DeploymentRevisionAutoscalingUnion) AsDeploymentRevisionAutoscalingCustomMetricAutoscalingConfig() (v DeploymentRevisionAutoscalingCustomMetricAutoscalingConfig)

func (DeploymentRevisionAutoscalingUnion) AsDeploymentRevisionAutoscalingHTTPAutoscalingConfig added in v0.13.0

func (u DeploymentRevisionAutoscalingUnion) AsDeploymentRevisionAutoscalingHTTPAutoscalingConfig() (v DeploymentRevisionAutoscalingHTTPAutoscalingConfig)

func (DeploymentRevisionAutoscalingUnion) AsDeploymentRevisionAutoscalingQueueAutoscalingConfig added in v0.13.0

func (u DeploymentRevisionAutoscalingUnion) AsDeploymentRevisionAutoscalingQueueAutoscalingConfig() (v DeploymentRevisionAutoscalingQueueAutoscalingConfig)

func (DeploymentRevisionAutoscalingUnion) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*DeploymentRevisionAutoscalingUnion) UnmarshalJSON added in v0.13.0

func (r *DeploymentRevisionAutoscalingUnion) UnmarshalJSON(data []byte) error

type DeploymentRevisionCapacityType added in v0.13.0

type DeploymentRevisionCapacityType string

Capacity behavior for replicas above reserved capacity.

const (
	DeploymentRevisionCapacityTypeStable      DeploymentRevisionCapacityType = "stable"
	DeploymentRevisionCapacityTypePreemptible DeploymentRevisionCapacityType = "preemptible"
)

type DeploymentRevisionEnvironmentVariable added in v0.13.0

type DeploymentRevisionEnvironmentVariable struct {
	// Name is the environment variable name (e.g., "DATABASE_URL"). Must start with a
	// letter or underscore, followed by letters, numbers, or underscores
	Name string `json:"name" api:"required"`
	// Value is the plain text value for the environment variable. Use this for
	// non-sensitive values. Either Value or ValueFromSecret must be set, but not both
	Value string `json:"value"`
	// ValueFromSecret references a secret by name or ID to use as the value. Use this
	// for sensitive values like API keys or passwords. Either Value or ValueFromSecret
	// must be set, but not both
	ValueFromSecret string `json:"value_from_secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name            respjson.Field
		Value           respjson.Field
		ValueFromSecret respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeploymentRevisionEnvironmentVariable) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*DeploymentRevisionEnvironmentVariable) UnmarshalJSON added in v0.13.0

func (r *DeploymentRevisionEnvironmentVariable) UnmarshalJSON(data []byte) error

type DeploymentRevisionEvent added in v0.13.0

type DeploymentRevisionEvent struct {
	// How this revision became active.
	//
	// Any of "create", "update", "system", "rollback".
	Action DeploymentRevisionEventAction `json:"action" api:"required"`
	// Time when this revision became active.
	ActivatedAt time.Time `json:"activated_at" api:"required" format:"date-time"`
	// Monotonic event number in the deployment's revision history.
	EventNumber int64 `json:"event_number" api:"required"`
	// Container image of the revision activated by this event.
	Image string `json:"image" api:"required"`
	// The object type, which is always `revision_event`.
	Object constant.RevisionEvent `json:"object" default:"revision_event"`
	// Revision ID activated by this event.
	RevisionID string `json:"revision_id" api:"required"`
	// Human-readable per-deployment revision counter.
	RevisionNumber int64 `json:"revision_number" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Action         respjson.Field
		ActivatedAt    respjson.Field
		EventNumber    respjson.Field
		Image          respjson.Field
		Object         respjson.Field
		RevisionID     respjson.Field
		RevisionNumber respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One entry in a deployment's revision history.

func (DeploymentRevisionEvent) RawJSON added in v0.13.0

func (r DeploymentRevisionEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentRevisionEvent) UnmarshalJSON added in v0.13.0

func (r *DeploymentRevisionEvent) UnmarshalJSON(data []byte) error

type DeploymentRevisionEventAction added in v0.13.0

type DeploymentRevisionEventAction string

How this revision became active.

const (
	DeploymentRevisionEventActionCreate   DeploymentRevisionEventAction = "create"
	DeploymentRevisionEventActionUpdate   DeploymentRevisionEventAction = "update"
	DeploymentRevisionEventActionSystem   DeploymentRevisionEventAction = "system"
	DeploymentRevisionEventActionRollback DeploymentRevisionEventAction = "rollback"
)

type DeploymentRevisionEventList added in v0.13.0

type DeploymentRevisionEventList struct {
	// Revision events, newest first.
	Data []DeploymentRevisionEvent `json:"data" api:"required"`
	// The object type, which is always `list`.
	Object constant.List `json:"object" default:"list"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Revision history events for a deployment, newest first.

func (DeploymentRevisionEventList) RawJSON added in v0.13.0

func (r DeploymentRevisionEventList) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentRevisionEventList) UnmarshalJSON added in v0.13.0

func (r *DeploymentRevisionEventList) UnmarshalJSON(data []byte) error

type DeploymentRevisionVolume added in v0.13.0

type DeploymentRevisionVolume struct {
	// MountPath is the path in the container where the volume mounts (e.g., "/data").
	MountPath string `json:"mount_path" api:"required"`
	// Name is the name of the volume to mount. Must reference an existing volume by
	// name or ID
	Name string `json:"name" api:"required"`
	// Version is the volume version to mount. On create, defaults to the latest
	// version. On update, defaults to the currently mounted version.
	Version int64 `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MountPath   respjson.Field
		Name        respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeploymentRevisionVolume) RawJSON added in v0.13.0

func (r DeploymentRevisionVolume) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentRevisionVolume) UnmarshalJSON added in v0.13.0

func (r *DeploymentRevisionVolume) UnmarshalJSON(data []byte) error

type DeploymentStatus added in v0.6.0

type DeploymentStatus struct {
	// Human-readable explanation of the current state.
	Message string `json:"message" api:"required"`
	// High-level lifecycle state.
	//
	// Any of "DEPLOYMENT_STATE_PROVISIONING", "DEPLOYMENT_STATE_READY",
	// "DEPLOYMENT_STATE_SCALING", "DEPLOYMENT_STATE_DEGRADED",
	// "DEPLOYMENT_STATE_FAILED", "DEPLOYMENT_STATE_STOPPED",
	// "DEPLOYMENT_STATE_STOPPING".
	State DeploymentStatusState `json:"state" api:"required"`
	// Deployment status broken down by each supported dimension.
	Details DeploymentStatusDetails `json:"details"`
	// Total replicas actively serving traffic across all clusters.
	ReadyReplicas int64 `json:"readyReplicas"`
	// Replicas the scheduler has placed on clusters.
	ScheduledReplicas int64 `json:"scheduledReplicas"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message           respjson.Field
		State             respjson.Field
		Details           respjson.Field
		ReadyReplicas     respjson.Field
		ScheduledReplicas respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current status of a deployment, derived at read time from internal state.

func (DeploymentStatus) RawJSON added in v0.11.0

func (r DeploymentStatus) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentStatus) UnmarshalJSON added in v0.11.0

func (r *DeploymentStatus) UnmarshalJSON(data []byte) error

type DeploymentStatusDetails added in v0.13.0

type DeploymentStatusDetails struct {
	// Regions where the deployment is actually scheduled or serving replicas, sorted
	// by region.
	Region []DeploymentStatusDetailsRegion `json:"region" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Region      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Deployment status broken down by each supported dimension.

func (DeploymentStatusDetails) RawJSON added in v0.13.0

func (r DeploymentStatusDetails) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentStatusDetails) UnmarshalJSON added in v0.13.0

func (r *DeploymentStatusDetails) UnmarshalJSON(data []byte) error

type DeploymentStatusDetailsRegion added in v0.13.0

type DeploymentStatusDetailsRegion struct {
	// Replicas serving traffic in this region.
	ReadyReplicas int64 `json:"readyReplicas" api:"required"`
	// Region name using the same vocabulary accepted by inline placement regions.
	Region string `json:"region" api:"required"`
	// Replicas the scheduler has placed in this region.
	ScheduledReplicas int64 `json:"scheduledReplicas" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ReadyReplicas     respjson.Field
		Region            respjson.Field
		ScheduledReplicas respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Realized scheduled and ready replica counts for one deployment region.

func (DeploymentStatusDetailsRegion) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*DeploymentStatusDetailsRegion) UnmarshalJSON added in v0.13.0

func (r *DeploymentStatusDetailsRegion) UnmarshalJSON(data []byte) error

type DeploymentStatusState added in v0.11.0

type DeploymentStatusState string

High-level lifecycle state.

const (
	DeploymentStatusStateDeploymentStateProvisioning DeploymentStatusState = "DEPLOYMENT_STATE_PROVISIONING"
	DeploymentStatusStateDeploymentStateReady        DeploymentStatusState = "DEPLOYMENT_STATE_READY"
	DeploymentStatusStateDeploymentStateScaling      DeploymentStatusState = "DEPLOYMENT_STATE_SCALING"
	DeploymentStatusStateDeploymentStateDegraded     DeploymentStatusState = "DEPLOYMENT_STATE_DEGRADED"
	DeploymentStatusStateDeploymentStateFailed       DeploymentStatusState = "DEPLOYMENT_STATE_FAILED"
	DeploymentStatusStateDeploymentStateStopped      DeploymentStatusState = "DEPLOYMENT_STATE_STOPPED"
	DeploymentStatusStateDeploymentStateStopping     DeploymentStatusState = "DEPLOYMENT_STATE_STOPPING"
)

type DeploymentVolume added in v0.6.0

type DeploymentVolume struct {
	// MountPath is the path in the container where the volume mounts (e.g., "/data").
	MountPath string `json:"mount_path" api:"required"`
	// Name is the name of the volume to mount. Must reference an existing volume by
	// name or ID
	Name string `json:"name" api:"required"`
	// Version is the volume version to mount. On create, defaults to the latest
	// version. On update, defaults to the currently mounted version.
	Version int64 `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MountPath   respjson.Field
		Name        respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeploymentVolume) RawJSON added in v0.6.0

func (r DeploymentVolume) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeploymentVolume) UnmarshalJSON added in v0.6.0

func (r *DeploymentVolume) UnmarshalJSON(data []byte) error

type Embedding

type Embedding struct {
	Data  []EmbeddingData `json:"data" api:"required"`
	Model string          `json:"model" api:"required"`
	// The object type, which is always `list`.
	Object constant.List `json:"object" default:"list"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Model       respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Embedding) RawJSON

func (r Embedding) RawJSON() string

Returns the unmodified JSON received from the API

func (*Embedding) UnmarshalJSON

func (r *Embedding) UnmarshalJSON(data []byte) error

type EmbeddingData

type EmbeddingData struct {
	Embedding []float64 `json:"embedding" api:"required"`
	Index     int64     `json:"index" api:"required"`
	// The object type, which is always `embedding`.
	Object constant.Embedding `json:"object" default:"embedding"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Embedding   respjson.Field
		Index       respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EmbeddingData) RawJSON

func (r EmbeddingData) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmbeddingData) UnmarshalJSON

func (r *EmbeddingData) UnmarshalJSON(data []byte) error

type EmbeddingNewParams

type EmbeddingNewParams struct {
	// A string providing the text for the model to embed.
	Input EmbeddingNewParamsInputUnion `json:"input,omitzero" api:"required"`
	// The name of the embedding model to use.
	//
	// [See all of Together AI's embedding models](https://docs.together.ai/docs/serverless-models#embedding-models)
	Model EmbeddingNewParamsModel `json:"model,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (EmbeddingNewParams) MarshalJSON

func (r EmbeddingNewParams) MarshalJSON() (data []byte, err error)

func (*EmbeddingNewParams) UnmarshalJSON

func (r *EmbeddingNewParams) UnmarshalJSON(data []byte) error

type EmbeddingNewParamsInputUnion

type EmbeddingNewParamsInputUnion struct {
	OfString      param.Opt[string] `json:",omitzero,inline"`
	OfStringArray []string          `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EmbeddingNewParamsInputUnion) MarshalJSON

func (u EmbeddingNewParamsInputUnion) MarshalJSON() ([]byte, error)

func (*EmbeddingNewParamsInputUnion) UnmarshalJSON

func (u *EmbeddingNewParamsInputUnion) UnmarshalJSON(data []byte) error

type EmbeddingNewParamsModel

type EmbeddingNewParamsModel string

The name of the embedding model to use.

[See all of Together AI's embedding models](https://docs.together.ai/docs/serverless-models#embedding-models)

const (
	EmbeddingNewParamsModelWhereIsAIUaeLargeV1                  EmbeddingNewParamsModel = "WhereIsAI/UAE-Large-V1"
	EmbeddingNewParamsModelBaaiBgeLargeEnV1_5                   EmbeddingNewParamsModel = "BAAI/bge-large-en-v1.5"
	EmbeddingNewParamsModelBaaiBgeBaseEnV1_5                    EmbeddingNewParamsModel = "BAAI/bge-base-en-v1.5"
	EmbeddingNewParamsModelTogethercomputerM2Bert80M8kRetrieval EmbeddingNewParamsModel = "togethercomputer/m2-bert-80M-8k-retrieval"
)

type EmbeddingService

type EmbeddingService struct {
	Options []option.RequestOption
}

EmbeddingService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmbeddingService method instead.

func NewEmbeddingService

func NewEmbeddingService(opts ...option.RequestOption) (r EmbeddingService)

NewEmbeddingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EmbeddingService) New

func (r *EmbeddingService) New(ctx context.Context, body EmbeddingNewParams, opts ...option.RequestOption) (res *Embedding, err error)

Generate vector embeddings for one or more text inputs. Returns numerical arrays representing semantic meaning, useful for search, classification, and retrieval.

type Endpoint added in v0.11.0

type Endpoint struct {
	// Unique endpoint identifier.
	ID string `json:"id" api:"required"`
	// Timestamp when the endpoint was created.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// Lightweight summaries of deployments under this endpoint. Retrieve a deployment
	// through the endpoint's deployment API for full details.
	Deployments []EndpointDeploymentSummary `json:"deployments" api:"required"`
	// Serving class of the endpoint. Reserved endpoints use reserved capacity.
	//
	// Any of "ENDPOINT_TYPE_DEDICATED", "ENDPOINT_TYPE_SERVERLESS",
	// "ENDPOINT_TYPE_RESERVED".
	EndpointType EndpointEndpointType `json:"endpointType" api:"required"`
	// Opaque version tag for optimistic concurrency control. Supply on update/delete
	// to ensure consistent read-modify-write. If not set, the write overwrites based
	// on current state.
	Etag string `json:"etag" api:"required"`
	// Project-qualified endpoint name in the form `<project_slug>/<endpoint_name>`.
	// Pass this value as `model` in inference requests. Create and update requests may
	// use either a bare endpoint name or the qualified form; a supplied project slug
	// must match the project in the request path.
	Name string `json:"name" api:"required"`
	// ID of the project that owns the endpoint.
	ProjectID string `json:"projectId" api:"required"`
	// Deployments eligible for live traffic and their capacity weights. An empty list
	// leaves the endpoint unrouted.
	TrafficSplit []EndpointTrafficSplitEntry `json:"trafficSplit" api:"required"`
	// Output only. Timestamp when the endpoint was last updated.
	UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
	// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project;
	// `VISIBILITY_INTERNAL` shares it with the organization.
	//
	// Any of "VISIBILITY_PRIVATE", "VISIBILITY_INTERNAL".
	Visibility EndpointVisibility `json:"visibility" api:"required"`
	// ID of the currently active rollout in an in-flight state, including paused.
	ActiveRolloutID string `json:"activeRolloutId"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		CreatedAt       respjson.Field
		Deployments     respjson.Field
		EndpointType    respjson.Field
		Etag            respjson.Field
		Name            respjson.Field
		ProjectID       respjson.Field
		TrafficSplit    respjson.Field
		UpdatedAt       respjson.Field
		Visibility      respjson.Field
		ActiveRolloutID respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Stable inference entry point that groups deployments and routes requests among them.

func (Endpoint) RawJSON added in v0.11.0

func (r Endpoint) RawJSON() string

Returns the unmodified JSON received from the API

func (*Endpoint) UnmarshalJSON added in v0.11.0

func (r *Endpoint) UnmarshalJSON(data []byte) error

type EndpointAbExperimentDeleteParams added in v0.13.0

type EndpointAbExperimentDeleteParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Etag for optimistic concurrency. If set, the delete is rejected if the current
	// etag does not match.
	Etag param.Opt[string] `query:"etag,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointAbExperimentDeleteParams) URLQuery added in v0.13.0

func (r EndpointAbExperimentDeleteParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointAbExperimentDeleteParams's query parameters as `url.Values`.

type EndpointAbExperimentDeleteResponse added in v0.13.0

type EndpointAbExperimentDeleteResponse struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Empty response returned after a successful delete operation.

func (EndpointAbExperimentDeleteResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*EndpointAbExperimentDeleteResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointAbExperimentDeleteResponse) UnmarshalJSON(data []byte) error

type EndpointAbExperimentGetParams added in v0.13.0

type EndpointAbExperimentGetParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type EndpointAbExperimentListParams added in v0.13.0

type EndpointAbExperimentListParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous A/B experiment list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of A/B experiments to return. Max 500, defaults to 50.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointAbExperimentListParams) URLQuery added in v0.13.0

func (r EndpointAbExperimentListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointAbExperimentListParams's query parameters as `url.Values`.

type EndpointAbExperimentNewParams added in v0.13.0

type EndpointAbExperimentNewParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Two to 20 participating deployments with exactly one control. Integer traffic
	// percentages across all members must add up to 100.
	Members []AbMemberParam `json:"members,omitzero" api:"required"`
	// Human-readable A/B experiment name, unique within the endpoint.
	Name string `json:"name" api:"required"`
	// Optional free-form description.
	Description param.Opt[string] `json:"description,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointAbExperimentNewParams) MarshalJSON added in v0.13.0

func (r EndpointAbExperimentNewParams) MarshalJSON() (data []byte, err error)

func (*EndpointAbExperimentNewParams) UnmarshalJSON added in v0.13.0

func (r *EndpointAbExperimentNewParams) UnmarshalJSON(data []byte) error

type EndpointAbExperimentService added in v0.13.0

type EndpointAbExperimentService struct {
	Options []option.RequestOption
}

EndpointAbExperimentService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEndpointAbExperimentService method instead.

func NewEndpointAbExperimentService added in v0.13.0

func NewEndpointAbExperimentService(opts ...option.RequestOption) (r EndpointAbExperimentService)

NewEndpointAbExperimentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EndpointAbExperimentService) Delete added in v0.13.0

Deletes an A/B experiment and removes its managed traffic split. The deployments themselves are not deleted.

func (*EndpointAbExperimentService) Get added in v0.13.0

Retrieves an A/B experiment and its participating deployments, roles, and traffic percentages.

func (*EndpointAbExperimentService) List added in v0.13.0

Lists the managed live-traffic experiments configured for an endpoint.

func (*EndpointAbExperimentService) ListAutoPaging added in v0.13.0

Lists the managed live-traffic experiments configured for an endpoint.

func (*EndpointAbExperimentService) New added in v0.13.0

Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control.

func (*EndpointAbExperimentService) Update added in v0.13.0

Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency.

type EndpointAbExperimentUpdateParams added in v0.13.0

type EndpointAbExperimentUpdateParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Fields to update. If omitted, all mutable fields are overwritten.
	UpdateMask param.Opt[string] `query:"updateMask,omitzero" json:"-"`
	// Updated free-form description.
	Description param.Opt[string] `json:"description,omitzero"`
	// Opaque version tag from a prior read for optimistic concurrency.
	Etag param.Opt[string] `json:"etag,omitzero"`
	// Complete replacement member set. Requires two to 20 deployments, exactly one
	// control, and percentages that add up to 100.
	Members []AbMemberParam `json:"members,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointAbExperimentUpdateParams) MarshalJSON added in v0.13.0

func (r EndpointAbExperimentUpdateParams) MarshalJSON() (data []byte, err error)

func (EndpointAbExperimentUpdateParams) URLQuery added in v0.13.0

func (r EndpointAbExperimentUpdateParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointAbExperimentUpdateParams's query parameters as `url.Values`.

func (*EndpointAbExperimentUpdateParams) UnmarshalJSON added in v0.13.0

func (r *EndpointAbExperimentUpdateParams) UnmarshalJSON(data []byte) error

type EndpointAdapterDeleteParams added in v0.13.0

type EndpointAdapterDeleteParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Deployment identifier.
	DeploymentID string `path:"deploymentId" api:"required" json:"-"`
	// Adapter etag from a previous add, update, get, or list response. The removal is
	// rejected if the adapter changed after that response.
	Etag string `query:"etag" api:"required" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointAdapterDeleteParams) URLQuery added in v0.13.0

func (r EndpointAdapterDeleteParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointAdapterDeleteParams's query parameters as `url.Values`.

type EndpointAdapterDeleteResponse added in v0.13.0

type EndpointAdapterDeleteResponse struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Empty response returned after a successful delete operation.

func (EndpointAdapterDeleteResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*EndpointAdapterDeleteResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointAdapterDeleteResponse) UnmarshalJSON(data []byte) error

type EndpointAdapterGetParams added in v0.13.0

type EndpointAdapterGetParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Deployment identifier.
	DeploymentID string `path:"deploymentId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type EndpointAdapterGetResponse added in v0.13.0

type EndpointAdapterGetResponse struct {
	// Adapter attachment `dad_` id used by get, update, and remove; stale ids never
	// address a replacement after remove and re-add.
	ID string `json:"id" api:"required"`
	// Adapter model identifier attached to the deployment.
	AdapterModelID string `json:"adapterModelId" api:"required"`
	// Adapter revision pinned on the deployment.
	DesiredRevisionID string `json:"desiredRevisionId" api:"required"`
	// Row-level etag required for UpdateAdapter and RemoveAdapter.
	Etag string `json:"etag" api:"required"`
	// Per-cluster adapter load state reported by the controller.
	PerCluster []DeploymentAdapterStatus `json:"perCluster" api:"required"`
	// Resource name of the adapter model, using
	// projects/{projectId}/models/{adapterModelId}.
	AdapterModel string `json:"adapterModel"`
	// Resource name of the adapter model revision pinned on the deployment, using
	// projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
	DesiredRevision string `json:"desiredRevision"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		AdapterModelID    respjson.Field
		DesiredRevisionID respjson.Field
		Etag              respjson.Field
		PerCluster        respjson.Field
		AdapterModel      respjson.Field
		DesiredRevision   respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Adapter attached to a deployment with desired revision and observed load state.

func (EndpointAdapterGetResponse) RawJSON added in v0.13.0

func (r EndpointAdapterGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EndpointAdapterGetResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointAdapterGetResponse) UnmarshalJSON(data []byte) error

type EndpointAdapterListParams added in v0.13.0

type EndpointAdapterListParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous adapter list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of adapters to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointAdapterListParams) URLQuery added in v0.13.0

func (r EndpointAdapterListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointAdapterListParams's query parameters as `url.Values`.

type EndpointAdapterListResponse added in v0.11.0

type EndpointAdapterListResponse struct {
	// Adapter attachment `dad_` id used by get, update, and remove; stale ids never
	// address a replacement after remove and re-add.
	ID string `json:"id" api:"required"`
	// Adapter model identifier attached to the deployment.
	AdapterModelID string `json:"adapterModelId" api:"required"`
	// Adapter revision pinned on the deployment.
	DesiredRevisionID string `json:"desiredRevisionId" api:"required"`
	// Row-level etag required for UpdateAdapter and RemoveAdapter.
	Etag string `json:"etag" api:"required"`
	// Per-cluster adapter load state reported by the controller.
	PerCluster []DeploymentAdapterStatus `json:"perCluster" api:"required"`
	// Resource name of the adapter model, using
	// projects/{projectId}/models/{adapterModelId}.
	AdapterModel string `json:"adapterModel"`
	// Resource name of the adapter model revision pinned on the deployment, using
	// projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
	DesiredRevision string `json:"desiredRevision"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		AdapterModelID    respjson.Field
		DesiredRevisionID respjson.Field
		Etag              respjson.Field
		PerCluster        respjson.Field
		AdapterModel      respjson.Field
		DesiredRevision   respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Adapter attached to a deployment with desired revision and observed load state.

func (EndpointAdapterListResponse) RawJSON added in v0.11.0

func (r EndpointAdapterListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EndpointAdapterListResponse) UnmarshalJSON added in v0.11.0

func (r *EndpointAdapterListResponse) UnmarshalJSON(data []byte) error

type EndpointAdapterNewParams added in v0.13.0

type EndpointAdapterNewParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Deployment identifier.
	DeploymentID string `path:"deploymentId" api:"required" json:"-"`
	// Adapter model identifier to attach.
	AdapterModelID string `json:"adapterModelId" api:"required"`
	// Optional adapter revision to pin. If omitted, the latest revision is resolved at
	// request time.
	AdapterRevisionID param.Opt[string] `json:"adapterRevisionId,omitzero"`
	// Whether to evict the oldest adapter if the deployment is at adapter capacity.
	Force param.Opt[bool] `json:"force,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointAdapterNewParams) MarshalJSON added in v0.13.0

func (r EndpointAdapterNewParams) MarshalJSON() (data []byte, err error)

func (*EndpointAdapterNewParams) UnmarshalJSON added in v0.13.0

func (r *EndpointAdapterNewParams) UnmarshalJSON(data []byte) error

type EndpointAdapterNewResponse added in v0.13.0

type EndpointAdapterNewResponse struct {
	// Adapter attachment `dad_` id used by get, update, and remove; stale ids never
	// address a replacement after remove and re-add.
	ID string `json:"id" api:"required"`
	// Adapter model identifier attached to the deployment.
	AdapterModelID string `json:"adapterModelId" api:"required"`
	// Adapter revision pinned on the deployment.
	DesiredRevisionID string `json:"desiredRevisionId" api:"required"`
	// Row-level etag required for UpdateAdapter and RemoveAdapter.
	Etag string `json:"etag" api:"required"`
	// Per-cluster adapter load state reported by the controller.
	PerCluster []DeploymentAdapterStatus `json:"perCluster" api:"required"`
	// Resource name of the adapter model, using
	// projects/{projectId}/models/{adapterModelId}.
	AdapterModel string `json:"adapterModel"`
	// Resource name of the adapter model revision pinned on the deployment, using
	// projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
	DesiredRevision string `json:"desiredRevision"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		AdapterModelID    respjson.Field
		DesiredRevisionID respjson.Field
		Etag              respjson.Field
		PerCluster        respjson.Field
		AdapterModel      respjson.Field
		DesiredRevision   respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Adapter attached to a deployment with desired revision and observed load state.

func (EndpointAdapterNewResponse) RawJSON added in v0.13.0

func (r EndpointAdapterNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EndpointAdapterNewResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointAdapterNewResponse) UnmarshalJSON(data []byte) error

type EndpointAdapterService added in v0.11.0

type EndpointAdapterService struct {
	Options []option.RequestOption
}

EndpointAdapterService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEndpointAdapterService method instead.

func NewEndpointAdapterService added in v0.11.0

func NewEndpointAdapterService(opts ...option.RequestOption) (r EndpointAdapterService)

NewEndpointAdapterService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EndpointAdapterService) Delete added in v0.13.0

Detaches an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency.

func (*EndpointAdapterService) Get added in v0.13.0

Gets an adapter attachment by its `dad_` id and returns its per-cluster load state.

func (*EndpointAdapterService) List added in v0.11.0

Lists LoRA adapters attached to a deployment with per-cluster load state.

func (*EndpointAdapterService) ListAutoPaging added in v0.13.0

Lists LoRA adapters attached to a deployment with per-cluster load state.

func (*EndpointAdapterService) New added in v0.13.0

Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter.

func (*EndpointAdapterService) Update added in v0.13.0

Updates the pinned revision of an adapter attachment by its `dad_` id using its row-level etag for optimistic concurrency.

type EndpointAdapterUpdateParams added in v0.13.0

type EndpointAdapterUpdateParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Deployment identifier.
	DeploymentID string `path:"deploymentId" api:"required" json:"-"`
	// New adapter revision to pin.
	AdapterRevisionID string `json:"adapterRevisionId" api:"required"`
	// Row-level etag from a prior AddAdapter, UpdateAdapter, GetAdapter, or
	// ListAdapters response.
	Etag string `json:"etag" api:"required"`
	// contains filtered or unexported fields
}

func (EndpointAdapterUpdateParams) MarshalJSON added in v0.13.0

func (r EndpointAdapterUpdateParams) MarshalJSON() (data []byte, err error)

func (*EndpointAdapterUpdateParams) UnmarshalJSON added in v0.13.0

func (r *EndpointAdapterUpdateParams) UnmarshalJSON(data []byte) error

type EndpointAdapterUpdateResponse added in v0.13.0

type EndpointAdapterUpdateResponse struct {
	// Adapter attachment `dad_` id used by get, update, and remove; stale ids never
	// address a replacement after remove and re-add.
	ID string `json:"id" api:"required"`
	// Adapter model identifier attached to the deployment.
	AdapterModelID string `json:"adapterModelId" api:"required"`
	// Adapter revision pinned on the deployment.
	DesiredRevisionID string `json:"desiredRevisionId" api:"required"`
	// Row-level etag required for UpdateAdapter and RemoveAdapter.
	Etag string `json:"etag" api:"required"`
	// Per-cluster adapter load state reported by the controller.
	PerCluster []DeploymentAdapterStatus `json:"perCluster" api:"required"`
	// Resource name of the adapter model, using
	// projects/{projectId}/models/{adapterModelId}.
	AdapterModel string `json:"adapterModel"`
	// Resource name of the adapter model revision pinned on the deployment, using
	// projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
	DesiredRevision string `json:"desiredRevision"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		AdapterModelID    respjson.Field
		DesiredRevisionID respjson.Field
		Etag              respjson.Field
		PerCluster        respjson.Field
		AdapterModel      respjson.Field
		DesiredRevision   respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Adapter attached to a deployment with desired revision and observed load state.

func (EndpointAdapterUpdateResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*EndpointAdapterUpdateResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointAdapterUpdateResponse) UnmarshalJSON(data []byte) error

type EndpointAnalyticsParams added in v0.13.0

type EndpointAnalyticsParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Restrict to a single deployment under this endpoint.
	DeploymentID param.Opt[string] `query:"deploymentId,omitzero" json:"-"`
	// Exclusive end of the time range. Defaults to now if unset.
	EndTime param.Opt[time.Time] `query:"endTime,omitzero" format:"date-time" json:"-"`
	// Time-series bucket duration, such as `1m`, `1h`, or `1d`. Defaults to `1d`.
	Granularity param.Opt[string] `query:"granularity,omitzero" json:"-"`
	// When true, include per-bucket time series in the response.
	IncludeTimeSeries param.Opt[bool] `query:"includeTimeSeries,omitzero" json:"-"`
	// Inclusive start of the time range. Defaults to 24 hours ago if unset.
	StartTime param.Opt[time.Time] `query:"startTime,omitzero" format:"date-time" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointAnalyticsParams) URLQuery added in v0.13.0

func (r EndpointAnalyticsParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointAnalyticsParams's query parameters as `url.Values`.

type EndpointAnalyticsResponse added in v0.13.0

type EndpointAnalyticsResponse struct {
	// Per-deployment analytics.
	DeploymentAnalytics []EndpointAnalyticsResponseDeploymentAnalytics `json:"deploymentAnalytics"`
	// ID of the endpoint summarized by these analytics.
	EndpointID string `json:"endpointId"`
	// Operational metrics aggregated across all deployments receiving traffic for an
	// endpoint.
	Metrics EndpointAnalyticsResponseMetrics `json:"metrics"`
	// Closed-open time range covered by the analytics.
	TimeRange MetricsTimeRange `json:"timeRange"`
	// Per-bucket metric samples, included only when `includeTimeSeries` is true.
	TimeSeries []TimeSeriesDataPoint `json:"timeSeries"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DeploymentAnalytics respjson.Field
		EndpointID          respjson.Field
		Metrics             respjson.Field
		TimeRange           respjson.Field
		TimeSeries          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Endpoint-wide usage and performance analytics with optional time-series and per-deployment breakdowns.

func (EndpointAnalyticsResponse) RawJSON added in v0.13.0

func (r EndpointAnalyticsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EndpointAnalyticsResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointAnalyticsResponse) UnmarshalJSON(data []byte) error

type EndpointAnalyticsResponseDeploymentAnalytics added in v0.13.0

type EndpointAnalyticsResponseDeploymentAnalytics struct {
	// ID of the deployment summarized by these analytics.
	DeploymentID string `json:"deploymentId"`
	// ID of the deployment's parent endpoint.
	EndpointID string `json:"endpointId"`
	// Aggregate operational metrics for the deployment.
	Metrics DeploymentMetrics `json:"metrics"`
	// Closed-open time range covered by the analytics.
	TimeRange MetricsTimeRange `json:"timeRange"`
	// Per-bucket metric samples for the deployment.
	TimeSeries []TimeSeriesDataPoint `json:"timeSeries"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DeploymentID respjson.Field
		EndpointID   respjson.Field
		Metrics      respjson.Field
		TimeRange    respjson.Field
		TimeSeries   respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Usage and performance analytics for one deployment under an endpoint.

func (EndpointAnalyticsResponseDeploymentAnalytics) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*EndpointAnalyticsResponseDeploymentAnalytics) UnmarshalJSON added in v0.13.0

func (r *EndpointAnalyticsResponseDeploymentAnalytics) UnmarshalJSON(data []byte) error

type EndpointAnalyticsResponseMetrics added in v0.13.0

type EndpointAnalyticsResponseMetrics struct {
	// Per-deployment breakdown, if the endpoint has multiple deployments.
	DeploymentMetrics []DeploymentMetrics `json:"deploymentMetrics"`
	// The endpoint these metrics describe.
	EndpointID string `json:"endpointId"`
	// Error rate and counts by error type.
	ErrorMetrics ErrorMetrics `json:"errorMetrics"`
	// Time-to-first-token, end-to-end, and inter-token latency percentiles.
	LatencyMetrics LatencyMetrics `json:"latencyMetrics"`
	// Request counts and rates.
	RequestMetrics RequestMetrics `json:"requestMetrics"`
	// Average CPU, GPU, memory, and network utilization.
	ResourceUtilization ResourceUtilization `json:"resourceUtilization"`
	// Token, request, and batching throughput.
	ThroughputMetrics ThroughputMetrics `json:"throughputMetrics"`
	// Closed-open time range used by metrics and analytics responses.
	TimeRange MetricsTimeRange `json:"timeRange"`
	// Input and output token totals and averages.
	TokenMetrics TokenMetrics `json:"tokenMetrics"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DeploymentMetrics   respjson.Field
		EndpointID          respjson.Field
		ErrorMetrics        respjson.Field
		LatencyMetrics      respjson.Field
		RequestMetrics      respjson.Field
		ResourceUtilization respjson.Field
		ThroughputMetrics   respjson.Field
		TimeRange           respjson.Field
		TokenMetrics        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Operational metrics aggregated across all deployments receiving traffic for an endpoint.

func (EndpointAnalyticsResponseMetrics) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*EndpointAnalyticsResponseMetrics) UnmarshalJSON added in v0.13.0

func (r *EndpointAnalyticsResponseMetrics) UnmarshalJSON(data []byte) error

type EndpointDeleteParams added in v0.13.0

type EndpointDeleteParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Etag for optimistic concurrency. If set, the delete is rejected if the current
	// etag does not match.
	Etag param.Opt[string] `query:"etag,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointDeleteParams) URLQuery added in v0.13.0

func (r EndpointDeleteParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointDeleteParams's query parameters as `url.Values`.

type EndpointDeleteResponse added in v0.13.0

type EndpointDeleteResponse struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Empty response returned after a successful delete operation.

func (EndpointDeleteResponse) RawJSON added in v0.13.0

func (r EndpointDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EndpointDeleteResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointDeleteResponse) UnmarshalJSON(data []byte) error

type EndpointDeployment added in v0.11.0

type EndpointDeployment struct {
	// Unique deployment identifier.
	ID string `json:"id" api:"required"`
	// Replica bounds, timing windows, and metrics that control horizontal scaling.
	Autoscaling EndpointDeploymentAutoscaling `json:"autoscaling" api:"required"`
	// Immutable config revision in the form
	// `projects/{projectId}/configs/{configRevisionId}`.
	Config string `json:"config" api:"required"`
	// Deprecated. Use `config`. Config revision identifier, populated during
	// migration.
	ConfigID string `json:"configId" api:"required"`
	// Timestamp when the deployment was created.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// ID of the endpoint that contains the deployment.
	EndpointID string `json:"endpointId" api:"required"`
	// Opaque version tag for optimistic concurrency control. Supply on update/delete
	// to ensure consistent read-modify-write. If not set, the write overwrites based
	// on current state.
	Etag string `json:"etag" api:"required"`
	// Hardware selected by the deployment config, including GPU type and count.
	Hardware string `json:"hardware" api:"required"`
	// Pinned model resource in the form
	// `projects/{projectId}/models/{modelId}/revisions/{revisionId}`.
	Model string `json:"model" api:"required"`
	// Deprecated. Use `model`. Model identifier being served, populated during
	// migration.
	ModelID string `json:"modelId" api:"required"`
	// Deprecated. Use `model` with a /revisions/{revisionId} segment. Pin to a
	// specific model revision.
	ModelRevisionID string `json:"modelRevisionId" api:"required"`
	// Project- and endpoint-qualified deployment name in the form
	// `<project_slug>/<endpoint_name>/<deployment_name>`. Pass it as `model` in an
	// inference request to target this deployment directly instead of using the
	// endpoint's traffic split.
	Name string `json:"name" api:"required"`
	// ID of the project that owns the deployment.
	ProjectID string `json:"projectId" api:"required"`
	// Current status of a deployment, derived at read time from internal state.
	Status DeploymentStatus `json:"status" api:"required"`
	// Whether the deployment serves client-visible responses or only mirrored shadow
	// traffic.
	//
	// Any of "TRAFFIC_MODE_LIVE", "TRAFFIC_MODE_SHADOW".
	TrafficMode EndpointDeploymentTrafficMode `json:"trafficMode" api:"required"`
	// Timestamp when the deployment was last updated.
	UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
	// Number of replicas the autoscaler currently wants across all regions. Not
	// settable on any request; steer it through `autoscaling.minReplicas` and
	// `autoscaling.maxReplicas`.
	DesiredReplicas int64 `json:"desiredReplicas"`
	// Estimated fraction in [0, 1] of endpoint traffic that reaches this deployment
	// under the current routing configuration. Absent or unrouted deployments are 0.
	EstimatedEffectiveTrafficShare float64 `json:"estimatedEffectiveTrafficShare"`
	// Minutes without an inference request before the deployment stops automatically.
	// Omitted or 0 means automatic stopping is disabled.
	InactiveTimeout int64 `json:"inactiveTimeout"`
	// Maximum number of inference requests that may be in flight to a single replica.
	// If omitted, the platform uses one less than the config's per-replica concurrency
	// limit to reserve a health-check slot. Values above that maximum are reduced on
	// create and update; 0 means unlimited when the config limit is 1 or less. Changes
	// take effect without restarting replicas.
	MaxConcurrentRequestsPerReplica string `json:"maxConcurrentRequestsPerReplica"`
	// Placement controls where a deployment is scheduled.
	Placement EndpointDeploymentPlacementUnion `json:"placement"`
	// Runtime information derived from the deployment's configuration.
	RuntimeInfo RuntimeInfo `json:"runtimeInfo"`
	// Pinned draft-model resource used for speculative decoding, in the same form as
	// `model`. Omitted when speculative decoding is disabled.
	Speculator string `json:"speculator"`
	// Deprecated. Use `speculator`. Speculative decoding model identifier derived from
	// the deployment config.
	SpeculatorID string `json:"speculatorId"`
	// Deprecated. Use `speculator`. ID of the speculative decoding draft-model
	// revision pinned at creation time.
	SpeculatorRevisionID string `json:"speculatorRevisionId"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                              respjson.Field
		Autoscaling                     respjson.Field
		Config                          respjson.Field
		ConfigID                        respjson.Field
		CreatedAt                       respjson.Field
		EndpointID                      respjson.Field
		Etag                            respjson.Field
		Hardware                        respjson.Field
		Model                           respjson.Field
		ModelID                         respjson.Field
		ModelRevisionID                 respjson.Field
		Name                            respjson.Field
		ProjectID                       respjson.Field
		Status                          respjson.Field
		TrafficMode                     respjson.Field
		UpdatedAt                       respjson.Field
		DesiredReplicas                 respjson.Field
		EstimatedEffectiveTrafficShare  respjson.Field
		InactiveTimeout                 respjson.Field
		MaxConcurrentRequestsPerReplica respjson.Field
		Placement                       respjson.Field
		RuntimeInfo                     respjson.Field
		Speculator                      respjson.Field
		SpeculatorID                    respjson.Field
		SpeculatorRevisionID            respjson.Field
		ExtraFields                     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Serving workload that binds a model and immutable config to an endpoint and manages its replicas.

func (EndpointDeployment) RawJSON added in v0.11.0

func (r EndpointDeployment) RawJSON() string

Returns the unmodified JSON received from the API

func (*EndpointDeployment) UnmarshalJSON added in v0.11.0

func (r *EndpointDeployment) UnmarshalJSON(data []byte) error

type EndpointDeploymentAutoscaling added in v0.11.0

type EndpointDeploymentAutoscaling struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	DeploymentAutoscaling
}

Replica bounds, timing windows, and metrics that control horizontal scaling.

func (EndpointDeploymentAutoscaling) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*EndpointDeploymentAutoscaling) UnmarshalJSON added in v0.11.0

func (r *EndpointDeploymentAutoscaling) UnmarshalJSON(data []byte) error

type EndpointDeploymentDeleteParams added in v0.13.0

type EndpointDeploymentDeleteParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Etag for optimistic concurrency. If set, the delete is rejected if the current
	// etag does not match.
	Etag param.Opt[string] `query:"etag,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointDeploymentDeleteParams) URLQuery added in v0.13.0

func (r EndpointDeploymentDeleteParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointDeploymentDeleteParams's query parameters as `url.Values`.

type EndpointDeploymentDeleteResponse added in v0.13.0

type EndpointDeploymentDeleteResponse struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Empty response returned after a successful delete operation.

func (EndpointDeploymentDeleteResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*EndpointDeploymentDeleteResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointDeploymentDeleteResponse) UnmarshalJSON(data []byte) error

type EndpointDeploymentGetParams added in v0.13.0

type EndpointDeploymentGetParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type EndpointDeploymentListParams added in v0.13.0

type EndpointDeploymentListParams struct {
	// ID of the project that owns the endpoint.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous deployment list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Filter expression using `name`, `state`, `model`, `created_at`, or `updated_at`
	// with comparison operators and AND/OR/NOT; `state` takes a DeploymentState enum
	// name and `model` takes a model resource name. `name` supports substring matching
	// with `:` and prefix/suffix wildcards with `*`, and accepts a bare deployment
	// name or `<project_slug>/<endpoint_name>/<deployment_name>`.
	Filter param.Opt[string] `query:"filter,omitzero" json:"-"`
	// Maximum number of deployments to return. Max 500, defaults to 50.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Sort field for the results. Supports `created_at` or `updated_at`, optionally
	// followed by `asc` or `desc`.
	OrderBy param.Opt[string] `query:"orderBy,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointDeploymentListParams) URLQuery added in v0.13.0

func (r EndpointDeploymentListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointDeploymentListParams's query parameters as `url.Values`.

type EndpointDeploymentNewParams added in v0.13.0

type EndpointDeploymentNewParams struct {
	// ID of the project that owns the endpoint.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Autoscaling configuration for a deployment.
	Autoscaling DeploymentAutoscalingParam `json:"autoscaling,omitzero" api:"required"`
	// Name for the deployment within its endpoint. Returned as a fully-qualified
	// endpoint string.
	Name string `json:"name" api:"required"`
	// When true, validates the request without creating or provisioning a deployment.
	ValidateOnly param.Opt[bool] `query:"validateOnly,omitzero" json:"-"`
	// Immutable config revision in the form
	// `projects/{projectId}/configs/{configRevisionId}`. The config must be compatible
	// with the model.
	Config param.Opt[string] `json:"config,omitzero"`
	// Deprecated. Use `config`. Config revision identifier to deploy, accepted when
	// `config` is unset.
	ConfigID param.Opt[string] `json:"configId,omitzero"`
	// Inactive timeout in minutes. Use 0 or omit to disable automatic stopping;
	// otherwise accepted values are 30 through 1440.
	InactiveTimeout param.Opt[int64] `json:"inactiveTimeout,omitzero"`
	// Maximum number of inference requests that may be in flight to a single replica.
	// If omitted, the platform uses one less than the config's per-replica concurrency
	// limit to reserve a health-check slot. Values above that maximum are reduced on
	// create; 0 means unlimited when the config limit is 1 or less.
	MaxConcurrentRequestsPerReplica param.Opt[string] `json:"maxConcurrentRequestsPerReplica,omitzero"`
	// Model resource name in the form
	// `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omit the
	// revision segment to pin the latest revision at creation time.
	Model param.Opt[string] `json:"model,omitzero"`
	// Deprecated. Use `model`. Model identifier to serve, accepted when `model` is
	// unset.
	ModelID param.Opt[string] `json:"modelId,omitzero"`
	// Deprecated. Use `model` with a /revisions/{revisionId} segment. If omitted, the
	// latest revision is resolved at creation.
	ModelRevisionID param.Opt[string] `json:"modelRevisionId,omitzero"`
	// Placement controls where a deployment is scheduled.
	Placement EndpointDeploymentNewParamsPlacementUnion `json:"placement,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointDeploymentNewParams) MarshalJSON added in v0.13.0

func (r EndpointDeploymentNewParams) MarshalJSON() (data []byte, err error)

func (EndpointDeploymentNewParams) URLQuery added in v0.13.0

func (r EndpointDeploymentNewParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointDeploymentNewParams's query parameters as `url.Values`.

func (*EndpointDeploymentNewParams) UnmarshalJSON added in v0.13.0

func (r *EndpointDeploymentNewParams) UnmarshalJSON(data []byte) error

type EndpointDeploymentNewParamsPlacementInline added in v0.13.0

type EndpointDeploymentNewParamsPlacementInline struct {
	// Inline placement parameters expanded into scheduling rules by the server.
	Inline DeploymentPlacementConfigParam `json:"inline,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The property Inline is required.

func (EndpointDeploymentNewParamsPlacementInline) MarshalJSON added in v0.13.0

func (r EndpointDeploymentNewParamsPlacementInline) MarshalJSON() (data []byte, err error)

func (*EndpointDeploymentNewParamsPlacementInline) UnmarshalJSON added in v0.13.0

func (r *EndpointDeploymentNewParamsPlacementInline) UnmarshalJSON(data []byte) error

type EndpointDeploymentNewParamsPlacementProfile added in v0.13.0

type EndpointDeploymentNewParamsPlacementProfile struct {
	// UID of a saved placement profile.
	Profile string `json:"profile" api:"required"`
	// contains filtered or unexported fields
}

The property Profile is required.

func (EndpointDeploymentNewParamsPlacementProfile) MarshalJSON added in v0.13.0

func (r EndpointDeploymentNewParamsPlacementProfile) MarshalJSON() (data []byte, err error)

func (*EndpointDeploymentNewParamsPlacementProfile) UnmarshalJSON added in v0.13.0

func (r *EndpointDeploymentNewParamsPlacementProfile) UnmarshalJSON(data []byte) error

type EndpointDeploymentNewParamsPlacementUnion added in v0.13.0

type EndpointDeploymentNewParamsPlacementUnion struct {
	OfInline  *EndpointDeploymentNewParamsPlacementInline  `json:",omitzero,inline"`
	OfProfile *EndpointDeploymentNewParamsPlacementProfile `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EndpointDeploymentNewParamsPlacementUnion) MarshalJSON added in v0.13.0

func (*EndpointDeploymentNewParamsPlacementUnion) UnmarshalJSON added in v0.13.0

func (u *EndpointDeploymentNewParamsPlacementUnion) UnmarshalJSON(data []byte) error

type EndpointDeploymentPlacementInline added in v0.11.0

type EndpointDeploymentPlacementInline struct {
	// Inline placement parameters expanded into scheduling rules by the server.
	Inline DeploymentPlacementConfig `json:"inline" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Inline      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EndpointDeploymentPlacementInline) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*EndpointDeploymentPlacementInline) UnmarshalJSON added in v0.11.0

func (r *EndpointDeploymentPlacementInline) UnmarshalJSON(data []byte) error

type EndpointDeploymentPlacementProfile added in v0.11.0

type EndpointDeploymentPlacementProfile struct {
	// UID of a saved placement profile.
	Profile string `json:"profile" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Profile     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EndpointDeploymentPlacementProfile) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*EndpointDeploymentPlacementProfile) UnmarshalJSON added in v0.11.0

func (r *EndpointDeploymentPlacementProfile) UnmarshalJSON(data []byte) error

type EndpointDeploymentPlacementUnion added in v0.11.0

type EndpointDeploymentPlacementUnion struct {
	// This field is from variant [EndpointDeploymentPlacementInline].
	Inline DeploymentPlacementConfig `json:"inline"`
	// This field is from variant [EndpointDeploymentPlacementProfile].
	Profile string `json:"profile"`
	JSON    struct {
		Inline  respjson.Field
		Profile respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

EndpointDeploymentPlacementUnion contains all possible properties and values from EndpointDeploymentPlacementInline, EndpointDeploymentPlacementProfile.

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: Inline]

func (EndpointDeploymentPlacementUnion) AsInline added in v0.11.0

func (EndpointDeploymentPlacementUnion) AsProfile added in v0.11.0

func (EndpointDeploymentPlacementUnion) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*EndpointDeploymentPlacementUnion) UnmarshalJSON added in v0.11.0

func (r *EndpointDeploymentPlacementUnion) UnmarshalJSON(data []byte) error

type EndpointDeploymentService added in v0.13.0

type EndpointDeploymentService struct {
	Options []option.RequestOption
}

EndpointDeploymentService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEndpointDeploymentService method instead.

func NewEndpointDeploymentService added in v0.13.0

func NewEndpointDeploymentService(opts ...option.RequestOption) (r EndpointDeploymentService)

NewEndpointDeploymentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EndpointDeploymentService) Delete added in v0.13.0

Permanently deletes a deployment from its endpoint. Remove the deployment from live traffic first; use `etag` to reject the request if it changed after it was read.

func (*EndpointDeploymentService) Get added in v0.13.0

Retrieves a deployment's desired configuration, placement, runtime information, and current provisioning status.

func (*EndpointDeploymentService) List added in v0.13.0

Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status.

func (*EndpointDeploymentService) ListAutoPaging added in v0.13.0

Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status.

func (*EndpointDeploymentService) New added in v0.13.0

Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it.

func (*EndpointDeploymentService) Update added in v0.13.0

Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning.

type EndpointDeploymentSummary added in v0.11.0

type EndpointDeploymentSummary struct {
	// Deployment identifier.
	ID string `json:"id" api:"required"`
	// Autoscaling configuration for the deployment.
	Autoscaling EndpointDeploymentSummaryAutoscaling `json:"autoscaling" api:"required"`
	// Timestamp when the deployment was created.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// Estimated fraction from 0 to 1 of endpoint traffic currently routed to this
	// deployment.
	EstimatedEffectiveTrafficShare float64 `json:"estimatedEffectiveTrafficShare" api:"required"`
	// Resource name of the served model in the form
	// `projects/{projectId}/models/{modelId}/revisions/{revisionId}`. For public
	// models, the model's owning project may differ from the deployment's project.
	Model string `json:"model" api:"required"`
	// Deprecated. Use `model`. Model identifier being served.
	ModelID string `json:"modelId" api:"required"`
	// Inference-addressable name in the fully-qualified form
	// "<project_slug>/<endpoint_name>/<deployment_name>". Pass it as the "model" field
	// when calling the inference API to pin to this deployment.
	Name string `json:"name" api:"required"`
	// Current state of the deployment.
	//
	// Any of "DEPLOYMENT_STATE_PROVISIONING", "DEPLOYMENT_STATE_READY",
	// "DEPLOYMENT_STATE_SCALING", "DEPLOYMENT_STATE_DEGRADED",
	// "DEPLOYMENT_STATE_FAILED", "DEPLOYMENT_STATE_STOPPED",
	// "DEPLOYMENT_STATE_STOPPING".
	State EndpointDeploymentSummaryState `json:"state" api:"required"`
	// Whether the deployment serves client-visible responses or only mirrored shadow
	// traffic.
	//
	// Any of "TRAFFIC_MODE_LIVE", "TRAFFIC_MODE_SHADOW".
	TrafficMode EndpointDeploymentSummaryTrafficMode `json:"trafficMode" api:"required"`
	// Number of replicas the autoscaler currently wants across all regions.
	DesiredReplicas int64 `json:"desiredReplicas"`
	// Hardware configuration selected by the deployment's config, such as its GPU type
	// and count.
	Hardware string `json:"hardware"`
	// Number of replicas currently ready to serve requests across all regions.
	ReadyReplicas int64 `json:"readyReplicas"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                             respjson.Field
		Autoscaling                    respjson.Field
		CreatedAt                      respjson.Field
		EstimatedEffectiveTrafficShare respjson.Field
		Model                          respjson.Field
		ModelID                        respjson.Field
		Name                           respjson.Field
		State                          respjson.Field
		TrafficMode                    respjson.Field
		DesiredReplicas                respjson.Field
		Hardware                       respjson.Field
		ReadyReplicas                  respjson.Field
		ExtraFields                    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compact deployment status embedded in an endpoint response.

func (EndpointDeploymentSummary) RawJSON added in v0.11.0

func (r EndpointDeploymentSummary) RawJSON() string

Returns the unmodified JSON received from the API

func (*EndpointDeploymentSummary) UnmarshalJSON added in v0.11.0

func (r *EndpointDeploymentSummary) UnmarshalJSON(data []byte) error

type EndpointDeploymentSummaryAutoscaling added in v0.11.0

type EndpointDeploymentSummaryAutoscaling struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	DeploymentAutoscaling
}

Autoscaling configuration for the deployment.

func (EndpointDeploymentSummaryAutoscaling) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*EndpointDeploymentSummaryAutoscaling) UnmarshalJSON added in v0.11.0

func (r *EndpointDeploymentSummaryAutoscaling) UnmarshalJSON(data []byte) error

type EndpointDeploymentSummaryState added in v0.11.0

type EndpointDeploymentSummaryState string

Current state of the deployment.

const (
	EndpointDeploymentSummaryStateDeploymentStateProvisioning EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_PROVISIONING"
	EndpointDeploymentSummaryStateDeploymentStateReady        EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_READY"
	EndpointDeploymentSummaryStateDeploymentStateScaling      EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_SCALING"
	EndpointDeploymentSummaryStateDeploymentStateDegraded     EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_DEGRADED"
	EndpointDeploymentSummaryStateDeploymentStateFailed       EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_FAILED"
	EndpointDeploymentSummaryStateDeploymentStateStopped      EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_STOPPED"
	EndpointDeploymentSummaryStateDeploymentStateStopping     EndpointDeploymentSummaryState = "DEPLOYMENT_STATE_STOPPING"
)

type EndpointDeploymentSummaryTrafficMode added in v0.11.0

type EndpointDeploymentSummaryTrafficMode string

Whether the deployment serves client-visible responses or only mirrored shadow traffic.

const (
	EndpointDeploymentSummaryTrafficModeTrafficModeLive   EndpointDeploymentSummaryTrafficMode = "TRAFFIC_MODE_LIVE"
	EndpointDeploymentSummaryTrafficModeTrafficModeShadow EndpointDeploymentSummaryTrafficMode = "TRAFFIC_MODE_SHADOW"
)

type EndpointDeploymentTrafficMode added in v0.11.0

type EndpointDeploymentTrafficMode string

Whether the deployment serves client-visible responses or only mirrored shadow traffic.

const (
	EndpointDeploymentTrafficModeTrafficModeLive   EndpointDeploymentTrafficMode = "TRAFFIC_MODE_LIVE"
	EndpointDeploymentTrafficModeTrafficModeShadow EndpointDeploymentTrafficMode = "TRAFFIC_MODE_SHADOW"
)

type EndpointDeploymentUpdateParams added in v0.13.0

type EndpointDeploymentUpdateParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Fields to update. If not set, the fields populated on `deployment` are updated.
	UpdateMask param.Opt[string] `query:"updateMask,omitzero" json:"-"`
	// Current deployment version. The update is rejected if this value no longer
	// matches.
	Etag param.Opt[string] `json:"etag,omitzero"`
	// Updated inactive timeout in minutes. Use 0 to disable automatic stopping;
	// otherwise accepted values are 30 through 1440.
	InactiveTimeout param.Opt[int64] `json:"inactiveTimeout,omitzero"`
	// Updated maximum number of inference requests that may be in flight to a single
	// replica. Values above the deployment config's per-replica concurrency limit
	// minus one are reduced on update; 0 means unlimited when the config limit is 1 or
	// less. Changes take effect without restarting replicas.
	MaxConcurrentRequestsPerReplica param.Opt[string] `json:"maxConcurrentRequestsPerReplica,omitzero"`
	// Updated endpoint string.
	Name param.Opt[string] `json:"name,omitzero"`
	// Autoscaling configuration for a deployment.
	Autoscaling DeploymentAutoscalingParam `json:"autoscaling,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointDeploymentUpdateParams) MarshalJSON added in v0.13.0

func (r EndpointDeploymentUpdateParams) MarshalJSON() (data []byte, err error)

func (EndpointDeploymentUpdateParams) URLQuery added in v0.13.0

func (r EndpointDeploymentUpdateParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointDeploymentUpdateParams's query parameters as `url.Values`.

func (*EndpointDeploymentUpdateParams) UnmarshalJSON added in v0.13.0

func (r *EndpointDeploymentUpdateParams) UnmarshalJSON(data []byte) error

type EndpointEndpointType added in v0.11.0

type EndpointEndpointType string

Serving class of the endpoint. Reserved endpoints use reserved capacity.

const (
	EndpointEndpointTypeEndpointTypeDedicated  EndpointEndpointType = "ENDPOINT_TYPE_DEDICATED"
	EndpointEndpointTypeEndpointTypeServerless EndpointEndpointType = "ENDPOINT_TYPE_SERVERLESS"
	EndpointEndpointTypeEndpointTypeReserved   EndpointEndpointType = "ENDPOINT_TYPE_RESERVED"
)

type EndpointGetParams added in v0.13.0

type EndpointGetParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type EndpointHardwareListResponse added in v0.13.0

type EndpointHardwareListResponse struct {
	// Instance types available for inference.
	Data []InferenceInstanceType `json:"data" api:"required"`
	// Object type. Always `list`.
	Object constant.List `json:"object" default:"list"`
	// Cursor for the next page. Always null today because this catalog is returned in
	// full.
	NextCursor string `json:"next_cursor"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Object      respjson.Field
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Hardware instance types available for inference deployments.

func (EndpointHardwareListResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*EndpointHardwareListResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointHardwareListResponse) UnmarshalJSON(data []byte) error

type EndpointHardwareService added in v0.13.0

type EndpointHardwareService struct {
	Options []option.RequestOption
}

EndpointHardwareService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEndpointHardwareService method instead.

func NewEndpointHardwareService added in v0.13.0

func NewEndpointHardwareService(opts ...option.RequestOption) (r EndpointHardwareService)

NewEndpointHardwareService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EndpointHardwareService) Get added in v0.13.0

Retrieves the GPU resources, pricing, regional availability, and best-effort capacity headroom for one inference instance type.

func (*EndpointHardwareService) List added in v0.13.0

Lists hardware instance types currently available to inference deployments, including GPU resources, pricing, regions, and best-effort capacity headroom.

type EndpointListEventsParams added in v0.13.0

type EndpointListEventsParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous endpoint event list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of events to return. Max 10000, defaults to 50.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Return only events at or after this time.
	Since param.Opt[time.Time] `query:"since,omitzero" format:"date-time" json:"-"`
	// ID of a subject associated with the event, such as a rollout. Combined with
	// other filters using AND.
	SubjectID param.Opt[string] `query:"subjectId,omitzero" json:"-"`
	// Return only events strictly before this time.
	Until param.Opt[time.Time] `query:"until,omitzero" format:"date-time" json:"-"`
	// Deployment IDs whose events should be included. Every ID must belong to the
	// endpoint. Supplying this filter excludes endpoint-scoped events unless
	// `SOURCE_KIND_ENDPOINT` is also included in `sourceKinds`.
	DeploymentIDs []string `query:"deploymentIds,omitzero" json:"-"`
	// Minimum severity. Omit to disable severity filtering.
	//
	// Any of "LEVEL_DEBUG", "LEVEL_INFO", "LEVEL_WARN", "LEVEL_ERROR".
	MinLevel EndpointListEventsParamsMinLevel `query:"minLevel,omitzero" json:"-"`
	// Resource kinds whose events should be included. Omit to include both endpoint-
	// and deployment-scoped events.
	//
	// Any of "SOURCE_KIND_ENDPOINT", "SOURCE_KIND_DEPLOYMENT".
	SourceKinds []string `query:"sourceKinds,omitzero" json:"-"`
	// Event types to include, such as `deployment.scaled` or `condition.set`. Combined
	// with other filters using AND.
	Types []string `query:"types,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointListEventsParams) URLQuery added in v0.13.0

func (r EndpointListEventsParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointListEventsParams's query parameters as `url.Values`.

type EndpointListEventsParamsMinLevel added in v0.13.0

type EndpointListEventsParamsMinLevel string

Minimum severity. Omit to disable severity filtering.

const (
	EndpointListEventsParamsMinLevelLevelDebug EndpointListEventsParamsMinLevel = "LEVEL_DEBUG"
	EndpointListEventsParamsMinLevelLevelInfo  EndpointListEventsParamsMinLevel = "LEVEL_INFO"
	EndpointListEventsParamsMinLevelLevelWarn  EndpointListEventsParamsMinLevel = "LEVEL_WARN"
	EndpointListEventsParamsMinLevelLevelError EndpointListEventsParamsMinLevel = "LEVEL_ERROR"
)

type EndpointListEventsResponse added in v0.13.0

type EndpointListEventsResponse struct {
	// Output only. Unique event identifier.
	ID string `json:"id" api:"required"`
	// Output only. Event creation time.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// Output only. The endpoint this event belongs to. Always set.
	EndpointID string `json:"endpointId" api:"required"`
	// Output only. Severity level.
	//
	// Any of "LEVEL_DEBUG", "LEVEL_INFO", "LEVEL_WARN", "LEVEL_ERROR".
	Level EndpointListEventsResponseLevel `json:"level" api:"required"`
	// Output only. Service, cluster, or controller that emitted the event.
	Source string `json:"source" api:"required"`
	// Output only. Whether this row describes the endpoint or one of its deployments.
	//
	// Any of "SOURCE_KIND_ENDPOINT", "SOURCE_KIND_DEPLOYMENT".
	SourceKind EndpointListEventsResponseSourceKind `json:"sourceKind" api:"required"`
	// Output only. Stable event type, such as `endpoint.updated`,
	// `deployment.created`, `deployment.scaled`, `condition.set`, or `pod.log`.
	Type string `json:"type" api:"required"`
	// ID of the cluster associated with a cluster-scoped event.
	ClusterID string `json:"clusterId"`
	// Stable public component label associated with a replica event, such as `engine`,
	// `model-download`, or `sidecar`.
	ContainerName string `json:"containerName"`
	// Output only. Deployment associated with the event when `sourceKind` is
	// `SOURCE_KIND_DEPLOYMENT`.
	DeploymentID string `json:"deploymentId"`
	// Short diagnostic log excerpt captured with a pod event, for example during a
	// crash, out-of-memory termination, or image pull failure. This field is truncated
	// and is not a streaming log API.
	LogExcerpt string `json:"logExcerpt"`
	// Output only. Human-readable description of the event. Short and stable; not
	// structured data.
	Message string `json:"message"`
	// Resource name at the time of the event. Populated by: deployment.created,
	// deployment.deleted, endpoint.created, endpoint.deleted
	Name string `json:"name"`
	// New replica count for a `deployment.scaled` event.
	NewReplicas int64 `json:"newReplicas"`
	// Opaque node handle for correlating replica failures on the same node. Omitted
	// when the replica is unscheduled or the node is unknown.
	NodeID string `json:"nodeId"`
	// Replica-count transition. Populated by: deployment.scaled
	OldReplicas int64 `json:"oldReplicas"`
	// Field-mask paths that were modified. Populated by: deployment.updated,
	// endpoint.updated
	Paths []string `json:"paths"`
	// Stable condition reason, such as `AllReplicasReady`, `ReplicasProgressing`, or
	// `ApplySuccessful`.
	Reason string `json:"reason"`
	// Opaque replica identity associated with a `pod.*` event, stable for grouping
	// events from the same replica.
	ReplicaID string `json:"replicaId"`
	// Deployment subservice associated with the event, such as `model-deployment` or
	// `speculator-deployment`.
	ServiceType string `json:"serviceType"`
	// Condition status for `condition.set` and `cluster_condition.set`: `True`,
	// `False`, or `Unknown`. The condition type is carried in `subjectId`.
	Status string `json:"status"`
	// Output only. ID of the event's subject, such as a rollout, shadow target, or
	// condition type.
	SubjectID string `json:"subjectId"`
	// Target version. Populated by `target.created`; the target ID is carried in
	// `subjectId`.
	Version int64 `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		EndpointID    respjson.Field
		Level         respjson.Field
		Source        respjson.Field
		SourceKind    respjson.Field
		Type          respjson.Field
		ClusterID     respjson.Field
		ContainerName respjson.Field
		DeploymentID  respjson.Field
		LogExcerpt    respjson.Field
		Message       respjson.Field
		Name          respjson.Field
		NewReplicas   respjson.Field
		NodeID        respjson.Field
		OldReplicas   respjson.Field
		Paths         respjson.Field
		Reason        respjson.Field
		ReplicaID     respjson.Field
		ServiceType   respjson.Field
		Status        respjson.Field
		SubjectID     respjson.Field
		Version       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One endpoint- or deployment-scoped entry in an endpoint's combined audit and lifecycle feed.

func (EndpointListEventsResponse) RawJSON added in v0.13.0

func (r EndpointListEventsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EndpointListEventsResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointListEventsResponse) UnmarshalJSON(data []byte) error

type EndpointListEventsResponseLevel added in v0.13.0

type EndpointListEventsResponseLevel string

Output only. Severity level.

const (
	EndpointListEventsResponseLevelLevelDebug EndpointListEventsResponseLevel = "LEVEL_DEBUG"
	EndpointListEventsResponseLevelLevelInfo  EndpointListEventsResponseLevel = "LEVEL_INFO"
	EndpointListEventsResponseLevelLevelWarn  EndpointListEventsResponseLevel = "LEVEL_WARN"
	EndpointListEventsResponseLevelLevelError EndpointListEventsResponseLevel = "LEVEL_ERROR"
)

type EndpointListEventsResponseSourceKind added in v0.13.0

type EndpointListEventsResponseSourceKind string

Output only. Whether this row describes the endpoint or one of its deployments.

const (
	EndpointListEventsResponseSourceKindSourceKindEndpoint   EndpointListEventsResponseSourceKind = "SOURCE_KIND_ENDPOINT"
	EndpointListEventsResponseSourceKindSourceKindDeployment EndpointListEventsResponseSourceKind = "SOURCE_KIND_DEPLOYMENT"
)

type EndpointListOrgScopedParams added in v0.13.0

type EndpointListOrgScopedParams struct {
	// Cursor from a previous list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Filter expression using `name`, `created_at`, or `updated_at` with comparison
	// operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports
	// substring matching with `:` and prefix/suffix wildcards with `*`, and must be a
	// bare endpoint name.
	Filter param.Opt[string] `query:"filter,omitzero" json:"-"`
	// Maximum number of results to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Sort field for the results. Supports `created_at` or `updated_at`, optionally
	// followed by `asc` or `desc`.
	OrderBy param.Opt[string] `query:"orderBy,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointListOrgScopedParams) URLQuery added in v0.13.0

func (r EndpointListOrgScopedParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointListOrgScopedParams's query parameters as `url.Values`.

type EndpointListParams

type EndpointListParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Filter expression using `name`, `created_at`, or `updated_at` with comparison
	// operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports
	// substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a
	// bare endpoint name or `<project_slug>/<endpoint_name>`.
	Filter param.Opt[string] `query:"filter,omitzero" json:"-"`
	// Maximum number of endpoints to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Sort field for the results. Supports `created_at` or `updated_at`, optionally
	// followed by `asc` or `desc`.
	OrderBy param.Opt[string] `query:"orderBy,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointListParams) URLQuery

func (r EndpointListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointListParams's query parameters as `url.Values`.

type EndpointNewParams

type EndpointNewParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Inference-addressable endpoint name to create.
	Name string `json:"name" api:"required"`
	// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project;
	// `VISIBILITY_INTERNAL` shares it with the organization.
	//
	// Any of "VISIBILITY_PRIVATE", "VISIBILITY_INTERNAL".
	Visibility EndpointNewParamsVisibility `json:"visibility,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointNewParams) MarshalJSON

func (r EndpointNewParams) MarshalJSON() (data []byte, err error)

func (*EndpointNewParams) UnmarshalJSON

func (r *EndpointNewParams) UnmarshalJSON(data []byte) error

type EndpointNewParamsVisibility added in v0.13.0

type EndpointNewParamsVisibility string

Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.

const (
	EndpointNewParamsVisibilityVisibilityPrivate  EndpointNewParamsVisibility = "VISIBILITY_PRIVATE"
	EndpointNewParamsVisibilityVisibilityInternal EndpointNewParamsVisibility = "VISIBILITY_INTERNAL"
)

type EndpointPlacementProfileGetParams added in v0.13.0

type EndpointPlacementProfileGetParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type EndpointPlacementProfileListParams added in v0.13.0

type EndpointPlacementProfileListParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous placement profile list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of profiles to return. Max 500, defaults to 50.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointPlacementProfileListParams) URLQuery added in v0.13.0

func (r EndpointPlacementProfileListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointPlacementProfileListParams's query parameters as `url.Values`.

type EndpointPlacementProfileService added in v0.13.0

type EndpointPlacementProfileService struct {
	Options []option.RequestOption
}

EndpointPlacementProfileService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEndpointPlacementProfileService method instead.

func NewEndpointPlacementProfileService added in v0.13.0

func NewEndpointPlacementProfileService(opts ...option.RequestOption) (r EndpointPlacementProfileService)

NewEndpointPlacementProfileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EndpointPlacementProfileService) Get added in v0.13.0

Retrieves a reusable placement profile and its ordered region preferences.

func (*EndpointPlacementProfileService) List added in v0.13.0

Lists reusable, project-visible placement policies that control the regions where deployments may be scheduled.

func (*EndpointPlacementProfileService) ListAutoPaging added in v0.13.0

Lists reusable, project-visible placement policies that control the regions where deployments may be scheduled.

type EndpointRolloutCancelParams added in v0.13.0

type EndpointRolloutCancelParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Required human-readable reason recorded in the rollout audit trail.
	Reason string `json:"reason" api:"required"`
	// Optional etag for optimistic concurrency.
	Etag param.Opt[string] `json:"etag,omitzero"`
	// Optional cancel behavior. Absent defaults to freeze, which preserves the current
	// traffic split. Revert is removed and rejected with FAILED_PRECONDITION; cancel
	// with freeze, then run a reverse rollout back to the source.
	//
	// Any of "CANCEL_DISPOSITION_FREEZE", "CANCEL_DISPOSITION_REVERT".
	Disposition EndpointRolloutCancelParamsDisposition `json:"disposition,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointRolloutCancelParams) MarshalJSON added in v0.13.0

func (r EndpointRolloutCancelParams) MarshalJSON() (data []byte, err error)

func (*EndpointRolloutCancelParams) UnmarshalJSON added in v0.13.0

func (r *EndpointRolloutCancelParams) UnmarshalJSON(data []byte) error

type EndpointRolloutCancelParamsDisposition added in v0.13.0

type EndpointRolloutCancelParamsDisposition string

Optional cancel behavior. Absent defaults to freeze, which preserves the current traffic split. Revert is removed and rejected with FAILED_PRECONDITION; cancel with freeze, then run a reverse rollout back to the source.

const (
	EndpointRolloutCancelParamsDispositionCancelDispositionFreeze EndpointRolloutCancelParamsDisposition = "CANCEL_DISPOSITION_FREEZE"
	EndpointRolloutCancelParamsDispositionCancelDispositionRevert EndpointRolloutCancelParamsDisposition = "CANCEL_DISPOSITION_REVERT"
)

type EndpointRolloutDeleteParams added in v0.13.0

type EndpointRolloutDeleteParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Etag for optimistic concurrency.
	Etag param.Opt[string] `query:"etag,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointRolloutDeleteParams) URLQuery added in v0.13.0

func (r EndpointRolloutDeleteParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointRolloutDeleteParams's query parameters as `url.Values`.

type EndpointRolloutDeleteResponse added in v0.13.0

type EndpointRolloutDeleteResponse struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Empty response returned after a successful delete operation.

func (EndpointRolloutDeleteResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*EndpointRolloutDeleteResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointRolloutDeleteResponse) UnmarshalJSON(data []byte) error

type EndpointRolloutGetParams added in v0.13.0

type EndpointRolloutGetParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type EndpointRolloutListParams added in v0.13.0

type EndpointRolloutListParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous rollout list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of rollouts to return. Max 500, defaults to 50.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Narrow results to active or terminal rollouts. Omit to list all rollouts.
	//
	// Any of "ROLLOUT_FILTER_ACTIVE", "ROLLOUT_FILTER_TERMINAL".
	Filter EndpointRolloutListParamsFilter `query:"filter,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointRolloutListParams) URLQuery added in v0.13.0

func (r EndpointRolloutListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointRolloutListParams's query parameters as `url.Values`.

type EndpointRolloutListParamsFilter added in v0.13.0

type EndpointRolloutListParamsFilter string

Narrow results to active or terminal rollouts. Omit to list all rollouts.

const (
	EndpointRolloutListParamsFilterRolloutFilterActive   EndpointRolloutListParamsFilter = "ROLLOUT_FILTER_ACTIVE"
	EndpointRolloutListParamsFilterRolloutFilterTerminal EndpointRolloutListParamsFilter = "ROLLOUT_FILTER_TERMINAL"
)

type EndpointRolloutNewParams added in v0.13.0

type EndpointRolloutNewParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Deployment that traffic shifts away from.
	SourceDeploymentID string `json:"sourceDeploymentId" api:"required"`
	// Deployment that traffic shifts toward.
	TargetDeploymentID string `json:"targetDeploymentId" api:"required"`
	// Optional final replica count for the source deployment. Defaults to 0, which
	// drains and stops the source.
	FinalSourceReplicas param.Opt[int64] `json:"finalSourceReplicas,omitzero"`
	// Optional target replica floor at completion. Must be at least 1 when set;
	// defaults to the source deployment's replica count at create time, or to the
	// source and target deployments' combined replica count when both already stand in
	// the endpoint traffic split after a cancel. The completed target's autoscaling
	// max lands at the landing ceiling, max(this value, the source max, the target's
	// own max); the rollout may lift the target max at first wake, at the first step
	// that needs it, or at completion unless an operator changes max mid-run. The
	// lifted ceiling remains after completion, and PreviewRolloutDefaults reports a
	// coming lift as ROLLOUT_WILL_RAISE_TARGET_MAX. A pre-existing target whose own
	// autoscaling min is higher keeps that floor, reported as
	// FINAL_BELOW_INHERITED_MIN. A target that starts stopped lands exactly at this
	// value; if the source min was higher, PreviewRolloutDefaults reports
	// FINAL_BELOW_SOURCE_MIN.
	FinalTargetReplicas param.Opt[int64] `json:"finalTargetReplicas,omitzero"`
	// Blue-green strategy configuration for a single cutover to the target deployment.
	BlueGreen BlueGreenConfigParam `json:"blueGreen,omitzero"`
	// Canary strategy configuration for gradual traffic progression. An empty config
	// uses the default 5, 25, 50, 100 percent ladder; over a frozen traffic-split pair
	// left by cancel, the default ladder is derived at start from the pair's current
	// served share so it begins above it.
	Canary CanaryConfigParam `json:"canary,omitzero"`
	// Optional metric gates evaluated after each step's soak. Canary only; rejected on
	// rolling and blue-green rollouts.
	Metrics []MetricRuleParam `json:"metrics,omitzero"`
	// Rolling strategy configuration for small batches that ramp target replicas up
	// while shrinking source replicas to what their remaining traffic share needs.
	Rolling RollingConfigParam `json:"rolling,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointRolloutNewParams) MarshalJSON added in v0.13.0

func (r EndpointRolloutNewParams) MarshalJSON() (data []byte, err error)

func (*EndpointRolloutNewParams) UnmarshalJSON added in v0.13.0

func (r *EndpointRolloutNewParams) UnmarshalJSON(data []byte) error

type EndpointRolloutPauseParams added in v0.13.0

type EndpointRolloutPauseParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Optional etag for optimistic concurrency.
	Etag param.Opt[string] `json:"etag,omitzero"`
	// Optional human-readable reason recorded on the rollout pause metadata.
	Reason param.Opt[string] `json:"reason,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointRolloutPauseParams) MarshalJSON added in v0.13.0

func (r EndpointRolloutPauseParams) MarshalJSON() (data []byte, err error)

func (*EndpointRolloutPauseParams) UnmarshalJSON added in v0.13.0

func (r *EndpointRolloutPauseParams) UnmarshalJSON(data []byte) error

type EndpointRolloutPreviewDefaultsParams added in v0.13.0

type EndpointRolloutPreviewDefaultsParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Deployment that traffic shifts away from.
	SourceDeploymentID string `json:"sourceDeploymentId" api:"required"`
	// Deployment that traffic shifts toward.
	TargetDeploymentID string `json:"targetDeploymentId" api:"required"`
	// Optional final replica count for the source deployment. Defaults to 0, which
	// drains and stops the source.
	FinalSourceReplicas param.Opt[int64] `json:"finalSourceReplicas,omitzero"`
	// Optional target replica floor at completion. Must be at least 1 when set;
	// defaults to the source deployment's replica count at create time, or to the
	// source and target deployments' combined replica count when both already stand in
	// the endpoint traffic split after a cancel. The completed target's autoscaling
	// max lands at the landing ceiling, max(this value, the source max, the target's
	// own max); the rollout may lift the target max at first wake, at the first step
	// that needs it, or at completion unless an operator changes max mid-run. The
	// lifted ceiling remains after completion, and PreviewRolloutDefaults reports a
	// coming lift as ROLLOUT_WILL_RAISE_TARGET_MAX. A pre-existing target whose own
	// autoscaling min is higher keeps that floor, reported as
	// FINAL_BELOW_INHERITED_MIN. A target that starts stopped lands exactly at this
	// value; if the source min was higher, PreviewRolloutDefaults reports
	// FINAL_BELOW_SOURCE_MIN.
	FinalTargetReplicas param.Opt[int64] `json:"finalTargetReplicas,omitzero"`
	// Blue-green strategy configuration for a single cutover to the target deployment.
	BlueGreen BlueGreenConfigParam `json:"blueGreen,omitzero"`
	// Canary strategy configuration for gradual traffic progression. An empty config
	// uses the default 5, 25, 50, 100 percent ladder; over a frozen traffic-split pair
	// left by cancel, the default ladder is derived at start from the pair's current
	// served share so it begins above it.
	Canary CanaryConfigParam `json:"canary,omitzero"`
	// Optional metric gates evaluated after each step's soak. Canary only; rejected on
	// rolling and blue-green rollouts.
	Metrics []MetricRuleParam `json:"metrics,omitzero"`
	// Rolling strategy configuration for small batches that ramp target replicas up
	// while shrinking source replicas to what their remaining traffic share needs.
	Rolling RollingConfigParam `json:"rolling,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointRolloutPreviewDefaultsParams) MarshalJSON added in v0.13.0

func (r EndpointRolloutPreviewDefaultsParams) MarshalJSON() (data []byte, err error)

func (*EndpointRolloutPreviewDefaultsParams) UnmarshalJSON added in v0.13.0

func (r *EndpointRolloutPreviewDefaultsParams) UnmarshalJSON(data []byte) error

type EndpointRolloutPromoteParams added in v0.13.0

type EndpointRolloutPromoteParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Optional etag for optimistic concurrency.
	Etag param.Opt[string] `json:"etag,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointRolloutPromoteParams) MarshalJSON added in v0.13.0

func (r EndpointRolloutPromoteParams) MarshalJSON() (data []byte, err error)

func (*EndpointRolloutPromoteParams) UnmarshalJSON added in v0.13.0

func (r *EndpointRolloutPromoteParams) UnmarshalJSON(data []byte) error

type EndpointRolloutResumeParams added in v0.13.0

type EndpointRolloutResumeParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Optional etag for optimistic concurrency.
	Etag param.Opt[string] `json:"etag,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointRolloutResumeParams) MarshalJSON added in v0.13.0

func (r EndpointRolloutResumeParams) MarshalJSON() (data []byte, err error)

func (*EndpointRolloutResumeParams) UnmarshalJSON added in v0.13.0

func (r *EndpointRolloutResumeParams) UnmarshalJSON(data []byte) error

type EndpointRolloutService added in v0.13.0

type EndpointRolloutService struct {
	Options []option.RequestOption
}

EndpointRolloutService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEndpointRolloutService method instead.

func NewEndpointRolloutService added in v0.13.0

func NewEndpointRolloutService(opts ...option.RequestOption) (r EndpointRolloutService)

NewEndpointRolloutService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EndpointRolloutService) Cancel added in v0.13.0

Cancels a running, pausing, paused, system-paused, or stabilizing rollout by freezing the current traffic split into standing weights. Revert is removed and rejected; after canceling, start another canary rollout in either direction or rebalance the traffic split. The response is the accepted rollout snapshot; poll GetRollout until it reaches CANCELED.

func (*EndpointRolloutService) Delete added in v0.13.0

Deletes a rollout record. An active rollout must be aborted or completed before it can be deleted.

func (*EndpointRolloutService) Get added in v0.13.0

Retrieves a rollout's strategy, lifecycle state, current traffic percentage, step history, and metric-gate results.

func (*EndpointRolloutService) List added in v0.13.0

Lists rollout histories for an endpoint. Use `filter=ROLLOUT_FILTER_ACTIVE` to return only the active rollout, if one exists.

func (*EndpointRolloutService) ListAutoPaging added in v0.13.0

Lists rollout histories for an endpoint. Use `filter=ROLLOUT_FILTER_ACTIVE` to return only the active rollout, if one exists.

func (*EndpointRolloutService) New added in v0.13.0

func (r *EndpointRolloutService) New(ctx context.Context, endpointID string, params EndpointRolloutNewParams, opts ...option.RequestOption) (res *Rollout, err error)

Creates a rollout in the pending state without shifting traffic. Start the rollout in a separate request after reviewing its strategy and metric gates.

func (*EndpointRolloutService) Pause added in v0.13.0

Requests a running or stabilizing rollout to pause and records an optional reason. The response returns the PAUSING snapshot; poll GetRollout until state is PAUSED to confirm the executor has parked.

func (*EndpointRolloutService) PreviewDefaults added in v0.13.0

Returns the values a create request would pick for any field left unset, plus the capacity context needed to display them, without creating a rollout. Responses are display state only and re-validated authoritatively at create and start; do not copy response values back into a create request.

func (*EndpointRolloutService) Promote added in v0.13.0

Completes a running or paused rollout immediately by sending all live traffic to the target deployment.

func (*EndpointRolloutService) Resume added in v0.13.0

Resumes a pausing, paused, or system-paused rollout from its current step and traffic split.

func (*EndpointRolloutService) Start added in v0.13.0

Starts a pending rollout and begins its configured traffic-shifting workflow.

type EndpointRolloutStartParams added in v0.13.0

type EndpointRolloutStartParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type EndpointService

type EndpointService struct {
	Options           []option.RequestOption
	PlacementProfiles EndpointPlacementProfileService
	AbExperiments     EndpointAbExperimentService
	ShadowExperiments EndpointShadowExperimentService
	Rollouts          EndpointRolloutService
	Hardware          EndpointHardwareService
	Adapters          EndpointAdapterService
	Deployments       EndpointDeploymentService
}

EndpointService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEndpointService method instead.

func NewEndpointService

func NewEndpointService(opts ...option.RequestOption) (r EndpointService)

NewEndpointService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EndpointService) Analytics added in v0.13.0

Returns aggregated request, token, latency, throughput, error, and resource-utilization metrics for an endpoint over a time range. Optionally includes time-series buckets and a per-deployment breakdown.

func (*EndpointService) Delete

Permanently deletes an endpoint. Delete its deployments first; use `etag` to reject the request if the endpoint changed after it was read.

func (*EndpointService) Get

func (r *EndpointService) Get(ctx context.Context, id string, query EndpointGetParams, opts ...option.RequestOption) (res *Endpoint, err error)

Retrieves an endpoint and lightweight summaries of the deployments attached to it.

func (*EndpointService) List

Lists the dedicated inference endpoints owned by the specified project.

func (*EndpointService) ListAutoPaging added in v0.13.0

Lists the dedicated inference endpoints owned by the specified project.

func (*EndpointService) ListEvents added in v0.13.0

Lists an endpoint's audit and lifecycle events newest first. The feed combines endpoint changes with provisioning, scaling, readiness, rollout, and other events from deployments under the endpoint.

func (*EndpointService) ListEventsAutoPaging added in v0.13.0

Lists an endpoint's audit and lifecycle events newest first. The feed combines endpoint changes with provisioning, scaling, readiness, rollout, and other events from deployments under the endpoint.

func (*EndpointService) ListOrgScoped added in v0.13.0

func (r *EndpointService) ListOrgScoped(ctx context.Context, organizationID string, query EndpointListOrgScopedParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Endpoint], err error)

Lists endpoints shared with every project in the specified organization. Project-private and public endpoints are not included.

func (*EndpointService) ListOrgScopedAutoPaging added in v0.13.0

func (r *EndpointService) ListOrgScopedAutoPaging(ctx context.Context, organizationID string, query EndpointListOrgScopedParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Endpoint]

Lists endpoints shared with every project in the specified organization. Project-private and public endpoints are not included.

func (*EndpointService) New

func (r *EndpointService) New(ctx context.Context, params EndpointNewParams, opts ...option.RequestOption) (res *Endpoint, err error)

Creates a stable, inference-addressable endpoint. Add one or more deployments and configure its traffic split before sending inference requests to the endpoint name.

func (*EndpointService) Update

func (r *EndpointService) Update(ctx context.Context, id string, params EndpointUpdateParams, opts ...option.RequestOption) (res *Endpoint, err error)

Updates mutable endpoint fields such as its endpoint string, visibility, or deployment traffic split. Use `updateMask` to select fields explicitly and `etag` in the request body for optimistic concurrency.

type EndpointShadowExperimentDeleteParams added in v0.13.0

type EndpointShadowExperimentDeleteParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Etag for optimistic concurrency.
	Etag param.Opt[string] `query:"etag,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointShadowExperimentDeleteParams) URLQuery added in v0.13.0

func (r EndpointShadowExperimentDeleteParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointShadowExperimentDeleteParams's query parameters as `url.Values`.

type EndpointShadowExperimentDeleteResponse added in v0.13.0

type EndpointShadowExperimentDeleteResponse struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Empty response returned after a successful delete operation.

func (EndpointShadowExperimentDeleteResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*EndpointShadowExperimentDeleteResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointShadowExperimentDeleteResponse) UnmarshalJSON(data []byte) error

type EndpointShadowExperimentGetParams added in v0.13.0

type EndpointShadowExperimentGetParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type EndpointShadowExperimentListParams added in v0.13.0

type EndpointShadowExperimentListParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous shadow experiment list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Whether to include target deployments in each returned shadow experiment.
	IncludeTargets param.Opt[bool] `query:"includeTargets,omitzero" json:"-"`
	// Maximum number of shadow experiments to return. Max 500, defaults to 50.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointShadowExperimentListParams) URLQuery added in v0.13.0

func (r EndpointShadowExperimentListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointShadowExperimentListParams's query parameters as `url.Values`.

type EndpointShadowExperimentNewParams added in v0.13.0

type EndpointShadowExperimentNewParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Human-readable shadow experiment name, unique within the endpoint. At most 256
	// characters.
	Name string `json:"name" api:"required"`
	// Traffic source for a shadow experiment. The public API supports endpoint sources
	// only.
	Source ShadowSourceParam `json:"source,omitzero" api:"required"`
	// Optional initial target deployments. At most 100 targets; manage later changes
	// through the target APIs.
	Targets []EndpointShadowExperimentNewParamsTarget `json:"targets,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointShadowExperimentNewParams) MarshalJSON added in v0.13.0

func (r EndpointShadowExperimentNewParams) MarshalJSON() (data []byte, err error)

func (*EndpointShadowExperimentNewParams) UnmarshalJSON added in v0.13.0

func (r *EndpointShadowExperimentNewParams) UnmarshalJSON(data []byte) error

type EndpointShadowExperimentNewParamsTarget added in v0.13.0

type EndpointShadowExperimentNewParamsTarget struct {
	// Human-readable target name, unique within the shadow experiment. At most 256
	// characters.
	Name string `json:"name" api:"required"`
	// Deployment under the parent endpoint that receives mirrored traffic. It must not
	// be a live traffic-split member or the source or target of an active rollout;
	// traffic-split weight 0 warm-up targets are allowed.
	TargetDeploymentID string `json:"targetDeploymentId" api:"required"`
	// Optional free-form target description.
	Description param.Opt[string] `json:"description,omitzero"`
	// contains filtered or unexported fields
}

Deployment under the parent endpoint that should receive mirrored requests from a shadow experiment.

The properties Name, TargetDeploymentID are required.

func (EndpointShadowExperimentNewParamsTarget) MarshalJSON added in v0.13.0

func (r EndpointShadowExperimentNewParamsTarget) MarshalJSON() (data []byte, err error)

func (*EndpointShadowExperimentNewParamsTarget) UnmarshalJSON added in v0.13.0

func (r *EndpointShadowExperimentNewParamsTarget) UnmarshalJSON(data []byte) error

type EndpointShadowExperimentService added in v0.13.0

type EndpointShadowExperimentService struct {
	Options []option.RequestOption
	Targets EndpointShadowExperimentTargetService
}

EndpointShadowExperimentService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEndpointShadowExperimentService method instead.

func NewEndpointShadowExperimentService added in v0.13.0

func NewEndpointShadowExperimentService(opts ...option.RequestOption) (r EndpointShadowExperimentService)

NewEndpointShadowExperimentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EndpointShadowExperimentService) Delete added in v0.13.0

Deletes a shadow experiment and its target records. The underlying deployments are not deleted.

func (*EndpointShadowExperimentService) Get added in v0.13.0

Retrieves a shadow experiment, including its sampling strategy and target deployments.

func (*EndpointShadowExperimentService) List added in v0.13.0

Lists experiments that mirror sampled endpoint traffic to target deployments without affecting client responses. Set `includeTargets=true` to include target details inline.

func (*EndpointShadowExperimentService) ListAutoPaging added in v0.13.0

Lists experiments that mirror sampled endpoint traffic to target deployments without affecting client responses. Set `includeTargets=true` to include target details inline.

func (*EndpointShadowExperimentService) New added in v0.13.0

Creates an experiment that mirrors a sampled portion of endpoint traffic to one or more target deployments without returning their responses to clients. Add a description with the update operation after creation.

func (*EndpointShadowExperimentService) Update added in v0.13.0

Updates a shadow experiment's description or source sampling strategy. `updateMask` is required; source changes also require the current `etag` in the request body.

type EndpointShadowExperimentTargetDeleteParams added in v0.13.0

type EndpointShadowExperimentTargetDeleteParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Shadow experiment identifier.
	ExperimentID string `path:"experimentId" api:"required" json:"-"`
	// Etag for optimistic concurrency.
	Etag param.Opt[string] `query:"etag,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointShadowExperimentTargetDeleteParams) URLQuery added in v0.13.0

URLQuery serializes EndpointShadowExperimentTargetDeleteParams's query parameters as `url.Values`.

type EndpointShadowExperimentTargetDeleteResponse added in v0.13.0

type EndpointShadowExperimentTargetDeleteResponse struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Empty response returned after a successful delete operation.

func (EndpointShadowExperimentTargetDeleteResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*EndpointShadowExperimentTargetDeleteResponse) UnmarshalJSON added in v0.13.0

func (r *EndpointShadowExperimentTargetDeleteResponse) UnmarshalJSON(data []byte) error

type EndpointShadowExperimentTargetGetParams added in v0.13.0

type EndpointShadowExperimentTargetGetParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Shadow experiment identifier.
	ExperimentID string `path:"experimentId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type EndpointShadowExperimentTargetListParams added in v0.13.0

type EndpointShadowExperimentTargetListParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous shadow experiment target list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of targets to return. Max 500, defaults to 50.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EndpointShadowExperimentTargetListParams) URLQuery added in v0.13.0

URLQuery serializes EndpointShadowExperimentTargetListParams's query parameters as `url.Values`.

type EndpointShadowExperimentTargetNewParams added in v0.13.0

type EndpointShadowExperimentTargetNewParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Shadow experiment identifier.
	ExperimentID string `path:"experimentId" api:"required" json:"-"`
	// Human-readable target name, unique within the shadow experiment. At most 256
	// characters.
	Name string `json:"name" api:"required"`
	// Deployment under the parent endpoint that receives mirrored traffic. It must not
	// be a live traffic-split member or the source or target of an active rollout;
	// traffic-split weight 0 warm-up targets are allowed.
	TargetDeploymentID string `json:"targetDeploymentId" api:"required"`
	// Optional free-form target description.
	Description param.Opt[string] `json:"description,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointShadowExperimentTargetNewParams) MarshalJSON added in v0.13.0

func (r EndpointShadowExperimentTargetNewParams) MarshalJSON() (data []byte, err error)

func (*EndpointShadowExperimentTargetNewParams) UnmarshalJSON added in v0.13.0

func (r *EndpointShadowExperimentTargetNewParams) UnmarshalJSON(data []byte) error

type EndpointShadowExperimentTargetService added in v0.13.0

type EndpointShadowExperimentTargetService struct {
	Options []option.RequestOption
}

EndpointShadowExperimentTargetService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEndpointShadowExperimentTargetService method instead.

func NewEndpointShadowExperimentTargetService added in v0.13.0

func NewEndpointShadowExperimentTargetService(opts ...option.RequestOption) (r EndpointShadowExperimentTargetService)

NewEndpointShadowExperimentTargetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EndpointShadowExperimentTargetService) Delete added in v0.13.0

Removes a target from a shadow experiment without deleting the underlying deployment.

func (*EndpointShadowExperimentTargetService) Get added in v0.13.0

Retrieves one target configured to receive mirrored requests from a shadow experiment.

func (*EndpointShadowExperimentTargetService) List added in v0.13.0

Lists the deployments that receive mirrored requests from a shadow experiment.

func (*EndpointShadowExperimentTargetService) ListAutoPaging added in v0.13.0

Lists the deployments that receive mirrored requests from a shadow experiment.

func (*EndpointShadowExperimentTargetService) New added in v0.13.0

Adds a deployment under the same endpoint as a target for mirrored requests.

func (*EndpointShadowExperimentTargetService) Update added in v0.13.0

Updates a shadow target's name, deployment, or description. `updateMask` is required and must select at least one mutable field.

type EndpointShadowExperimentTargetUpdateParams added in v0.13.0

type EndpointShadowExperimentTargetUpdateParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Shadow experiment identifier.
	ExperimentID string `path:"experimentId" api:"required" json:"-"`
	// Comma-separated fields to update. Supported fields are `name`,
	// `targetDeploymentId`, and `description`.
	UpdateMask string `query:"updateMask" api:"required" json:"-"`
	// Updated free-form target description.
	Description param.Opt[string] `json:"description,omitzero"`
	// Opaque version tag from a prior read for optimistic concurrency.
	Etag param.Opt[string] `json:"etag,omitzero"`
	// Updated human-readable target name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Replacement deployment under the parent endpoint. It must not be a live
	// traffic-split member or the source or target of an active rollout; traffic-split
	// weight 0 warm-up targets are allowed.
	TargetDeploymentID param.Opt[string] `json:"targetDeploymentId,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointShadowExperimentTargetUpdateParams) MarshalJSON added in v0.13.0

func (r EndpointShadowExperimentTargetUpdateParams) MarshalJSON() (data []byte, err error)

func (EndpointShadowExperimentTargetUpdateParams) URLQuery added in v0.13.0

URLQuery serializes EndpointShadowExperimentTargetUpdateParams's query parameters as `url.Values`.

func (*EndpointShadowExperimentTargetUpdateParams) UnmarshalJSON added in v0.13.0

func (r *EndpointShadowExperimentTargetUpdateParams) UnmarshalJSON(data []byte) error

type EndpointShadowExperimentUpdateParams added in v0.13.0

type EndpointShadowExperimentUpdateParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Endpoint identifier.
	EndpointID string `path:"endpointId" api:"required" json:"-"`
	// Required fields to update, such as description or source.
	UpdateMask string `query:"updateMask" api:"required" json:"-"`
	// Updated free-form description.
	Description param.Opt[string] `json:"description,omitzero"`
	// Opaque version tag from a prior read for optimistic concurrency.
	Etag param.Opt[string] `json:"etag,omitzero"`
	// Traffic source for a shadow experiment. The public API supports endpoint sources
	// only.
	Source ShadowSourceParam `json:"source,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointShadowExperimentUpdateParams) MarshalJSON added in v0.13.0

func (r EndpointShadowExperimentUpdateParams) MarshalJSON() (data []byte, err error)

func (EndpointShadowExperimentUpdateParams) URLQuery added in v0.13.0

func (r EndpointShadowExperimentUpdateParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointShadowExperimentUpdateParams's query parameters as `url.Values`.

func (*EndpointShadowExperimentUpdateParams) UnmarshalJSON added in v0.13.0

func (r *EndpointShadowExperimentUpdateParams) UnmarshalJSON(data []byte) error

type EndpointTrafficSplitEntry added in v0.11.0

type EndpointTrafficSplitEntry struct {
	// ID of a deployment under the endpoint that can receive live traffic.
	DeploymentID string `json:"deploymentId" api:"required"`
	// Non-negative, finite weight applied to each ready replica. A deployment's
	// effective routing capacity is `weight * readyReplicas`, and requests are
	// distributed in proportion to that capacity. Set to `0` to remove the deployment
	// from the live traffic split.
	Weight float64 `json:"weight" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DeploymentID respjson.Field
		Weight       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Capacity weight assigned to one deployment in an endpoint's live traffic split.

func (EndpointTrafficSplitEntry) RawJSON added in v0.11.0

func (r EndpointTrafficSplitEntry) RawJSON() string

Returns the unmodified JSON received from the API

func (EndpointTrafficSplitEntry) ToParam added in v0.11.0

ToParam converts this EndpointTrafficSplitEntry to a EndpointTrafficSplitEntryParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with EndpointTrafficSplitEntryParam.Overrides()

func (*EndpointTrafficSplitEntry) UnmarshalJSON added in v0.11.0

func (r *EndpointTrafficSplitEntry) UnmarshalJSON(data []byte) error

type EndpointTrafficSplitEntryParam added in v0.11.0

type EndpointTrafficSplitEntryParam struct {
	// ID of a deployment under the endpoint that can receive live traffic.
	DeploymentID string `json:"deploymentId" api:"required"`
	// Non-negative, finite weight applied to each ready replica. A deployment's
	// effective routing capacity is `weight * readyReplicas`, and requests are
	// distributed in proportion to that capacity. Set to `0` to remove the deployment
	// from the live traffic split.
	Weight float64 `json:"weight" api:"required"`
	// contains filtered or unexported fields
}

Capacity weight assigned to one deployment in an endpoint's live traffic split.

The properties DeploymentID, Weight are required.

func (EndpointTrafficSplitEntryParam) MarshalJSON added in v0.11.0

func (r EndpointTrafficSplitEntryParam) MarshalJSON() (data []byte, err error)

func (*EndpointTrafficSplitEntryParam) UnmarshalJSON added in v0.11.0

func (r *EndpointTrafficSplitEntryParam) UnmarshalJSON(data []byte) error

type EndpointUpdateParams

type EndpointUpdateParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Fields to update. If not set, the fields populated are updated.
	UpdateMask param.Opt[string] `query:"updateMask,omitzero" json:"-"`
	// Current endpoint version. The update is rejected if this value no longer
	// matches.
	Etag param.Opt[string] `json:"etag,omitzero"`
	// Updated endpoint string.
	Name param.Opt[string] `json:"name,omitzero"`
	// Replacement live traffic split. Use an empty list to stop routing live traffic.
	TrafficSplit []EndpointTrafficSplitEntryParam `json:"trafficSplit,omitzero"`
	// Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project;
	// `VISIBILITY_INTERNAL` shares it with the organization.
	//
	// Any of "VISIBILITY_PRIVATE", "VISIBILITY_INTERNAL".
	Visibility EndpointUpdateParamsVisibility `json:"visibility,omitzero"`
	// contains filtered or unexported fields
}

func (EndpointUpdateParams) MarshalJSON

func (r EndpointUpdateParams) MarshalJSON() (data []byte, err error)

func (EndpointUpdateParams) URLQuery added in v0.13.0

func (r EndpointUpdateParams) URLQuery() (v url.Values, err error)

URLQuery serializes EndpointUpdateParams's query parameters as `url.Values`.

func (*EndpointUpdateParams) UnmarshalJSON

func (r *EndpointUpdateParams) UnmarshalJSON(data []byte) error

type EndpointUpdateParamsVisibility added in v0.13.0

type EndpointUpdateParamsVisibility string

Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.

const (
	EndpointUpdateParamsVisibilityVisibilityPrivate  EndpointUpdateParamsVisibility = "VISIBILITY_PRIVATE"
	EndpointUpdateParamsVisibilityVisibilityInternal EndpointUpdateParamsVisibility = "VISIBILITY_INTERNAL"
)

type EndpointVisibility added in v0.11.0

type EndpointVisibility string

Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.

const (
	EndpointVisibilityVisibilityPrivate  EndpointVisibility = "VISIBILITY_PRIVATE"
	EndpointVisibilityVisibilityInternal EndpointVisibility = "VISIBILITY_INTERNAL"
)

type Error

type Error = apierror.Error

type ErrorMetrics added in v0.13.0

type ErrorMetrics struct {
	// Percentage in [0, 100].
	ErrorRate float64 `json:"errorRate"`
	// Counts of errors keyed by error type (e.g. HTTP status code or error kind).
	ErrorsByType map[string]string `json:"errorsByType"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorRate    respjson.Field
		ErrorsByType respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error rate and aggregate counts by error type. Individual error samples are not included.

func (ErrorMetrics) RawJSON added in v0.13.0

func (r ErrorMetrics) RawJSON() string

Returns the unmodified JSON received from the API

func (*ErrorMetrics) UnmarshalJSON added in v0.13.0

func (r *ErrorMetrics) UnmarshalJSON(data []byte) error

type EvalListParams

type EvalListParams struct {
	// Limit the number of results
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter evaluation jobs by status
	Status param.Opt[string] `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EvalListParams) URLQuery

func (r EvalListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EvalListParams's query parameters as `url.Values`.

type EvalNewParams

type EvalNewParams struct {
	// Type-specific parameters for the evaluation
	Parameters EvalNewParamsParametersUnion `json:"parameters,omitzero" api:"required"`
	// The type of evaluation to perform
	//
	// Any of "classify", "score", "compare".
	Type EvalNewParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (EvalNewParams) MarshalJSON

func (r EvalNewParams) MarshalJSON() (data []byte, err error)

func (*EvalNewParams) UnmarshalJSON

func (r *EvalNewParams) UnmarshalJSON(data []byte) error

type EvalNewParamsParametersEvaluationClassifyParameters

type EvalNewParamsParametersEvaluationClassifyParameters struct {
	// Data file ID
	InputDataFilePath string                                                   `json:"input_data_file_path" api:"required"`
	Judge             EvalNewParamsParametersEvaluationClassifyParametersJudge `json:"judge,omitzero" api:"required"`
	// List of possible classification labels
	Labels []string `json:"labels,omitzero" api:"required"`
	// List of labels that are considered passing
	PassLabels []string `json:"pass_labels,omitzero" api:"required"`
	// Column name in the input dataset containing pre-generated responses
	ModelToEvaluate EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion `json:"model_to_evaluate,omitzero"`
	// contains filtered or unexported fields
}

The properties InputDataFilePath, Judge, Labels, PassLabels are required.

func (EvalNewParamsParametersEvaluationClassifyParameters) MarshalJSON

func (r EvalNewParamsParametersEvaluationClassifyParameters) MarshalJSON() (data []byte, err error)

func (*EvalNewParamsParametersEvaluationClassifyParameters) UnmarshalJSON

type EvalNewParamsParametersEvaluationClassifyParametersJudge

type EvalNewParamsParametersEvaluationClassifyParametersJudge struct {
	// Name of the judge model
	Model string `json:"model" api:"required"`
	// Source of the judge model inference: - `serverless`: Together's shared
	// serverless inference API. Default concurrency: 25 workers. - `dedicated`: A
	// Together dedicated deployment endpoint. Default concurrency: 5 workers (minimum
	// enforced even if num_workers is set lower).
	//
	// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//   OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//   concurrency: 2 workers for first-party APIs, 20 for proxy/aggregator
	//   endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template for the judge
	SystemTemplate string `json:"system_template" api:"required"`
	// Bearer/API token for the external judge model provider. Required when
	// model_source is 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API for the judge. Must be OpenAI-compatible.
	// Required when model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Maximum number of tokens the judge model may generate. Defaults to 32768 if
	// omitted. Set higher for reasoning judges (e.g. o-series, Gemini) that spend
	// tokens on internal chain-of-thought before emitting the verdict JSON.
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// Number of concurrent inference workers for the judge. Overrides the
	// source-specific default (serverless: 25, dedicated: 5, external: 2–20). For
	// dedicated endpoints the value is clamped to a minimum of 5 regardless of what is
	// set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// Sampling temperature for the judge model. Defaults to 0.05 if omitted.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// contains filtered or unexported fields
}

The properties Model, ModelSource, SystemTemplate are required.

func (EvalNewParamsParametersEvaluationClassifyParametersJudge) MarshalJSON

func (*EvalNewParamsParametersEvaluationClassifyParametersJudge) UnmarshalJSON

type EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest

type EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest struct {
	// User message template. Supports Jinja2 variables referencing dataset columns.
	InputTemplate string `json:"input_template" api:"required"`
	// Maximum number of tokens to generate.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Name of the model to evaluate
	Model string `json:"model" api:"required"`
	// Source of the model inference: - `serverless`: Together's shared serverless
	// inference API. Default concurrency: 25 workers. - `dedicated`: A Together
	// dedicated deployment endpoint. Default concurrency: 5 workers (minimum enforced
	// even if num_workers is set lower). Authentication uses the requesting user's
	// Together API token automatically.
	//
	// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//   OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//   concurrency: 2 workers for first-party APIs (OpenAI, Anthropic, Google), 20
	//   for proxy/aggregator endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template. Supports Jinja2 variables referencing dataset columns.
	SystemTemplate string `json:"system_template" api:"required"`
	// Sampling temperature for generation.
	Temperature float64 `json:"temperature" api:"required"`
	// Bearer/API token for the external model provider. Required when model_source is
	// 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API. Must be OpenAI-compatible. Required when
	// model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Number of concurrent inference workers. Overrides the source-specific default
	// (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the
	// value is clamped to a minimum of 5 regardless of what is set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// contains filtered or unexported fields
}

The properties InputTemplate, MaxTokens, Model, ModelSource, SystemTemplate, Temperature are required.

func (EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest) MarshalJSON

func (*EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest) UnmarshalJSON

type EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion

type EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion struct {
	OfString                                                                              param.Opt[string]                                                                         `json:",omitzero,inline"`
	OfEvalNewsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest *EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateEvaluationModelRequest `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion) MarshalJSON

func (*EvalNewParamsParametersEvaluationClassifyParametersModelToEvaluateUnion) UnmarshalJSON

type EvalNewParamsParametersEvaluationCompareParameters

type EvalNewParamsParametersEvaluationCompareParameters struct {
	// Data file ID
	InputDataFilePath string                                                  `json:"input_data_file_path" api:"required"`
	Judge             EvalNewParamsParametersEvaluationCompareParametersJudge `json:"judge,omitzero" api:"required"`
	// When false (default), the judge runs twice per sample: once with model A's
	// response first (original order) and once with model B's response first (flipped
	// order). The two verdicts are reconciled to cancel out position bias. When true,
	// only the original-order pass is run, halving judge cost and latency at the
	// expense of position-bias correction. The result file will not contain
	// flipped-order judge fields when this is true.
	DisablePositionBiasCorrection param.Opt[bool] `json:"disable_position_bias_correction,omitzero"`
	// Either an EvaluationModelRequest for generation or a string column name from the
	// dataset (when responses are pre-generated). When both model_a and model_b are
	// EvaluationModelRequest objects, their inference runs execute in parallel to
	// reduce total wall-clock time.
	ModelA EvalNewParamsParametersEvaluationCompareParametersModelAUnion `json:"model_a,omitzero"`
	// Either an EvaluationModelRequest for generation or a string column name from the
	// dataset (when responses are pre-generated). When both model_a and model_b are
	// EvaluationModelRequest objects, their inference runs execute in parallel to
	// reduce total wall-clock time.
	ModelB EvalNewParamsParametersEvaluationCompareParametersModelBUnion `json:"model_b,omitzero"`
	// contains filtered or unexported fields
}

The properties InputDataFilePath, Judge are required.

func (EvalNewParamsParametersEvaluationCompareParameters) MarshalJSON

func (r EvalNewParamsParametersEvaluationCompareParameters) MarshalJSON() (data []byte, err error)

func (*EvalNewParamsParametersEvaluationCompareParameters) UnmarshalJSON

type EvalNewParamsParametersEvaluationCompareParametersJudge

type EvalNewParamsParametersEvaluationCompareParametersJudge struct {
	// Name of the judge model
	Model string `json:"model" api:"required"`
	// Source of the judge model inference: - `serverless`: Together's shared
	// serverless inference API. Default concurrency: 25 workers. - `dedicated`: A
	// Together dedicated deployment endpoint. Default concurrency: 5 workers (minimum
	// enforced even if num_workers is set lower).
	//
	// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//   OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//   concurrency: 2 workers for first-party APIs, 20 for proxy/aggregator
	//   endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template for the judge
	SystemTemplate string `json:"system_template" api:"required"`
	// Bearer/API token for the external judge model provider. Required when
	// model_source is 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API for the judge. Must be OpenAI-compatible.
	// Required when model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Maximum number of tokens the judge model may generate. Defaults to 32768 if
	// omitted. Set higher for reasoning judges (e.g. o-series, Gemini) that spend
	// tokens on internal chain-of-thought before emitting the verdict JSON.
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// Number of concurrent inference workers for the judge. Overrides the
	// source-specific default (serverless: 25, dedicated: 5, external: 2–20). For
	// dedicated endpoints the value is clamped to a minimum of 5 regardless of what is
	// set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// Sampling temperature for the judge model. Defaults to 0.05 if omitted.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// contains filtered or unexported fields
}

The properties Model, ModelSource, SystemTemplate are required.

func (EvalNewParamsParametersEvaluationCompareParametersJudge) MarshalJSON

func (*EvalNewParamsParametersEvaluationCompareParametersJudge) UnmarshalJSON

type EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest

type EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest struct {
	// User message template. Supports Jinja2 variables referencing dataset columns.
	InputTemplate string `json:"input_template" api:"required"`
	// Maximum number of tokens to generate.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Name of the model to evaluate
	Model string `json:"model" api:"required"`
	// Source of the model inference: - `serverless`: Together's shared serverless
	// inference API. Default concurrency: 25 workers. - `dedicated`: A Together
	// dedicated deployment endpoint. Default concurrency: 5 workers (minimum enforced
	// even if num_workers is set lower). Authentication uses the requesting user's
	// Together API token automatically.
	//
	// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//   OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//   concurrency: 2 workers for first-party APIs (OpenAI, Anthropic, Google), 20
	//   for proxy/aggregator endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template. Supports Jinja2 variables referencing dataset columns.
	SystemTemplate string `json:"system_template" api:"required"`
	// Sampling temperature for generation.
	Temperature float64 `json:"temperature" api:"required"`
	// Bearer/API token for the external model provider. Required when model_source is
	// 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API. Must be OpenAI-compatible. Required when
	// model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Number of concurrent inference workers. Overrides the source-specific default
	// (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the
	// value is clamped to a minimum of 5 regardless of what is set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// contains filtered or unexported fields
}

The properties InputTemplate, MaxTokens, Model, ModelSource, SystemTemplate, Temperature are required.

func (EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest) MarshalJSON

func (*EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest) UnmarshalJSON

type EvalNewParamsParametersEvaluationCompareParametersModelAUnion

type EvalNewParamsParametersEvaluationCompareParametersModelAUnion struct {
	OfEvalNewsParametersEvaluationCompareParametersModelAEvaluationModelRequest *EvalNewParamsParametersEvaluationCompareParametersModelAEvaluationModelRequest `json:",omitzero,inline"`
	OfString                                                                    param.Opt[string]                                                               `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EvalNewParamsParametersEvaluationCompareParametersModelAUnion) MarshalJSON

func (*EvalNewParamsParametersEvaluationCompareParametersModelAUnion) UnmarshalJSON

type EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest

type EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest struct {
	// User message template. Supports Jinja2 variables referencing dataset columns.
	InputTemplate string `json:"input_template" api:"required"`
	// Maximum number of tokens to generate.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Name of the model to evaluate
	Model string `json:"model" api:"required"`
	// Source of the model inference: - `serverless`: Together's shared serverless
	// inference API. Default concurrency: 25 workers. - `dedicated`: A Together
	// dedicated deployment endpoint. Default concurrency: 5 workers (minimum enforced
	// even if num_workers is set lower). Authentication uses the requesting user's
	// Together API token automatically.
	//
	// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//   OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//   concurrency: 2 workers for first-party APIs (OpenAI, Anthropic, Google), 20
	//   for proxy/aggregator endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template. Supports Jinja2 variables referencing dataset columns.
	SystemTemplate string `json:"system_template" api:"required"`
	// Sampling temperature for generation.
	Temperature float64 `json:"temperature" api:"required"`
	// Bearer/API token for the external model provider. Required when model_source is
	// 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API. Must be OpenAI-compatible. Required when
	// model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Number of concurrent inference workers. Overrides the source-specific default
	// (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the
	// value is clamped to a minimum of 5 regardless of what is set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// contains filtered or unexported fields
}

The properties InputTemplate, MaxTokens, Model, ModelSource, SystemTemplate, Temperature are required.

func (EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest) MarshalJSON

func (*EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest) UnmarshalJSON

type EvalNewParamsParametersEvaluationCompareParametersModelBUnion

type EvalNewParamsParametersEvaluationCompareParametersModelBUnion struct {
	OfEvalNewsParametersEvaluationCompareParametersModelBEvaluationModelRequest *EvalNewParamsParametersEvaluationCompareParametersModelBEvaluationModelRequest `json:",omitzero,inline"`
	OfString                                                                    param.Opt[string]                                                               `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EvalNewParamsParametersEvaluationCompareParametersModelBUnion) MarshalJSON

func (*EvalNewParamsParametersEvaluationCompareParametersModelBUnion) UnmarshalJSON

type EvalNewParamsParametersEvaluationScoreParameters

type EvalNewParamsParametersEvaluationScoreParameters struct {
	// Data file ID
	InputDataFilePath string                                                `json:"input_data_file_path" api:"required"`
	Judge             EvalNewParamsParametersEvaluationScoreParametersJudge `json:"judge,omitzero" api:"required"`
	// Maximum possible score
	MaxScore float64 `json:"max_score" api:"required"`
	// Minimum possible score
	MinScore float64 `json:"min_score" api:"required"`
	// Score threshold for passing
	PassThreshold float64 `json:"pass_threshold" api:"required"`
	// Column name in the input dataset containing pre-generated responses
	ModelToEvaluate EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion `json:"model_to_evaluate,omitzero"`
	// contains filtered or unexported fields
}

The properties InputDataFilePath, Judge, MaxScore, MinScore, PassThreshold are required.

func (EvalNewParamsParametersEvaluationScoreParameters) MarshalJSON

func (r EvalNewParamsParametersEvaluationScoreParameters) MarshalJSON() (data []byte, err error)

func (*EvalNewParamsParametersEvaluationScoreParameters) UnmarshalJSON

type EvalNewParamsParametersEvaluationScoreParametersJudge

type EvalNewParamsParametersEvaluationScoreParametersJudge struct {
	// Name of the judge model
	Model string `json:"model" api:"required"`
	// Source of the judge model inference: - `serverless`: Together's shared
	// serverless inference API. Default concurrency: 25 workers. - `dedicated`: A
	// Together dedicated deployment endpoint. Default concurrency: 5 workers (minimum
	// enforced even if num_workers is set lower).
	//
	// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//   OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//   concurrency: 2 workers for first-party APIs, 20 for proxy/aggregator
	//   endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template for the judge
	SystemTemplate string `json:"system_template" api:"required"`
	// Bearer/API token for the external judge model provider. Required when
	// model_source is 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API for the judge. Must be OpenAI-compatible.
	// Required when model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Maximum number of tokens the judge model may generate. Defaults to 32768 if
	// omitted. Set higher for reasoning judges (e.g. o-series, Gemini) that spend
	// tokens on internal chain-of-thought before emitting the verdict JSON.
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// Number of concurrent inference workers for the judge. Overrides the
	// source-specific default (serverless: 25, dedicated: 5, external: 2–20). For
	// dedicated endpoints the value is clamped to a minimum of 5 regardless of what is
	// set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// Sampling temperature for the judge model. Defaults to 0.05 if omitted.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// contains filtered or unexported fields
}

The properties Model, ModelSource, SystemTemplate are required.

func (EvalNewParamsParametersEvaluationScoreParametersJudge) MarshalJSON

func (*EvalNewParamsParametersEvaluationScoreParametersJudge) UnmarshalJSON

type EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest

type EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest struct {
	// User message template. Supports Jinja2 variables referencing dataset columns.
	InputTemplate string `json:"input_template" api:"required"`
	// Maximum number of tokens to generate.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Name of the model to evaluate
	Model string `json:"model" api:"required"`
	// Source of the model inference: - `serverless`: Together's shared serverless
	// inference API. Default concurrency: 25 workers. - `dedicated`: A Together
	// dedicated deployment endpoint. Default concurrency: 5 workers (minimum enforced
	// even if num_workers is set lower). Authentication uses the requesting user's
	// Together API token automatically.
	//
	// - `external`: An external inference API (e.g. OpenAI, Anthropic, Google,
	//   OpenRouter). Requires `external_api_token` and `external_base_url`. Default
	//   concurrency: 2 workers for first-party APIs (OpenAI, Anthropic, Google), 20
	//   for proxy/aggregator endpoints.
	//
	// Any of "serverless", "dedicated", "external".
	ModelSource string `json:"model_source,omitzero" api:"required"`
	// System prompt template. Supports Jinja2 variables referencing dataset columns.
	SystemTemplate string `json:"system_template" api:"required"`
	// Sampling temperature for generation.
	Temperature float64 `json:"temperature" api:"required"`
	// Bearer/API token for the external model provider. Required when model_source is
	// 'external'.
	ExternalAPIToken param.Opt[string] `json:"external_api_token,omitzero"`
	// Base URL of the external inference API. Must be OpenAI-compatible. Required when
	// model_source is 'external'.
	ExternalBaseURL param.Opt[string] `json:"external_base_url,omitzero"`
	// Number of concurrent inference workers. Overrides the source-specific default
	// (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the
	// value is clamped to a minimum of 5 regardless of what is set here.
	NumWorkers param.Opt[int64] `json:"num_workers,omitzero"`
	// contains filtered or unexported fields
}

The properties InputTemplate, MaxTokens, Model, ModelSource, SystemTemplate, Temperature are required.

func (EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest) MarshalJSON

func (*EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest) UnmarshalJSON

type EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion

type EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion struct {
	OfString                                                                           param.Opt[string]                                                                      `json:",omitzero,inline"`
	OfEvalNewsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest *EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateEvaluationModelRequest `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion) MarshalJSON

func (*EvalNewParamsParametersEvaluationScoreParametersModelToEvaluateUnion) UnmarshalJSON

type EvalNewParamsParametersUnion

type EvalNewParamsParametersUnion struct {
	OfEvalNewsParametersEvaluationClassifyParameters *EvalNewParamsParametersEvaluationClassifyParameters `json:",omitzero,inline"`
	OfEvalNewsParametersEvaluationScoreParameters    *EvalNewParamsParametersEvaluationScoreParameters    `json:",omitzero,inline"`
	OfEvalNewsParametersEvaluationCompareParameters  *EvalNewParamsParametersEvaluationCompareParameters  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (EvalNewParamsParametersUnion) GetDisablePositionBiasCorrection added in v0.10.0

func (u EvalNewParamsParametersUnion) GetDisablePositionBiasCorrection() *bool

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetInputDataFilePath

func (u EvalNewParamsParametersUnion) GetInputDataFilePath() *string

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetJudge

func (u EvalNewParamsParametersUnion) GetJudge() (res evalNewParamsParametersUnionJudge)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (EvalNewParamsParametersUnion) GetLabels

func (u EvalNewParamsParametersUnion) GetLabels() []string

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetMaxScore

func (u EvalNewParamsParametersUnion) GetMaxScore() *float64

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetMinScore

func (u EvalNewParamsParametersUnion) GetMinScore() *float64

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetModelA

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetModelB

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetModelToEvaluate

func (u EvalNewParamsParametersUnion) GetModelToEvaluate() (res evalNewParamsParametersUnionModelToEvaluate)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (EvalNewParamsParametersUnion) GetPassLabels

func (u EvalNewParamsParametersUnion) GetPassLabels() []string

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) GetPassThreshold

func (u EvalNewParamsParametersUnion) GetPassThreshold() *float64

Returns a pointer to the underlying variant's property, if present.

func (EvalNewParamsParametersUnion) MarshalJSON

func (u EvalNewParamsParametersUnion) MarshalJSON() ([]byte, error)

func (*EvalNewParamsParametersUnion) UnmarshalJSON

func (u *EvalNewParamsParametersUnion) UnmarshalJSON(data []byte) error

type EvalNewParamsType

type EvalNewParamsType string

The type of evaluation to perform

const (
	EvalNewParamsTypeClassify EvalNewParamsType = "classify"
	EvalNewParamsTypeScore    EvalNewParamsType = "score"
	EvalNewParamsTypeCompare  EvalNewParamsType = "compare"
)

type EvalNewResponse

type EvalNewResponse struct {
	// Initial status of the job
	//
	// Any of "pending".
	Status EvalNewResponseStatus `json:"status"`
	// The ID of the created evaluation job
	WorkflowID string `json:"workflow_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		WorkflowID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvalNewResponse) RawJSON

func (r EvalNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvalNewResponse) UnmarshalJSON

func (r *EvalNewResponse) UnmarshalJSON(data []byte) error

type EvalNewResponseStatus

type EvalNewResponseStatus string

Initial status of the job

const (
	EvalNewResponseStatusPending EvalNewResponseStatus = "pending"
)

type EvalService

type EvalService struct {
	Options []option.RequestOption
}

EvalService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEvalService method instead.

func NewEvalService

func NewEvalService(opts ...option.RequestOption) (r EvalService)

NewEvalService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EvalService) Get

func (r *EvalService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *EvaluationJob, err error)

Get evaluation job details

func (*EvalService) List

func (r *EvalService) List(ctx context.Context, query EvalListParams, opts ...option.RequestOption) (res *[]EvaluationJob, err error)

Get all evaluation jobs

func (*EvalService) New

func (r *EvalService) New(ctx context.Context, body EvalNewParams, opts ...option.RequestOption) (res *EvalNewResponse, err error)

Create an evaluation job

func (*EvalService) Status

func (r *EvalService) Status(ctx context.Context, id string, opts ...option.RequestOption) (res *EvalStatusResponse, err error)

Get evaluation job status and results

type EvalStatusResponse

type EvalStatusResponse struct {
	// The results of the evaluation job
	Results EvalStatusResponseResultsUnion `json:"results"`
	// The status of the evaluation job
	//
	// Any of "completed", "error", "user_error", "running", "queued", "pending".
	Status EvalStatusResponseStatus `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Results     respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvalStatusResponse) RawJSON

func (r EvalStatusResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvalStatusResponse) UnmarshalJSON

func (r *EvalStatusResponse) UnmarshalJSON(data []byte) error

type EvalStatusResponseResultsEvaluationClassifyResults

type EvalStatusResponseResultsEvaluationClassifyResults struct {
	// Number of failed generations.
	GenerationFailCount float64 `json:"generation_fail_count" api:"nullable"`
	// Number of invalid labels
	InvalidLabelCount float64 `json:"invalid_label_count" api:"nullable"`
	// Number of failed judge generations
	JudgeFailCount float64 `json:"judge_fail_count" api:"nullable"`
	// JSON string representing label counts
	LabelCounts string `json:"label_counts"`
	// Pecentage of pass labels.
	PassPercentage float64 `json:"pass_percentage" api:"nullable"`
	// Data File ID
	ResultFileID string `json:"result_file_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		GenerationFailCount respjson.Field
		InvalidLabelCount   respjson.Field
		JudgeFailCount      respjson.Field
		LabelCounts         respjson.Field
		PassPercentage      respjson.Field
		ResultFileID        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvalStatusResponseResultsEvaluationClassifyResults) RawJSON

Returns the unmodified JSON received from the API

func (*EvalStatusResponseResultsEvaluationClassifyResults) UnmarshalJSON

type EvalStatusResponseResultsEvaluationCompareResults

type EvalStatusResponseResultsEvaluationCompareResults struct {
	// Number of samples where model A was judged the winner
	AWins int64 `json:"A_wins"`
	// Number of samples where model B was judged the winner
	BWins int64 `json:"B_wins"`
	// Number of generation failures across model A and model B.
	GenerationFailCount float64 `json:"generation_fail_count" api:"nullable"`
	// Number of judge inference failures. In the default two-pass mode
	// (disable_position_bias_correction=false) this is the combined failure count from
	// both the original-order and flipped-order judge passes.
	JudgeFailCount float64 `json:"judge_fail_count" api:"nullable"`
	// File ID of the detailed output file. Each row contains the original input fields
	// plus judge outputs. In two-pass mode the file includes both original-order and
	// flipped-order judge fields; in single-pass mode
	// (disable_position_bias_correction=true) only original-order fields are present.
	ResultFileID string `json:"result_file_id"`
	// Number of samples that resulted in a tie score
	Ties int64 `json:"Ties"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AWins               respjson.Field
		BWins               respjson.Field
		GenerationFailCount respjson.Field
		JudgeFailCount      respjson.Field
		ResultFileID        respjson.Field
		Ties                respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvalStatusResponseResultsEvaluationCompareResults) RawJSON

Returns the unmodified JSON received from the API

func (*EvalStatusResponseResultsEvaluationCompareResults) UnmarshalJSON

type EvalStatusResponseResultsEvaluationScoreResults

type EvalStatusResponseResultsEvaluationScoreResults struct {
	AggregatedScores EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores `json:"aggregated_scores"`
	// number of failed samples generated from model
	FailedSamples float64 `json:"failed_samples"`
	// Number of failed generations.
	GenerationFailCount float64 `json:"generation_fail_count" api:"nullable"`
	// number of invalid scores generated from model
	InvalidScoreCount float64 `json:"invalid_score_count"`
	// Number of failed judge generations
	JudgeFailCount float64 `json:"judge_fail_count" api:"nullable"`
	// Data File ID
	ResultFileID string `json:"result_file_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AggregatedScores    respjson.Field
		FailedSamples       respjson.Field
		GenerationFailCount respjson.Field
		InvalidScoreCount   respjson.Field
		JudgeFailCount      respjson.Field
		ResultFileID        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvalStatusResponseResultsEvaluationScoreResults) RawJSON

Returns the unmodified JSON received from the API

func (*EvalStatusResponseResultsEvaluationScoreResults) UnmarshalJSON

type EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores

type EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores struct {
	MeanScore      float64 `json:"mean_score"`
	PassPercentage float64 `json:"pass_percentage"`
	StdScore       float64 `json:"std_score"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MeanScore      respjson.Field
		PassPercentage respjson.Field
		StdScore       respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores) RawJSON

Returns the unmodified JSON received from the API

func (*EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores) UnmarshalJSON

type EvalStatusResponseResultsUnion

type EvalStatusResponseResultsUnion struct {
	GenerationFailCount float64 `json:"generation_fail_count"`
	// This field is from variant [EvalStatusResponseResultsEvaluationClassifyResults].
	InvalidLabelCount float64 `json:"invalid_label_count"`
	JudgeFailCount    float64 `json:"judge_fail_count"`
	// This field is from variant [EvalStatusResponseResultsEvaluationClassifyResults].
	LabelCounts string `json:"label_counts"`
	// This field is from variant [EvalStatusResponseResultsEvaluationClassifyResults].
	PassPercentage float64 `json:"pass_percentage"`
	ResultFileID   string  `json:"result_file_id"`
	// This field is from variant [EvalStatusResponseResultsEvaluationScoreResults].
	AggregatedScores EvalStatusResponseResultsEvaluationScoreResultsAggregatedScores `json:"aggregated_scores"`
	// This field is from variant [EvalStatusResponseResultsEvaluationScoreResults].
	FailedSamples float64 `json:"failed_samples"`
	// This field is from variant [EvalStatusResponseResultsEvaluationScoreResults].
	InvalidScoreCount float64 `json:"invalid_score_count"`
	// This field is from variant [EvalStatusResponseResultsEvaluationCompareResults].
	AWins int64 `json:"A_wins"`
	// This field is from variant [EvalStatusResponseResultsEvaluationCompareResults].
	BWins int64 `json:"B_wins"`
	// This field is from variant [EvalStatusResponseResultsEvaluationCompareResults].
	Ties int64 `json:"Ties"`
	JSON struct {
		GenerationFailCount respjson.Field
		InvalidLabelCount   respjson.Field
		JudgeFailCount      respjson.Field
		LabelCounts         respjson.Field
		PassPercentage      respjson.Field
		ResultFileID        respjson.Field
		AggregatedScores    respjson.Field
		FailedSamples       respjson.Field
		InvalidScoreCount   respjson.Field
		AWins               respjson.Field
		BWins               respjson.Field
		Ties                respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

EvalStatusResponseResultsUnion contains all possible properties and values from EvalStatusResponseResultsEvaluationClassifyResults, EvalStatusResponseResultsEvaluationScoreResults, EvalStatusResponseResultsEvaluationCompareResults.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationClassifyResults

func (u EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationClassifyResults() (v EvalStatusResponseResultsEvaluationClassifyResults)

func (EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationCompareResults

func (u EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationCompareResults() (v EvalStatusResponseResultsEvaluationCompareResults)

func (EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationScoreResults

func (u EvalStatusResponseResultsUnion) AsEvalStatusResponseResultsEvaluationScoreResults() (v EvalStatusResponseResultsEvaluationScoreResults)

func (EvalStatusResponseResultsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*EvalStatusResponseResultsUnion) UnmarshalJSON

func (r *EvalStatusResponseResultsUnion) UnmarshalJSON(data []byte) error

type EvalStatusResponseStatus

type EvalStatusResponseStatus string

The status of the evaluation job

const (
	EvalStatusResponseStatusCompleted EvalStatusResponseStatus = "completed"
	EvalStatusResponseStatusError     EvalStatusResponseStatus = "error"
	EvalStatusResponseStatusUserError EvalStatusResponseStatus = "user_error"
	EvalStatusResponseStatusRunning   EvalStatusResponseStatus = "running"
	EvalStatusResponseStatusQueued    EvalStatusResponseStatus = "queued"
	EvalStatusResponseStatusPending   EvalStatusResponseStatus = "pending"
)

type EvaluationJob

type EvaluationJob struct {
	// When the job was created
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// ID of the job owner (admin only)
	OwnerID string `json:"owner_id"`
	// The parameters used for this evaluation
	Parameters map[string]any `json:"parameters"`
	// Results of the evaluation (when completed)
	Results EvaluationJobResultsUnion `json:"results" api:"nullable"`
	// Current status of the job
	//
	// Any of "pending", "queued", "running", "completed", "error", "user_error".
	Status EvaluationJobStatus `json:"status"`
	// History of status updates (admin only)
	StatusUpdates []EvaluationJobStatusUpdate `json:"status_updates"`
	// The type of evaluation
	//
	// Any of "classify", "score", "compare".
	Type EvaluationJobType `json:"type"`
	// When the job was last updated
	UpdatedAt time.Time `json:"updated_at" format:"date-time"`
	// The evaluation job ID
	WorkflowID string `json:"workflow_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreatedAt     respjson.Field
		OwnerID       respjson.Field
		Parameters    respjson.Field
		Results       respjson.Field
		Status        respjson.Field
		StatusUpdates respjson.Field
		Type          respjson.Field
		UpdatedAt     respjson.Field
		WorkflowID    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJob) RawJSON

func (r EvaluationJob) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvaluationJob) UnmarshalJSON

func (r *EvaluationJob) UnmarshalJSON(data []byte) error

type EvaluationJobResultsError

type EvaluationJobResultsError struct {
	Error string `json:"error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Error       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJobResultsError) RawJSON

func (r EvaluationJobResultsError) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvaluationJobResultsError) UnmarshalJSON

func (r *EvaluationJobResultsError) UnmarshalJSON(data []byte) error

type EvaluationJobResultsEvaluationClassifyResults

type EvaluationJobResultsEvaluationClassifyResults struct {
	// Number of failed generations.
	GenerationFailCount float64 `json:"generation_fail_count" api:"nullable"`
	// Number of invalid labels
	InvalidLabelCount float64 `json:"invalid_label_count" api:"nullable"`
	// Number of failed judge generations
	JudgeFailCount float64 `json:"judge_fail_count" api:"nullable"`
	// JSON string representing label counts
	LabelCounts string `json:"label_counts"`
	// Pecentage of pass labels.
	PassPercentage float64 `json:"pass_percentage" api:"nullable"`
	// Data File ID
	ResultFileID string `json:"result_file_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		GenerationFailCount respjson.Field
		InvalidLabelCount   respjson.Field
		JudgeFailCount      respjson.Field
		LabelCounts         respjson.Field
		PassPercentage      respjson.Field
		ResultFileID        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJobResultsEvaluationClassifyResults) RawJSON

Returns the unmodified JSON received from the API

func (*EvaluationJobResultsEvaluationClassifyResults) UnmarshalJSON

func (r *EvaluationJobResultsEvaluationClassifyResults) UnmarshalJSON(data []byte) error

type EvaluationJobResultsEvaluationCompareResults

type EvaluationJobResultsEvaluationCompareResults struct {
	// Number of samples where model A was judged the winner
	AWins int64 `json:"A_wins"`
	// Number of samples where model B was judged the winner
	BWins int64 `json:"B_wins"`
	// Number of generation failures across model A and model B.
	GenerationFailCount float64 `json:"generation_fail_count" api:"nullable"`
	// Number of judge inference failures. In the default two-pass mode
	// (disable_position_bias_correction=false) this is the combined failure count from
	// both the original-order and flipped-order judge passes.
	JudgeFailCount float64 `json:"judge_fail_count" api:"nullable"`
	// File ID of the detailed output file. Each row contains the original input fields
	// plus judge outputs. In two-pass mode the file includes both original-order and
	// flipped-order judge fields; in single-pass mode
	// (disable_position_bias_correction=true) only original-order fields are present.
	ResultFileID string `json:"result_file_id"`
	// Number of samples that resulted in a tie score
	Ties int64 `json:"Ties"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AWins               respjson.Field
		BWins               respjson.Field
		GenerationFailCount respjson.Field
		JudgeFailCount      respjson.Field
		ResultFileID        respjson.Field
		Ties                respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJobResultsEvaluationCompareResults) RawJSON

Returns the unmodified JSON received from the API

func (*EvaluationJobResultsEvaluationCompareResults) UnmarshalJSON

func (r *EvaluationJobResultsEvaluationCompareResults) UnmarshalJSON(data []byte) error

type EvaluationJobResultsEvaluationScoreResults

type EvaluationJobResultsEvaluationScoreResults struct {
	AggregatedScores EvaluationJobResultsEvaluationScoreResultsAggregatedScores `json:"aggregated_scores"`
	// number of failed samples generated from model
	FailedSamples float64 `json:"failed_samples"`
	// Number of failed generations.
	GenerationFailCount float64 `json:"generation_fail_count" api:"nullable"`
	// number of invalid scores generated from model
	InvalidScoreCount float64 `json:"invalid_score_count"`
	// Number of failed judge generations
	JudgeFailCount float64 `json:"judge_fail_count" api:"nullable"`
	// Data File ID
	ResultFileID string `json:"result_file_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AggregatedScores    respjson.Field
		FailedSamples       respjson.Field
		GenerationFailCount respjson.Field
		InvalidScoreCount   respjson.Field
		JudgeFailCount      respjson.Field
		ResultFileID        respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJobResultsEvaluationScoreResults) RawJSON

Returns the unmodified JSON received from the API

func (*EvaluationJobResultsEvaluationScoreResults) UnmarshalJSON

func (r *EvaluationJobResultsEvaluationScoreResults) UnmarshalJSON(data []byte) error

type EvaluationJobResultsEvaluationScoreResultsAggregatedScores

type EvaluationJobResultsEvaluationScoreResultsAggregatedScores struct {
	MeanScore      float64 `json:"mean_score"`
	PassPercentage float64 `json:"pass_percentage"`
	StdScore       float64 `json:"std_score"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MeanScore      respjson.Field
		PassPercentage respjson.Field
		StdScore       respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJobResultsEvaluationScoreResultsAggregatedScores) RawJSON

Returns the unmodified JSON received from the API

func (*EvaluationJobResultsEvaluationScoreResultsAggregatedScores) UnmarshalJSON

type EvaluationJobResultsUnion

type EvaluationJobResultsUnion struct {
	GenerationFailCount float64 `json:"generation_fail_count"`
	// This field is from variant [EvaluationJobResultsEvaluationClassifyResults].
	InvalidLabelCount float64 `json:"invalid_label_count"`
	JudgeFailCount    float64 `json:"judge_fail_count"`
	// This field is from variant [EvaluationJobResultsEvaluationClassifyResults].
	LabelCounts string `json:"label_counts"`
	// This field is from variant [EvaluationJobResultsEvaluationClassifyResults].
	PassPercentage float64 `json:"pass_percentage"`
	ResultFileID   string  `json:"result_file_id"`
	// This field is from variant [EvaluationJobResultsEvaluationScoreResults].
	AggregatedScores EvaluationJobResultsEvaluationScoreResultsAggregatedScores `json:"aggregated_scores"`
	// This field is from variant [EvaluationJobResultsEvaluationScoreResults].
	FailedSamples float64 `json:"failed_samples"`
	// This field is from variant [EvaluationJobResultsEvaluationScoreResults].
	InvalidScoreCount float64 `json:"invalid_score_count"`
	// This field is from variant [EvaluationJobResultsEvaluationCompareResults].
	AWins int64 `json:"A_wins"`
	// This field is from variant [EvaluationJobResultsEvaluationCompareResults].
	BWins int64 `json:"B_wins"`
	// This field is from variant [EvaluationJobResultsEvaluationCompareResults].
	Ties int64 `json:"Ties"`
	// This field is from variant [EvaluationJobResultsError].
	Error string `json:"error"`
	JSON  struct {
		GenerationFailCount respjson.Field
		InvalidLabelCount   respjson.Field
		JudgeFailCount      respjson.Field
		LabelCounts         respjson.Field
		PassPercentage      respjson.Field
		ResultFileID        respjson.Field
		AggregatedScores    respjson.Field
		FailedSamples       respjson.Field
		InvalidScoreCount   respjson.Field
		AWins               respjson.Field
		BWins               respjson.Field
		Ties                respjson.Field
		Error               respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

EvaluationJobResultsUnion contains all possible properties and values from EvaluationJobResultsEvaluationClassifyResults, EvaluationJobResultsEvaluationScoreResults, EvaluationJobResultsEvaluationCompareResults, EvaluationJobResultsError.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (EvaluationJobResultsUnion) AsEvaluationJobResultsError

func (u EvaluationJobResultsUnion) AsEvaluationJobResultsError() (v EvaluationJobResultsError)

func (EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationClassifyResults

func (u EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationClassifyResults() (v EvaluationJobResultsEvaluationClassifyResults)

func (EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationCompareResults

func (u EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationCompareResults() (v EvaluationJobResultsEvaluationCompareResults)

func (EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationScoreResults

func (u EvaluationJobResultsUnion) AsEvaluationJobResultsEvaluationScoreResults() (v EvaluationJobResultsEvaluationScoreResults)

func (EvaluationJobResultsUnion) RawJSON

func (u EvaluationJobResultsUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvaluationJobResultsUnion) UnmarshalJSON

func (r *EvaluationJobResultsUnion) UnmarshalJSON(data []byte) error

type EvaluationJobStatus

type EvaluationJobStatus string

Current status of the job

const (
	EvaluationJobStatusPending   EvaluationJobStatus = "pending"
	EvaluationJobStatusQueued    EvaluationJobStatus = "queued"
	EvaluationJobStatusRunning   EvaluationJobStatus = "running"
	EvaluationJobStatusCompleted EvaluationJobStatus = "completed"
	EvaluationJobStatusError     EvaluationJobStatus = "error"
	EvaluationJobStatusUserError EvaluationJobStatus = "user_error"
)

type EvaluationJobStatusUpdate

type EvaluationJobStatusUpdate struct {
	// Additional message for this update
	Message string `json:"message"`
	// The status at this update
	Status string `json:"status"`
	// When this update occurred
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Status      respjson.Field
		Timestamp   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EvaluationJobStatusUpdate) RawJSON

func (r EvaluationJobStatusUpdate) RawJSON() string

Returns the unmodified JSON received from the API

func (*EvaluationJobStatusUpdate) UnmarshalJSON

func (r *EvaluationJobStatusUpdate) UnmarshalJSON(data []byte) error

type EvaluationJobType

type EvaluationJobType string

The type of evaluation

const (
	EvaluationJobTypeClassify EvaluationJobType = "classify"
	EvaluationJobTypeScore    EvaluationJobType = "score"
	EvaluationJobTypeCompare  EvaluationJobType = "compare"
)

type FileDeleteResponse

type FileDeleteResponse struct {
	ID      string `json:"id"`
	Deleted bool   `json:"deleted"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Deleted     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FileDeleteResponse) RawJSON

func (r FileDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FileDeleteResponse) UnmarshalJSON

func (r *FileDeleteResponse) UnmarshalJSON(data []byte) error

type FileList

type FileList struct {
	Data []FileResponse `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FileList) RawJSON

func (r FileList) RawJSON() string

Returns the unmodified JSON received from the API

func (*FileList) UnmarshalJSON

func (r *FileList) UnmarshalJSON(data []byte) error

type FilePurpose

type FilePurpose string

The purpose of the file

const (
	FilePurposeFineTune    FilePurpose = "fine-tune"
	FilePurposeCalibration FilePurpose = "calibration"
	FilePurposeEval        FilePurpose = "eval"
	FilePurposeBatchAPI    FilePurpose = "batch-api"
)

type FileResponse

type FileResponse struct {
	// ID of the file.
	ID string `json:"id" api:"required"`
	// The number of bytes in the file.
	Bytes int64 `json:"bytes" api:"required"`
	// The timestamp when the file was created.
	CreatedAt int64 `json:"created_at" api:"required"`
	// The name of the file as it was uploaded.
	Filename string `json:"filename" api:"required"`
	// The type of the file such as `jsonl`, `csv`, or `parquet`.
	//
	// Any of "csv", "jsonl", "parquet".
	FileType FileType `json:"FileType" api:"required"`
	// The object type, which is always `file`.
	Object constant.File `json:"object" default:"file"`
	// The purpose of the file as it was uploaded.
	//
	// Any of "fine-tune", "calibration", "eval", "batch-api".
	Purpose FilePurpose `json:"purpose" api:"required"`
	// Lifecycle state of the file validation pipeline. Files for purposes that do not
	// require validation skip validation.
	//
	// Any of "PENDING", "QUEUED", "RUNNING", "COMPLETED", "FAILED", "INVALID_FORMAT".
	ProcessingStatus FileResponseProcessingStatus `json:"processing_status"`
	// Report produced by the file validation pipeline. Present once validation has
	// run; absent on files that bypassed validation or have not yet been validated.
	ValidationReport FileResponseValidationReport `json:"validation_report"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		Bytes            respjson.Field
		CreatedAt        respjson.Field
		Filename         respjson.Field
		FileType         respjson.Field
		Object           respjson.Field
		Purpose          respjson.Field
		ProcessingStatus respjson.Field
		ValidationReport respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Structured information describing a file uploaded to Together.

func (FileResponse) RawJSON

func (r FileResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FileResponse) UnmarshalJSON

func (r *FileResponse) UnmarshalJSON(data []byte) error

type FileResponseProcessingStatus added in v0.11.0

type FileResponseProcessingStatus string

Lifecycle state of the file validation pipeline. Files for purposes that do not require validation skip validation.

const (
	FileResponseProcessingStatusPending       FileResponseProcessingStatus = "PENDING"
	FileResponseProcessingStatusQueued        FileResponseProcessingStatus = "QUEUED"
	FileResponseProcessingStatusRunning       FileResponseProcessingStatus = "RUNNING"
	FileResponseProcessingStatusCompleted     FileResponseProcessingStatus = "COMPLETED"
	FileResponseProcessingStatusFailed        FileResponseProcessingStatus = "FAILED"
	FileResponseProcessingStatusInvalidFormat FileResponseProcessingStatus = "INVALID_FORMAT"
)

type FileResponseValidationReport added in v0.11.0

type FileResponseValidationReport struct {
	// Whether the file passed validation.
	Valid bool `json:"valid" api:"required"`
	// Detected dataset format (e.g. `CONVERSATION`, `INSTRUCTION`).
	DatasetFormat string `json:"dataset_format"`
	// Whether the dataset carries per-message weights (only possible for
	// `CONVERSATION` format).
	DatasetHasMessageWeights bool `json:"dataset_has_message_weights"`
	// Whether the dataset contains parallel tool-use messages.
	DatasetHasParallelToolCalls bool `json:"dataset_has_parallel_tool_calls"`
	// Whether the dataset contains reasoning content.
	DatasetHasReasoning bool `json:"dataset_has_reasoning"`
	// Whether the dataset carries per-sample weights.
	DatasetHasSampleWeights bool `json:"dataset_has_sample_weights"`
	// Whether the dataset contains tool-use messages.
	DatasetHasTools bool `json:"dataset_has_tools"`
	// Whether the dataset contains multimodal content.
	DatasetIsMultimodal bool `json:"dataset_is_multimodal"`
	// Human-readable validation error message. Only present when `error_type` is set
	// (i.e. user-correctable failures).
	Error string `json:"error"`
	// Category of validation failure.
	//
	// Any of "INVALID_FORMAT".
	ErrorType string `json:"error_type"`
	// ID of the file this report describes.
	FileID string `json:"file_id"`
	// Number of lines (records) in the dataset.
	Nlines int64 `json:"nlines"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Valid                       respjson.Field
		DatasetFormat               respjson.Field
		DatasetHasMessageWeights    respjson.Field
		DatasetHasParallelToolCalls respjson.Field
		DatasetHasReasoning         respjson.Field
		DatasetHasSampleWeights     respjson.Field
		DatasetHasTools             respjson.Field
		DatasetIsMultimodal         respjson.Field
		Error                       respjson.Field
		ErrorType                   respjson.Field
		FileID                      respjson.Field
		Nlines                      respjson.Field
		ExtraFields                 map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Report produced by the file validation pipeline. Present once validation has run; absent on files that bypassed validation or have not yet been validated.

func (FileResponseValidationReport) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*FileResponseValidationReport) UnmarshalJSON added in v0.11.0

func (r *FileResponseValidationReport) UnmarshalJSON(data []byte) error

type FileService

type FileService struct {
	Options []option.RequestOption
}

FileService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFileService method instead.

func NewFileService

func NewFileService(opts ...option.RequestOption) (r FileService)

NewFileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FileService) Content

func (r *FileService) Content(ctx context.Context, id string, opts ...option.RequestOption) (res *http.Response, err error)

Get the contents of a single uploaded data file.

func (*FileService) Delete

func (r *FileService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *FileDeleteResponse, err error)

Delete a previously uploaded data file.

func (*FileService) Get

func (r *FileService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *FileResponse, err error)

Retrieve the metadata for a single uploaded data file.

func (*FileService) List

func (r *FileService) List(ctx context.Context, opts ...option.RequestOption) (res *FileList, err error)

List the metadata for all uploaded data files.

func (*FileService) Upload

func (r *FileService) Upload(ctx context.Context, body FileUploadParams, opts ...option.RequestOption) (res *FileResponse, err error)

Upload a file with specified purpose, file name, and file type.

type FileType

type FileType string

The type of the file

const (
	FileTypeCsv     FileType = "csv"
	FileTypeJSONL   FileType = "jsonl"
	FileTypeParquet FileType = "parquet"
)

type FileUploadParams

type FileUploadParams struct {
	// The content of the file being uploaded
	File io.Reader `json:"file,omitzero" api:"required" format:"binary"`
	// The name of the file being uploaded. Must be valid UTF-8, must not contain null
	// characters, and must not exceed 128 bytes.
	FileName string `json:"file_name" api:"required"`
	// The purpose of the file
	//
	// Any of "fine-tune", "calibration", "eval", "batch-api".
	Purpose FilePurpose `json:"purpose,omitzero" api:"required"`
	// The type of the file
	//
	// Any of "csv", "jsonl", "parquet".
	FileType FileType `json:"file_type,omitzero"`
	// contains filtered or unexported fields
}

func (FileUploadParams) MarshalMultipart

func (r FileUploadParams) MarshalMultipart() (data []byte, contentType string, err error)

type FineTunePreviewResponse added in v0.12.0

type FineTunePreviewResponse struct {
	// Detected SFT dataset format for the sampled rows.
	//
	// Any of "general", "conversation", "instruction".
	DatasetFormat FineTunePreviewResponseDatasetFormat `json:"dataset_format" api:"required"`
	// Maximum sequence length configured for the requested model.
	MaxSeqLength int64 `json:"max_seq_length" api:"required"`
	// Name of the base model used to tokenize the sampled rows.
	Model string `json:"model" api:"required"`
	// Tokenized preview rows, in the same order as the sampled training file rows.
	Rows []FineTunePreviewRow `json:"rows" api:"required"`
	// Whether prompt or user-message tokens contribute to training loss.
	TrainOnInputs bool `json:"train_on_inputs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DatasetFormat respjson.Field
		MaxSeqLength  respjson.Field
		Model         respjson.Field
		Rows          respjson.Field
		TrainOnInputs respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Tokenized preview for sampled rows from a fine-tuning training file.

func (FineTunePreviewResponse) RawJSON added in v0.12.0

func (r FineTunePreviewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FineTunePreviewResponse) UnmarshalJSON added in v0.12.0

func (r *FineTunePreviewResponse) UnmarshalJSON(data []byte) error

type FineTunePreviewResponseDatasetFormat added in v0.12.0

type FineTunePreviewResponseDatasetFormat string

Detected SFT dataset format for the sampled rows.

const (
	FineTunePreviewResponseDatasetFormatGeneral      FineTunePreviewResponseDatasetFormat = "general"
	FineTunePreviewResponseDatasetFormatConversation FineTunePreviewResponseDatasetFormat = "conversation"
	FineTunePreviewResponseDatasetFormatInstruction  FineTunePreviewResponseDatasetFormat = "instruction"
)

type FineTunePreviewRow added in v0.12.0

type FineTunePreviewRow struct {
	// Token IDs produced for the sampled row.
	InputIDs []int64 `json:"input_ids" api:"required"`
	// Training labels for each token; masked tokens use -100.
	Labels []int64 `json:"labels" api:"required"`
	// Total number of tokens in the preview row after truncation.
	NumTokens int64 `json:"num_tokens" api:"required"`
	// Number of tokens in the row that contribute to training loss.
	NumTrainedTokens int64 `json:"num_trained_tokens" api:"required"`
	// Raw token strings produced for the sampled row.
	Tokens []string `json:"tokens" api:"required"`
	// Half-open token index ranges that contribute to training loss.
	TrainedSpans [][]int64 `json:"trained_spans" api:"required"`
	// Whether the row was truncated to the model maximum sequence length.
	Truncated bool `json:"truncated" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		InputIDs         respjson.Field
		Labels           respjson.Field
		NumTokens        respjson.Field
		NumTrainedTokens respjson.Field
		Tokens           respjson.Field
		TrainedSpans     respjson.Field
		Truncated        respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Tokenized representation of one sampled fine-tuning row.

func (FineTunePreviewRow) RawJSON added in v0.12.0

func (r FineTunePreviewRow) RawJSON() string

Returns the unmodified JSON received from the API

func (*FineTunePreviewRow) UnmarshalJSON added in v0.12.0

func (r *FineTunePreviewRow) UnmarshalJSON(data []byte) error

type FineTuneTokenizedDatasetRetrieveResponse added in v0.13.0

type FineTuneTokenizedDatasetRetrieveResponse struct {
	// MIME type for the tokenized dataset archive.
	ContentType string `json:"content_type" api:"required"`
	// Time when the presigned download URL expires.
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// Archive filename to use when saving the downloaded tokenized dataset.
	Filename string `json:"filename" api:"required"`
	// Archive size in bytes.
	Size int64 `json:"size" api:"required"`
	// Presigned URL for downloading the tokenized dataset archive.
	URL string `json:"url" api:"required" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ContentType respjson.Field
		ExpiresAt   respjson.Field
		Filename    respjson.Field
		Size        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Presigned download metadata for a fine-tune tokenized dataset archive.

func (FineTuneTokenizedDatasetRetrieveResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*FineTuneTokenizedDatasetRetrieveResponse) UnmarshalJSON added in v0.13.0

func (r *FineTuneTokenizedDatasetRetrieveResponse) UnmarshalJSON(data []byte) error

type FineTuningCancelResponse

type FineTuningCancelResponse struct {
	// Unique identifier for the fine-tune job
	ID string `json:"id" api:"required"`
	// Creation timestamp of the fine-tune job
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Any of "pending", "queued", "running", "compressing", "uploading",
	// "cancel_requested", "cancelled", "error", "completed".
	Status FineTuningCancelResponseStatus `json:"status" api:"required"`
	// Last update timestamp of the fine-tune job
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// ID of the user who created the fine-tune job.
	UserID string `json:"user_id" api:"required"`
	// Batch size used for training
	BatchSize int64 `json:"batch_size"`
	// Whether the early-stopping criterion triggered.
	EarlyStopped bool `json:"early_stopped"`
	// Best validation loss observed, corresponding to early_stopping_best_step. Null
	// if no improving evaluation was recorded.
	EarlyStoppingBestMetric float64 `json:"early_stopping_best_metric" api:"nullable"`
	// Step associated with the selected early-stopping artifact. When
	// early_stopping_best_metric is null, no finite best metric was recorded; this is
	// the halt step, not a best-checkpoint step.
	EarlyStoppingBestStep int64 `json:"early_stopping_best_step"`
	// Events related to this fine-tune job
	Events []FinetuneEvent `json:"events"`
	// Checkpoint used to continue training
	FromCheckpoint string `json:"from_checkpoint"`
	// Hugging Face Hub repo to start training from
	FromHfModel string `json:"from_hf_model"`
	// The revision of the Hugging Face Hub model to continue training from
	HfModelRevision string `json:"hf_model_revision"`
	// Learning rate used for training
	LearningRate float64 `json:"learning_rate"`
	// Learning rate scheduler configuration
	LrScheduler FineTuningCancelResponseLrScheduler `json:"lr_scheduler"`
	// Maximum gradient norm for clipping
	MaxGradNorm float64 `json:"max_grad_norm"`
	// Maximum sequence length to use for training. If not specified, uses the maximum
	// allowed for the model and training method.
	MaxSeqLength int64 `json:"max_seq_length"`
	// Base model used for fine-tuning
	Model           string `json:"model"`
	ModelOutputName string `json:"model_output_name"`
	// Number of checkpoints saved during training
	NCheckpoints int64 `json:"n_checkpoints"`
	// Number of training epochs
	NEpochs int64 `json:"n_epochs"`
	// Number of evaluations during training
	NEvals int64 `json:"n_evals"`
	// Owner address information
	OwnerAddress string `json:"owner_address"`
	// Whether sequence packing is being used for training.
	Packing bool `json:"packing"`
	// Progress information for the fine-tuning job
	Progress FineTuningCancelResponseProgress `json:"progress"`
	// Random seed used for training. Integer when set; null if not stored (e.g. legacy
	// jobs) or no explicit seed was recorded.
	RandomSeed int64 `json:"random_seed" api:"nullable"`
	// Start timestamp of the current stage of the fine-tune job
	StartedAt time.Time `json:"started_at" format:"date-time"`
	// Suffix added to the fine-tuned model name
	Suffix string `json:"suffix"`
	// Count of tokens processed
	TokenCount int64 `json:"token_count"`
	// Total price for the fine-tuning job
	TotalPrice int64 `json:"total_price"`
	// File-ID of the training file
	TrainingFile string `json:"training_file"`
	// Method of training used
	TrainingMethod FineTuningCancelResponseTrainingMethodUnion `json:"training_method"`
	// Type of training used (full or LoRA)
	TrainingType FineTuningCancelResponseTrainingTypeUnion `json:"training_type"`
	// File-ID of the validation file
	ValidationFile string `json:"validation_file"`
	// Weights & Biases run name
	WandbName string `json:"wandb_name"`
	// Weights & Biases project name
	WandbProjectName string `json:"wandb_project_name"`
	// Ratio of warmup steps
	WarmupRatio float64 `json:"warmup_ratio"`
	// Weight decay value used
	WeightDecay float64 `json:"weight_decay"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                      respjson.Field
		CreatedAt               respjson.Field
		Status                  respjson.Field
		UpdatedAt               respjson.Field
		UserID                  respjson.Field
		BatchSize               respjson.Field
		EarlyStopped            respjson.Field
		EarlyStoppingBestMetric respjson.Field
		EarlyStoppingBestStep   respjson.Field
		Events                  respjson.Field
		FromCheckpoint          respjson.Field
		FromHfModel             respjson.Field
		HfModelRevision         respjson.Field
		LearningRate            respjson.Field
		LrScheduler             respjson.Field
		MaxGradNorm             respjson.Field
		MaxSeqLength            respjson.Field
		Model                   respjson.Field
		ModelOutputName         respjson.Field
		NCheckpoints            respjson.Field
		NEpochs                 respjson.Field
		NEvals                  respjson.Field
		OwnerAddress            respjson.Field
		Packing                 respjson.Field
		Progress                respjson.Field
		RandomSeed              respjson.Field
		StartedAt               respjson.Field
		Suffix                  respjson.Field
		TokenCount              respjson.Field
		TotalPrice              respjson.Field
		TrainingFile            respjson.Field
		TrainingMethod          respjson.Field
		TrainingType            respjson.Field
		ValidationFile          respjson.Field
		WandbName               respjson.Field
		WandbProjectName        respjson.Field
		WarmupRatio             respjson.Field
		WeightDecay             respjson.Field
		ExtraFields             map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A truncated version of the fine-tune response, used for POST /fine-tunes, GET /fine-tunes and POST /fine-tunes/{id}/cancel endpoints

func (FineTuningCancelResponse) RawJSON

func (r FineTuningCancelResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponse) UnmarshalJSON

func (r *FineTuningCancelResponse) UnmarshalJSON(data []byte) error

type FineTuningCancelResponseLrScheduler

type FineTuningCancelResponseLrScheduler struct {
	// Any of "linear", "cosine".
	LrSchedulerType string                                                  `json:"lr_scheduler_type" api:"required"`
	LrSchedulerArgs FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion `json:"lr_scheduler_args"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LrSchedulerType respjson.Field
		LrSchedulerArgs respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Learning rate scheduler configuration

func (FineTuningCancelResponseLrScheduler) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseLrScheduler) UnmarshalJSON

func (r *FineTuningCancelResponseLrScheduler) UnmarshalJSON(data []byte) error

type FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

type FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio" api:"required"`
	// Number or fraction of cycles for the cosine learning rate scheduler
	NumCycles float64 `json:"num_cycles" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		NumCycles   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON

type FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

type FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON

type FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion

type FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion struct {
	MinLrRatio float64 `json:"min_lr_ratio"`
	// This field is from variant
	// [FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs].
	NumCycles float64 `json:"num_cycles"`
	JSON      struct {
		MinLrRatio respjson.Field
		NumCycles  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion contains all possible properties and values from FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs, FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

func (u FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs() (v FineTuningCancelResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs)

func (FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

func (u FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs() (v FineTuningCancelResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs)

func (FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON

type FineTuningCancelResponseProgress added in v0.2.0

type FineTuningCancelResponseProgress struct {
	// Whether time estimate is available
	EstimateAvailable bool `json:"estimate_available" api:"required"`
	// Estimated time remaining in seconds for the fine-tuning job to next state
	SecondsRemaining int64 `json:"seconds_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EstimateAvailable respjson.Field
		SecondsRemaining  respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Progress information for the fine-tuning job

func (FineTuningCancelResponseProgress) RawJSON added in v0.2.0

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseProgress) UnmarshalJSON added in v0.2.0

func (r *FineTuningCancelResponseProgress) UnmarshalJSON(data []byte) error

type FineTuningCancelResponseStatus

type FineTuningCancelResponseStatus string
const (
	FineTuningCancelResponseStatusPending         FineTuningCancelResponseStatus = "pending"
	FineTuningCancelResponseStatusQueued          FineTuningCancelResponseStatus = "queued"
	FineTuningCancelResponseStatusRunning         FineTuningCancelResponseStatus = "running"
	FineTuningCancelResponseStatusCompressing     FineTuningCancelResponseStatus = "compressing"
	FineTuningCancelResponseStatusUploading       FineTuningCancelResponseStatus = "uploading"
	FineTuningCancelResponseStatusCancelRequested FineTuningCancelResponseStatus = "cancel_requested"
	FineTuningCancelResponseStatusCancelled       FineTuningCancelResponseStatus = "cancelled"
	FineTuningCancelResponseStatusError           FineTuningCancelResponseStatus = "error"
	FineTuningCancelResponseStatusCompleted       FineTuningCancelResponseStatus = "completed"
)

type FineTuningCancelResponseTrainingMethodTrainingMethodDpo

type FineTuningCancelResponseTrainingMethodTrainingMethodDpo struct {
	// Any of "dpo".
	Method                        string  `json:"method" api:"required"`
	DpoBeta                       float64 `json:"dpo_beta"`
	DpoNormalizeLogratiosByLength bool    `json:"dpo_normalize_logratios_by_length"`
	DpoReferenceFree              bool    `json:"dpo_reference_free"`
	RpoAlpha                      float64 `json:"rpo_alpha"`
	SimpoGamma                    float64 `json:"simpo_gamma"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method                        respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		ExtraFields                   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningCancelResponseTrainingMethodTrainingMethodDpo) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingMethodTrainingMethodDpo) UnmarshalJSON

type FineTuningCancelResponseTrainingMethodTrainingMethodSft

type FineTuningCancelResponseTrainingMethodTrainingMethodSft struct {
	// Any of "sft".
	Method string `json:"method" api:"required"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method        respjson.Field
		TrainOnInputs respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningCancelResponseTrainingMethodTrainingMethodSft) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingMethodTrainingMethodSft) UnmarshalJSON

type FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString

type FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString string
const (
	FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsStringAuto FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString = "auto"
)

type FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion

type FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion struct {
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString string `json:",inline"`
	JSON                                                                         struct {
		OfBool                                                                       respjson.Field
		OfFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion contains all possible properties and values from [bool], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfBool OfFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString]

func (FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool

func (FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString

func (u FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)

func (FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON

type FineTuningCancelResponseTrainingMethodUnion

type FineTuningCancelResponseTrainingMethodUnion struct {
	Method string `json:"method"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingMethodTrainingMethodSft].
	TrainOnInputs FineTuningCancelResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingMethodTrainingMethodDpo].
	DpoBeta float64 `json:"dpo_beta"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingMethodTrainingMethodDpo].
	DpoNormalizeLogratiosByLength bool `json:"dpo_normalize_logratios_by_length"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingMethodTrainingMethodDpo].
	DpoReferenceFree bool `json:"dpo_reference_free"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingMethodTrainingMethodDpo].
	RpoAlpha float64 `json:"rpo_alpha"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingMethodTrainingMethodDpo].
	SimpoGamma float64 `json:"simpo_gamma"`
	JSON       struct {
		Method                        respjson.Field
		TrainOnInputs                 respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningCancelResponseTrainingMethodUnion contains all possible properties and values from FineTuningCancelResponseTrainingMethodTrainingMethodSft, FineTuningCancelResponseTrainingMethodTrainingMethodDpo.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningCancelResponseTrainingMethodUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodDpo

func (u FineTuningCancelResponseTrainingMethodUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodDpo() (v FineTuningCancelResponseTrainingMethodTrainingMethodDpo)

func (FineTuningCancelResponseTrainingMethodUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodSft

func (u FineTuningCancelResponseTrainingMethodUnion) AsFineTuningCancelResponseTrainingMethodTrainingMethodSft() (v FineTuningCancelResponseTrainingMethodTrainingMethodSft)

func (FineTuningCancelResponseTrainingMethodUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingMethodUnion) UnmarshalJSON

func (r *FineTuningCancelResponseTrainingMethodUnion) UnmarshalJSON(data []byte) error

type FineTuningCancelResponseTrainingTypeFullTrainingType

type FineTuningCancelResponseTrainingTypeFullTrainingType struct {
	// Any of "Full".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningCancelResponseTrainingTypeFullTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingTypeFullTrainingType) UnmarshalJSON

type FineTuningCancelResponseTrainingTypeLoRaTrainingType

type FineTuningCancelResponseTrainingTypeLoRaTrainingType struct {
	// Scaling factor applied to the LoRA adapter weights.
	LoraAlpha int64 `json:"lora_alpha" api:"required"`
	// Rank of the LoRA adapter matrices.
	LoraR int64 `json:"lora_r" api:"required"`
	// Identifies this request as a LoRA fine-tune.
	//
	// Any of "Lora".
	Type string `json:"type" api:"required"`
	// Dropout probability applied to LoRA adapter inputs.
	LoraDropout float64 `json:"lora_dropout"`
	// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE
	// expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention
	// modules on compatible models. Fine-tuning jobs that target expert modules
	// produce adapter-only output unless the selected model supports merged expert
	// LoRA output.
	LoraTrainableModules string `json:"lora_trainable_modules"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		Type                 respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LoRA training configuration for a fine-tuning job.

func (FineTuningCancelResponseTrainingTypeLoRaTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingTypeLoRaTrainingType) UnmarshalJSON

type FineTuningCancelResponseTrainingTypeUnion

type FineTuningCancelResponseTrainingTypeUnion struct {
	Type string `json:"type"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingTypeLoRaTrainingType].
	LoraAlpha int64 `json:"lora_alpha"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingTypeLoRaTrainingType].
	LoraR int64 `json:"lora_r"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingTypeLoRaTrainingType].
	LoraDropout float64 `json:"lora_dropout"`
	// This field is from variant
	// [FineTuningCancelResponseTrainingTypeLoRaTrainingType].
	LoraTrainableModules string `json:"lora_trainable_modules"`
	JSON                 struct {
		Type                 respjson.Field
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningCancelResponseTrainingTypeUnion contains all possible properties and values from FineTuningCancelResponseTrainingTypeFullTrainingType, FineTuningCancelResponseTrainingTypeLoRaTrainingType.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningCancelResponseTrainingTypeUnion) AsFineTuningCancelResponseTrainingTypeFullTrainingType

func (u FineTuningCancelResponseTrainingTypeUnion) AsFineTuningCancelResponseTrainingTypeFullTrainingType() (v FineTuningCancelResponseTrainingTypeFullTrainingType)

func (FineTuningCancelResponseTrainingTypeUnion) AsFineTuningCancelResponseTrainingTypeLoRaTrainingType

func (u FineTuningCancelResponseTrainingTypeUnion) AsFineTuningCancelResponseTrainingTypeLoRaTrainingType() (v FineTuningCancelResponseTrainingTypeLoRaTrainingType)

func (FineTuningCancelResponseTrainingTypeUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningCancelResponseTrainingTypeUnion) UnmarshalJSON

func (r *FineTuningCancelResponseTrainingTypeUnion) UnmarshalJSON(data []byte) error

type FineTuningContentParams

type FineTuningContentParams struct {
	// Fine-tune ID to download. A string that starts with `ft-`.
	FtID string `query:"ft_id" api:"required" json:"-"`
	// Specifies the checkpoint step to download from the list checkpoints response. A
	// final checkpoint step downloads the final model; 0 or omitted downloads the
	// final model by default. Ignores `checkpoint` value if set.
	CheckpointStep param.Opt[int64] `query:"checkpoint_step,omitzero" json:"-"`
	// Specifies checkpoint type to download - `merged` vs `adapter`. This field is
	// required if the checkpoint_step is not set.
	//
	// Any of "merged", "adapter", "model_output_path".
	Checkpoint FineTuningContentParamsCheckpoint `query:"checkpoint,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FineTuningContentParams) URLQuery

func (r FineTuningContentParams) URLQuery() (v url.Values, err error)

URLQuery serializes FineTuningContentParams's query parameters as `url.Values`.

type FineTuningContentParamsCheckpoint

type FineTuningContentParamsCheckpoint string

Specifies checkpoint type to download - `merged` vs `adapter`. This field is required if the checkpoint_step is not set.

const (
	FineTuningContentParamsCheckpointMerged          FineTuningContentParamsCheckpoint = "merged"
	FineTuningContentParamsCheckpointAdapter         FineTuningContentParamsCheckpoint = "adapter"
	FineTuningContentParamsCheckpointModelOutputPath FineTuningContentParamsCheckpoint = "model_output_path"
)

type FineTuningDeleteResponse

type FineTuningDeleteResponse struct {
	// Message indicating the result of the deletion
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningDeleteResponse) RawJSON

func (r FineTuningDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FineTuningDeleteResponse) UnmarshalJSON

func (r *FineTuningDeleteResponse) UnmarshalJSON(data []byte) error

type FineTuningEstimatePriceParams added in v0.2.0

type FineTuningEstimatePriceParams struct {
	// File-ID of a training file uploaded to the Together API
	TrainingFile string `json:"training_file" api:"required"`
	// The checkpoint identifier to continue training from a previous fine-tuning job.
	// Format is `{$JOB_ID}` or `{$OUTPUT_MODEL_NAME}` or `{$JOB_ID}:{$STEP}` or
	// `{$OUTPUT_MODEL_NAME}:{$STEP}`. The step value is optional; without it, uses the
	// final checkpoint.
	FromCheckpoint param.Opt[string] `json:"from_checkpoint,omitzero"`
	// Name of the base model to run fine-tune job on
	Model param.Opt[string] `json:"model,omitzero"`
	// Number of complete passes through the training dataset (higher values may
	// improve results but increase cost and risk of overfitting)
	NEpochs param.Opt[int64] `json:"n_epochs,omitzero"`
	// Number of evaluations to be run on a given validation set during training
	NEvals param.Opt[int64] `json:"n_evals,omitzero"`
	// File-ID of a validation file uploaded to the Together API
	ValidationFile param.Opt[string] `json:"validation_file,omitzero"`
	// The training type to use. Defaults to LoRA if not provided.
	TrainingType FineTuningEstimatePriceParamsTrainingTypeUnion `json:"training_type,omitzero"`
	// The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct
	// Preference Optimization.
	TrainingMethod FineTuningEstimatePriceParamsTrainingMethodUnion `json:"training_method,omitzero"`
	// contains filtered or unexported fields
}

func (FineTuningEstimatePriceParams) MarshalJSON added in v0.2.0

func (r FineTuningEstimatePriceParams) MarshalJSON() (data []byte, err error)

func (*FineTuningEstimatePriceParams) UnmarshalJSON added in v0.2.0

func (r *FineTuningEstimatePriceParams) UnmarshalJSON(data []byte) error

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo struct {
	// Any of "dpo".
	Method                        string             `json:"method,omitzero" api:"required"`
	DpoBeta                       param.Opt[float64] `json:"dpo_beta,omitzero"`
	DpoNormalizeLogratiosByLength param.Opt[bool]    `json:"dpo_normalize_logratios_by_length,omitzero"`
	DpoReferenceFree              param.Opt[bool]    `json:"dpo_reference_free,omitzero"`
	RpoAlpha                      param.Opt[float64] `json:"rpo_alpha,omitzero"`
	SimpoGamma                    param.Opt[float64] `json:"simpo_gamma,omitzero"`
	// contains filtered or unexported fields
}

The property Method is required.

func (FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft struct {
	// Any of "sft".
	Method string `json:"method,omitzero" api:"required"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Method, TrainOnInputs are required.

func (FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsString added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsString string
const (
	FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsStringAuto FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsString = "auto"
)

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion struct {
	OfBool param.Opt[bool] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfFineTuningEstimatePricesTrainingMethodTrainingMethodSftTrainOnInputsString)
	OfFineTuningEstimatePricesTrainingMethodTrainingMethodSftTrainOnInputsString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodUnion added in v0.2.0

type FineTuningEstimatePriceParamsTrainingMethodUnion struct {
	OfFineTuningEstimatePricesTrainingMethodTrainingMethodSft *FineTuningEstimatePriceParamsTrainingMethodTrainingMethodSft `json:",omitzero,inline"`
	OfFineTuningEstimatePricesTrainingMethodTrainingMethodDpo *FineTuningEstimatePriceParamsTrainingMethodTrainingMethodDpo `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoBeta added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoNormalizeLogratiosByLength added in v0.2.0

func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoNormalizeLogratiosByLength() *bool

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoReferenceFree added in v0.2.0

func (u FineTuningEstimatePriceParamsTrainingMethodUnion) GetDpoReferenceFree() *bool

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetMethod added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetRpoAlpha added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetSimpoGamma added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) GetTrainOnInputs added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingMethodUnion) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingMethodUnion) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceParamsTrainingTypeFullTrainingType added in v0.2.0

type FineTuningEstimatePriceParamsTrainingTypeFullTrainingType struct {
	// Any of "Full".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The property Type is required.

func (FineTuningEstimatePriceParamsTrainingTypeFullTrainingType) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingTypeFullTrainingType) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType added in v0.2.0

type FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType struct {
	// Scaling factor applied to the LoRA adapter weights.
	LoraAlpha int64 `json:"lora_alpha" api:"required"`
	// Rank of the LoRA adapter matrices.
	LoraR int64 `json:"lora_r" api:"required"`
	// Identifies this request as a LoRA fine-tune.
	//
	// Any of "Lora".
	Type string `json:"type,omitzero" api:"required"`
	// Dropout probability applied to LoRA adapter inputs.
	LoraDropout param.Opt[float64] `json:"lora_dropout,omitzero"`
	// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE
	// expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention
	// modules on compatible models. Fine-tuning jobs that target expert modules
	// produce adapter-only output unless the selected model supports merged expert
	// LoRA output.
	LoraTrainableModules param.Opt[string] `json:"lora_trainable_modules,omitzero"`
	// contains filtered or unexported fields
}

LoRA training configuration for a fine-tuning job.

The properties LoraAlpha, LoraR, Type are required.

func (FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceParamsTrainingTypeUnion added in v0.2.0

type FineTuningEstimatePriceParamsTrainingTypeUnion struct {
	OfFineTuningEstimatePricesTrainingTypeFullTrainingType *FineTuningEstimatePriceParamsTrainingTypeFullTrainingType `json:",omitzero,inline"`
	OfFineTuningEstimatePricesTrainingTypeLoRaTrainingType *FineTuningEstimatePriceParamsTrainingTypeLoRaTrainingType `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraAlpha added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraDropout added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraR added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraTrainableModules added in v0.2.0

func (u FineTuningEstimatePriceParamsTrainingTypeUnion) GetLoraTrainableModules() *string

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingTypeUnion) GetType added in v0.2.0

Returns a pointer to the underlying variant's property, if present.

func (FineTuningEstimatePriceParamsTrainingTypeUnion) MarshalJSON added in v0.2.0

func (*FineTuningEstimatePriceParamsTrainingTypeUnion) UnmarshalJSON added in v0.2.0

type FineTuningEstimatePriceResponseAvailableEstimate added in v0.11.0

type FineTuningEstimatePriceResponseAvailableEstimate struct {
	// Whether price estimation is available for the requested fine-tune job.
	EstimationAvailable bool `json:"estimation_available" api:"required"`
	// Whether you are allowed to proceed with the fine-tuning job.
	AllowedToProceed bool `json:"allowed_to_proceed"`
	// The estimated number of tokens for evaluation
	EstimatedEvalTokenCount float64 `json:"estimated_eval_token_count"`
	// The price of the fine-tuning job
	EstimatedTotalPrice float64 `json:"estimated_total_price"`
	// The estimated number of tokens to be trained
	EstimatedTrainTokenCount float64 `json:"estimated_train_token_count"`
	// Your credit limit in dollars.
	UserLimit float64 `json:"user_limit"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EstimationAvailable      respjson.Field
		AllowedToProceed         respjson.Field
		EstimatedEvalTokenCount  respjson.Field
		EstimatedTotalPrice      respjson.Field
		EstimatedTrainTokenCount respjson.Field
		UserLimit                respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningEstimatePriceResponseAvailableEstimate) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*FineTuningEstimatePriceResponseAvailableEstimate) UnmarshalJSON added in v0.11.0

type FineTuningEstimatePriceResponseUnavailableEstimate added in v0.11.0

type FineTuningEstimatePriceResponseUnavailableEstimate struct {
	// Whether price estimation is available for the requested fine-tune job.
	EstimationAvailable bool `json:"estimation_available" api:"required"`
	// Reason price estimation is unavailable for the requested fine-tune job.
	//
	// Any of "multimodal_dataset", "train_file_not_validated",
	// "eval_file_not_validated", "train_file_invalid", "eval_file_invalid".
	UnavailableReason string `json:"unavailable_reason" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EstimationAvailable respjson.Field
		UnavailableReason   respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningEstimatePriceResponseUnavailableEstimate) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*FineTuningEstimatePriceResponseUnavailableEstimate) UnmarshalJSON added in v0.11.0

type FineTuningEstimatePriceResponseUnion added in v0.11.0

type FineTuningEstimatePriceResponseUnion struct {
	EstimationAvailable bool `json:"estimation_available"`
	// This field is from variant [FineTuningEstimatePriceResponseAvailableEstimate].
	AllowedToProceed bool `json:"allowed_to_proceed"`
	// This field is from variant [FineTuningEstimatePriceResponseAvailableEstimate].
	EstimatedEvalTokenCount float64 `json:"estimated_eval_token_count"`
	// This field is from variant [FineTuningEstimatePriceResponseAvailableEstimate].
	EstimatedTotalPrice float64 `json:"estimated_total_price"`
	// This field is from variant [FineTuningEstimatePriceResponseAvailableEstimate].
	EstimatedTrainTokenCount float64 `json:"estimated_train_token_count"`
	// This field is from variant [FineTuningEstimatePriceResponseAvailableEstimate].
	UserLimit float64 `json:"user_limit"`
	// This field is from variant [FineTuningEstimatePriceResponseUnavailableEstimate].
	UnavailableReason string `json:"unavailable_reason"`
	JSON              struct {
		EstimationAvailable      respjson.Field
		AllowedToProceed         respjson.Field
		EstimatedEvalTokenCount  respjson.Field
		EstimatedTotalPrice      respjson.Field
		EstimatedTrainTokenCount respjson.Field
		UserLimit                respjson.Field
		UnavailableReason        respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningEstimatePriceResponseUnion contains all possible properties and values from FineTuningEstimatePriceResponseAvailableEstimate, FineTuningEstimatePriceResponseUnavailableEstimate.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningEstimatePriceResponseUnion) AsAvailableEstimate added in v0.11.0

func (FineTuningEstimatePriceResponseUnion) AsUnavailableEstimate added in v0.11.0

func (FineTuningEstimatePriceResponseUnion) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*FineTuningEstimatePriceResponseUnion) UnmarshalJSON added in v0.11.0

func (r *FineTuningEstimatePriceResponseUnion) UnmarshalJSON(data []byte) error

type FineTuningListCheckpointsResponse

type FineTuningListCheckpointsResponse struct {
	Data []FineTuningListCheckpointsResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListCheckpointsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListCheckpointsResponse) UnmarshalJSON

func (r *FineTuningListCheckpointsResponse) UnmarshalJSON(data []byte) error

type FineTuningListCheckpointsResponseData

type FineTuningListCheckpointsResponseData struct {
	// Display label for the checkpoint, including the final or intermediate checkpoint
	// step.
	CheckpointType string `json:"checkpoint_type" api:"required"`
	// Timestamp when the checkpoint was created.
	CreatedAt string `json:"created_at" api:"required"`
	// Storage path for the checkpoint artifact.
	Path string `json:"path" api:"required"`
	// Step represented by the checkpoint; final checkpoints use the shipped model
	// step.
	Step int64 `json:"step" api:"required"`
	// Canonical artifact selector for checkpoint download requests.
	//
	// Any of "model", "adapter".
	Checkpoint string `json:"checkpoint"`
	// Together model registry object ID for the checkpoint artifact (e.g. `ml_...`).
	ObjectID string `json:"object_id"`
	// Together model registry name for the checkpoint artifact, formatted as
	// `<project_slug>/<checkpoint_name>`.
	ObjectName string `json:"object_name"`
	// Together model registry revision ID for the checkpoint artifact (e.g. `rv_...`).
	ObjectRevisionID string `json:"object_revision_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CheckpointType   respjson.Field
		CreatedAt        respjson.Field
		Path             respjson.Field
		Step             respjson.Field
		Checkpoint       respjson.Field
		ObjectID         respjson.Field
		ObjectName       respjson.Field
		ObjectRevisionID respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A checkpoint available for a fine-tuning job.

func (FineTuningListCheckpointsResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListCheckpointsResponseData) UnmarshalJSON

func (r *FineTuningListCheckpointsResponseData) UnmarshalJSON(data []byte) error

type FineTuningListEventsResponse

type FineTuningListEventsResponse struct {
	Data []FinetuneEvent `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListEventsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListEventsResponse) UnmarshalJSON

func (r *FineTuningListEventsResponse) UnmarshalJSON(data []byte) error

type FineTuningListMetricsParams added in v0.10.0

type FineTuningListMetricsParams struct {
	// Return only metrics with global_step >= this value.
	GlobalStepFrom param.Opt[int64] `query:"global_step_from,omitzero" json:"-"`
	// Return only metrics with global_step <= this value.
	GlobalStepTo param.Opt[int64] `query:"global_step_to,omitzero" json:"-"`
	// Return only metrics logged at or after this ISO-8601 timestamp.
	LoggedAtFrom param.Opt[time.Time] `query:"logged_at_from,omitzero" format:"date-time" json:"-"`
	// Return only metrics logged at or before this ISO-8601 timestamp.
	LoggedAtTo param.Opt[time.Time] `query:"logged_at_to,omitzero" format:"date-time" json:"-"`
	// Number of (uniformly sampled) train metrics to return.
	Resolution param.Opt[int64] `query:"resolution,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FineTuningListMetricsParams) URLQuery added in v0.10.0

func (r FineTuningListMetricsParams) URLQuery() (v url.Values, err error)

URLQuery serializes FineTuningListMetricsParams's query parameters as `url.Values`.

type FineTuningListMetricsResponse added in v0.10.0

type FineTuningListMetricsResponse struct {
	Metrics []map[string]float64 `json:"metrics"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metrics     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListMetricsResponse) RawJSON added in v0.10.0

Returns the unmodified JSON received from the API

func (*FineTuningListMetricsResponse) UnmarshalJSON added in v0.10.0

func (r *FineTuningListMetricsResponse) UnmarshalJSON(data []byte) error

type FineTuningListResponse

type FineTuningListResponse struct {
	Data []FineTuningListResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponse) RawJSON

func (r FineTuningListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FineTuningListResponse) UnmarshalJSON

func (r *FineTuningListResponse) UnmarshalJSON(data []byte) error

type FineTuningListResponseData

type FineTuningListResponseData struct {
	// Unique identifier for the fine-tune job
	ID string `json:"id" api:"required"`
	// Creation timestamp of the fine-tune job
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Any of "pending", "queued", "running", "compressing", "uploading",
	// "cancel_requested", "cancelled", "error", "completed".
	Status string `json:"status" api:"required"`
	// Last update timestamp of the fine-tune job
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// ID of the user who created the fine-tune job.
	UserID string `json:"user_id" api:"required"`
	// Batch size used for training
	BatchSize int64 `json:"batch_size"`
	// Whether the early-stopping criterion triggered.
	EarlyStopped bool `json:"early_stopped"`
	// Best validation loss observed, corresponding to early_stopping_best_step. Null
	// if no improving evaluation was recorded.
	EarlyStoppingBestMetric float64 `json:"early_stopping_best_metric" api:"nullable"`
	// Step associated with the selected early-stopping artifact. When
	// early_stopping_best_metric is null, no finite best metric was recorded; this is
	// the halt step, not a best-checkpoint step.
	EarlyStoppingBestStep int64 `json:"early_stopping_best_step"`
	// Events related to this fine-tune job
	Events []FinetuneEvent `json:"events"`
	// Checkpoint used to continue training
	FromCheckpoint string `json:"from_checkpoint"`
	// Hugging Face Hub repo to start training from
	FromHfModel string `json:"from_hf_model"`
	// The revision of the Hugging Face Hub model to continue training from
	HfModelRevision string `json:"hf_model_revision"`
	// Learning rate used for training
	LearningRate float64 `json:"learning_rate"`
	// Learning rate scheduler configuration
	LrScheduler FineTuningListResponseDataLrScheduler `json:"lr_scheduler"`
	// Maximum gradient norm for clipping
	MaxGradNorm float64 `json:"max_grad_norm"`
	// Maximum sequence length to use for training. If not specified, uses the maximum
	// allowed for the model and training method.
	MaxSeqLength int64 `json:"max_seq_length"`
	// Base model used for fine-tuning
	Model           string `json:"model"`
	ModelOutputName string `json:"model_output_name"`
	// Number of checkpoints saved during training
	NCheckpoints int64 `json:"n_checkpoints"`
	// Number of training epochs
	NEpochs int64 `json:"n_epochs"`
	// Number of evaluations during training
	NEvals int64 `json:"n_evals"`
	// Owner address information
	OwnerAddress string `json:"owner_address"`
	// Whether sequence packing is being used for training.
	Packing bool `json:"packing"`
	// Progress information for the fine-tuning job
	Progress FineTuningListResponseDataProgress `json:"progress"`
	// Random seed used for training. Integer when set; null if not stored (e.g. legacy
	// jobs) or no explicit seed was recorded.
	RandomSeed int64 `json:"random_seed" api:"nullable"`
	// Start timestamp of the current stage of the fine-tune job
	StartedAt time.Time `json:"started_at" format:"date-time"`
	// Suffix added to the fine-tuned model name
	Suffix string `json:"suffix"`
	// Count of tokens processed
	TokenCount int64 `json:"token_count"`
	// Total price for the fine-tuning job
	TotalPrice int64 `json:"total_price"`
	// File-ID of the training file
	TrainingFile string `json:"training_file"`
	// Method of training used
	TrainingMethod FineTuningListResponseDataTrainingMethodUnion `json:"training_method"`
	// Type of training used (full or LoRA)
	TrainingType FineTuningListResponseDataTrainingTypeUnion `json:"training_type"`
	// File-ID of the validation file
	ValidationFile string `json:"validation_file"`
	// Weights & Biases run name
	WandbName string `json:"wandb_name"`
	// Weights & Biases project name
	WandbProjectName string `json:"wandb_project_name"`
	// Ratio of warmup steps
	WarmupRatio float64 `json:"warmup_ratio"`
	// Weight decay value used
	WeightDecay float64 `json:"weight_decay"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                      respjson.Field
		CreatedAt               respjson.Field
		Status                  respjson.Field
		UpdatedAt               respjson.Field
		UserID                  respjson.Field
		BatchSize               respjson.Field
		EarlyStopped            respjson.Field
		EarlyStoppingBestMetric respjson.Field
		EarlyStoppingBestStep   respjson.Field
		Events                  respjson.Field
		FromCheckpoint          respjson.Field
		FromHfModel             respjson.Field
		HfModelRevision         respjson.Field
		LearningRate            respjson.Field
		LrScheduler             respjson.Field
		MaxGradNorm             respjson.Field
		MaxSeqLength            respjson.Field
		Model                   respjson.Field
		ModelOutputName         respjson.Field
		NCheckpoints            respjson.Field
		NEpochs                 respjson.Field
		NEvals                  respjson.Field
		OwnerAddress            respjson.Field
		Packing                 respjson.Field
		Progress                respjson.Field
		RandomSeed              respjson.Field
		StartedAt               respjson.Field
		Suffix                  respjson.Field
		TokenCount              respjson.Field
		TotalPrice              respjson.Field
		TrainingFile            respjson.Field
		TrainingMethod          respjson.Field
		TrainingType            respjson.Field
		ValidationFile          respjson.Field
		WandbName               respjson.Field
		WandbProjectName        respjson.Field
		WarmupRatio             respjson.Field
		WeightDecay             respjson.Field
		ExtraFields             map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A truncated version of the fine-tune response, used for POST /fine-tunes, GET /fine-tunes and POST /fine-tunes/{id}/cancel endpoints

func (FineTuningListResponseData) RawJSON

func (r FineTuningListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*FineTuningListResponseData) UnmarshalJSON

func (r *FineTuningListResponseData) UnmarshalJSON(data []byte) error

type FineTuningListResponseDataLrScheduler

type FineTuningListResponseDataLrScheduler struct {
	// Any of "linear", "cosine".
	LrSchedulerType string                                                    `json:"lr_scheduler_type" api:"required"`
	LrSchedulerArgs FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion `json:"lr_scheduler_args"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LrSchedulerType respjson.Field
		LrSchedulerArgs respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Learning rate scheduler configuration

func (FineTuningListResponseDataLrScheduler) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataLrScheduler) UnmarshalJSON

func (r *FineTuningListResponseDataLrScheduler) UnmarshalJSON(data []byte) error

type FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

type FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio" api:"required"`
	// Number or fraction of cycles for the cosine learning rate scheduler
	NumCycles float64 `json:"num_cycles" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		NumCycles   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON

type FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

type FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON

type FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion

type FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion struct {
	MinLrRatio float64 `json:"min_lr_ratio"`
	// This field is from variant
	// [FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs].
	NumCycles float64 `json:"num_cycles"`
	JSON      struct {
		MinLrRatio respjson.Field
		NumCycles  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion contains all possible properties and values from FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs, FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) AsFineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

func (u FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) AsFineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs() (v FineTuningListResponseDataLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs)

func (FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) AsFineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

func (u FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) AsFineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs() (v FineTuningListResponseDataLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs)

func (FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON

type FineTuningListResponseDataProgress added in v0.2.0

type FineTuningListResponseDataProgress struct {
	// Whether time estimate is available
	EstimateAvailable bool `json:"estimate_available" api:"required"`
	// Estimated time remaining in seconds for the fine-tuning job to next state
	SecondsRemaining int64 `json:"seconds_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EstimateAvailable respjson.Field
		SecondsRemaining  respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Progress information for the fine-tuning job

func (FineTuningListResponseDataProgress) RawJSON added in v0.2.0

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataProgress) UnmarshalJSON added in v0.2.0

func (r *FineTuningListResponseDataProgress) UnmarshalJSON(data []byte) error

type FineTuningListResponseDataTrainingMethodTrainingMethodDpo

type FineTuningListResponseDataTrainingMethodTrainingMethodDpo struct {
	// Any of "dpo".
	Method                        string  `json:"method" api:"required"`
	DpoBeta                       float64 `json:"dpo_beta"`
	DpoNormalizeLogratiosByLength bool    `json:"dpo_normalize_logratios_by_length"`
	DpoReferenceFree              bool    `json:"dpo_reference_free"`
	RpoAlpha                      float64 `json:"rpo_alpha"`
	SimpoGamma                    float64 `json:"simpo_gamma"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method                        respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		ExtraFields                   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponseDataTrainingMethodTrainingMethodDpo) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingMethodTrainingMethodDpo) UnmarshalJSON

type FineTuningListResponseDataTrainingMethodTrainingMethodSft

type FineTuningListResponseDataTrainingMethodTrainingMethodSft struct {
	// Any of "sft".
	Method string `json:"method" api:"required"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method        respjson.Field
		TrainOnInputs respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponseDataTrainingMethodTrainingMethodSft) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingMethodTrainingMethodSft) UnmarshalJSON

type FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString

type FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString string
const (
	FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsStringAuto FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString = "auto"
)

type FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion

type FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion struct {
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString string `json:",inline"`
	JSON                                                                           struct {
		OfBool                                                                         respjson.Field
		OfFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion contains all possible properties and values from [bool], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfBool OfFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString]

func (FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool

func (FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString

func (u FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)

func (FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON

type FineTuningListResponseDataTrainingMethodUnion

type FineTuningListResponseDataTrainingMethodUnion struct {
	Method string `json:"method"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingMethodTrainingMethodSft].
	TrainOnInputs FineTuningListResponseDataTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingMethodTrainingMethodDpo].
	DpoBeta float64 `json:"dpo_beta"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingMethodTrainingMethodDpo].
	DpoNormalizeLogratiosByLength bool `json:"dpo_normalize_logratios_by_length"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingMethodTrainingMethodDpo].
	DpoReferenceFree bool `json:"dpo_reference_free"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingMethodTrainingMethodDpo].
	RpoAlpha float64 `json:"rpo_alpha"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingMethodTrainingMethodDpo].
	SimpoGamma float64 `json:"simpo_gamma"`
	JSON       struct {
		Method                        respjson.Field
		TrainOnInputs                 respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningListResponseDataTrainingMethodUnion contains all possible properties and values from FineTuningListResponseDataTrainingMethodTrainingMethodSft, FineTuningListResponseDataTrainingMethodTrainingMethodDpo.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningListResponseDataTrainingMethodUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodDpo

func (u FineTuningListResponseDataTrainingMethodUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodDpo() (v FineTuningListResponseDataTrainingMethodTrainingMethodDpo)

func (FineTuningListResponseDataTrainingMethodUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodSft

func (u FineTuningListResponseDataTrainingMethodUnion) AsFineTuningListResponseDataTrainingMethodTrainingMethodSft() (v FineTuningListResponseDataTrainingMethodTrainingMethodSft)

func (FineTuningListResponseDataTrainingMethodUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingMethodUnion) UnmarshalJSON

func (r *FineTuningListResponseDataTrainingMethodUnion) UnmarshalJSON(data []byte) error

type FineTuningListResponseDataTrainingTypeFullTrainingType

type FineTuningListResponseDataTrainingTypeFullTrainingType struct {
	// Any of "Full".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningListResponseDataTrainingTypeFullTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingTypeFullTrainingType) UnmarshalJSON

type FineTuningListResponseDataTrainingTypeLoRaTrainingType

type FineTuningListResponseDataTrainingTypeLoRaTrainingType struct {
	// Scaling factor applied to the LoRA adapter weights.
	LoraAlpha int64 `json:"lora_alpha" api:"required"`
	// Rank of the LoRA adapter matrices.
	LoraR int64 `json:"lora_r" api:"required"`
	// Identifies this request as a LoRA fine-tune.
	//
	// Any of "Lora".
	Type string `json:"type" api:"required"`
	// Dropout probability applied to LoRA adapter inputs.
	LoraDropout float64 `json:"lora_dropout"`
	// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE
	// expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention
	// modules on compatible models. Fine-tuning jobs that target expert modules
	// produce adapter-only output unless the selected model supports merged expert
	// LoRA output.
	LoraTrainableModules string `json:"lora_trainable_modules"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		Type                 respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LoRA training configuration for a fine-tuning job.

func (FineTuningListResponseDataTrainingTypeLoRaTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingTypeLoRaTrainingType) UnmarshalJSON

type FineTuningListResponseDataTrainingTypeUnion

type FineTuningListResponseDataTrainingTypeUnion struct {
	Type string `json:"type"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingTypeLoRaTrainingType].
	LoraAlpha int64 `json:"lora_alpha"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingTypeLoRaTrainingType].
	LoraR int64 `json:"lora_r"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingTypeLoRaTrainingType].
	LoraDropout float64 `json:"lora_dropout"`
	// This field is from variant
	// [FineTuningListResponseDataTrainingTypeLoRaTrainingType].
	LoraTrainableModules string `json:"lora_trainable_modules"`
	JSON                 struct {
		Type                 respjson.Field
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningListResponseDataTrainingTypeUnion contains all possible properties and values from FineTuningListResponseDataTrainingTypeFullTrainingType, FineTuningListResponseDataTrainingTypeLoRaTrainingType.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningListResponseDataTrainingTypeUnion) AsFineTuningListResponseDataTrainingTypeFullTrainingType

func (u FineTuningListResponseDataTrainingTypeUnion) AsFineTuningListResponseDataTrainingTypeFullTrainingType() (v FineTuningListResponseDataTrainingTypeFullTrainingType)

func (FineTuningListResponseDataTrainingTypeUnion) AsFineTuningListResponseDataTrainingTypeLoRaTrainingType

func (u FineTuningListResponseDataTrainingTypeUnion) AsFineTuningListResponseDataTrainingTypeLoRaTrainingType() (v FineTuningListResponseDataTrainingTypeLoRaTrainingType)

func (FineTuningListResponseDataTrainingTypeUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningListResponseDataTrainingTypeUnion) UnmarshalJSON

func (r *FineTuningListResponseDataTrainingTypeUnion) UnmarshalJSON(data []byte) error

type FineTuningModelLimitsParams added in v0.11.0

type FineTuningModelLimitsParams struct {
	// The model name to get limits for.
	ModelName string `query:"model_name" api:"required" json:"-"`
	// contains filtered or unexported fields
}

func (FineTuningModelLimitsParams) URLQuery added in v0.11.0

func (r FineTuningModelLimitsParams) URLQuery() (v url.Values, err error)

URLQuery serializes FineTuningModelLimitsParams's query parameters as `url.Values`.

type FineTuningNewParams

type FineTuningNewParams struct {
	// Name of the base model to run fine-tune job on
	Model string `json:"model" api:"required"`
	// File-ID of a training file uploaded to the Together API
	TrainingFile string `json:"training_file" api:"required"`
	// Number of initial evaluations excluded from the early-stopping decision. These
	// still establish the baseline validation loss but do not count toward patience.
	// Set to 0 to disable warmup; if omitted, defaults to 1. Only applies when
	// early_stopping_enabled is true.
	EarlyStoppingWarmupEvals param.Opt[int64] `json:"early_stopping_warmup_evals,omitzero"`
	// Random seed for reproducible training. When set, the same seed produces the same
	// run (e.g. data shuffle, init). If omitted or null, the server applies its
	// default seed (e.g. 42).
	RandomSeed param.Opt[int64] `json:"random_seed,omitzero"`
	// Whether to stop training early when validation loss stops improving. Requires a
	// validation_file, and n_evals must be at least early_stopping_patience +
	// early_stopping_warmup_evals + 1 so a plateau can be detected.
	EarlyStoppingEnabled param.Opt[bool] `json:"early_stopping_enabled,omitzero"`
	// Minimum decrease in validation loss for an evaluation to count as an
	// improvement. Larger values treat small gains as non-improvements, causing
	// training to stop sooner. Only applies when early_stopping_enabled is true.
	EarlyStoppingMinDelta param.Opt[float64] `json:"early_stopping_min_delta,omitzero"`
	// Number of consecutive evaluations with no improvement in validation loss to
	// allow before stopping. Only applies when early_stopping_enabled is true.
	EarlyStoppingPatience param.Opt[int64] `json:"early_stopping_patience,omitzero"`
	// The checkpoint identifier to continue training from a previous fine-tuning job.
	// Format is `{$JOB_ID}` or `{$OUTPUT_MODEL_NAME}` or `{$JOB_ID}:{$STEP}` or
	// `{$OUTPUT_MODEL_NAME}:{$STEP}`. The step value is optional; without it, uses the
	// final checkpoint.
	FromCheckpoint param.Opt[string] `json:"from_checkpoint,omitzero"`
	// The Hugging Face Hub repo to start training from. Should be as close as possible
	// to the base model (specified by the `model` argument) in terms of architecture
	// and size.
	FromHfModel param.Opt[string] `json:"from_hf_model,omitzero"`
	// Number of steps to accumulate gradients before performing a weight update. If
	// omitted or set to 0, the model default is used.
	GradientAccumulationSteps param.Opt[int64] `json:"gradient_accumulation_steps,omitzero"`
	// The API token for the Hugging Face Hub.
	HfAPIToken param.Opt[string] `json:"hf_api_token,omitzero"`
	// The revision of the Hugging Face Hub model to continue training from. E.g.,
	// hf_model_revision=main (default, used if the argument is not provided) or
	// hf_model_revision='607a30d783dfa663caf39e06633721c8d4cfcd7e' (specific commit).
	HfModelRevision param.Opt[string] `json:"hf_model_revision,omitzero"`
	// The name of the Hugging Face repository to upload the fine-tuned model to.
	HfOutputRepoName param.Opt[string] `json:"hf_output_repo_name,omitzero"`
	// Controls how quickly the model adapts to new information (too high may cause
	// instability, too low may slow convergence)
	LearningRate param.Opt[float64] `json:"learning_rate,omitzero"`
	// Max gradient norm to be used for gradient clipping. Set to 0 to disable.
	MaxGradNorm param.Opt[float64] `json:"max_grad_norm,omitzero"`
	// Maximum sequence length to use for training. If not specified, the maximum
	// allowed for the model and training method will be used.
	MaxSeqLength param.Opt[int64] `json:"max_seq_length,omitzero"`
	// Number of intermediate model versions saved during training for evaluation
	NCheckpoints param.Opt[int64] `json:"n_checkpoints,omitzero"`
	// Number of complete passes through the training dataset (higher values may
	// improve results but increase cost and risk of overfitting)
	NEpochs param.Opt[int64] `json:"n_epochs,omitzero"`
	// Number of evaluations to be run on a given validation set during training
	NEvals param.Opt[int64] `json:"n_evals,omitzero"`
	// Whether to use sequence packing for training. This flag has no effect if the
	// training data is in Parquet format.
	Packing param.Opt[bool] `json:"packing,omitzero"`
	// Suffix to add to your fine-tuned model name. Must be at most 64 characters long.
	Suffix param.Opt[string] `json:"suffix,omitzero"`
	// File-ID of a validation file uploaded to the Together API
	ValidationFile param.Opt[string] `json:"validation_file,omitzero"`
	// Integration key for tracking experiments and model metrics on W&B platform
	WandbAPIKey param.Opt[string] `json:"wandb_api_key,omitzero"`
	// The base URL of a dedicated Weights & Biases instance.
	WandbBaseURL param.Opt[string] `json:"wandb_base_url,omitzero"`
	// The Weights & Biases entity for your run.
	WandbEntity param.Opt[string] `json:"wandb_entity,omitzero"`
	// The Weights & Biases name for your run.
	WandbName param.Opt[string] `json:"wandb_name,omitzero"`
	// The Weights & Biases project for your run. If not specified, uses `together` as
	// the project name.
	WandbProjectName param.Opt[string] `json:"wandb_project_name,omitzero"`
	// The percent of steps at the start of training to linearly increase the learning
	// rate.
	WarmupRatio param.Opt[float64] `json:"warmup_ratio,omitzero"`
	// Weight decay. Regularization parameter for the optimizer.
	WeightDecay param.Opt[float64] `json:"weight_decay,omitzero"`
	// The training type to use. Defaults to LoRA if not provided.
	TrainingType FineTuningNewParamsTrainingTypeUnion `json:"training_type,omitzero"`
	// Number of training examples processed together (larger batches use more memory
	// but may train faster). Defaults to "max". We use training optimizations like
	// packing, so the effective batch size may be different than the value you set.
	BatchSize FineTuningNewParamsBatchSizeUnion `json:"batch_size,omitzero"`
	// The learning rate scheduler to use. It specifies how the learning rate is
	// adjusted during training.
	LrScheduler      FineTuningNewParamsLrScheduler      `json:"lr_scheduler,omitzero"`
	MultimodalParams FineTuningNewParamsMultimodalParams `json:"multimodal_params,omitzero"`
	// The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct
	// Preference Optimization.
	TrainingMethod FineTuningNewParamsTrainingMethodUnion `json:"training_method,omitzero"`
	// contains filtered or unexported fields
}

func (FineTuningNewParams) MarshalJSON

func (r FineTuningNewParams) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParams) UnmarshalJSON

func (r *FineTuningNewParams) UnmarshalJSON(data []byte) error

type FineTuningNewParamsBatchSizeString

type FineTuningNewParamsBatchSizeString string
const (
	FineTuningNewParamsBatchSizeStringMax FineTuningNewParamsBatchSizeString = "max"
)

type FineTuningNewParamsBatchSizeUnion

type FineTuningNewParamsBatchSizeUnion struct {
	OfInt param.Opt[int64] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfFineTuningNewsBatchSizeString)
	OfFineTuningNewsBatchSizeString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningNewParamsBatchSizeUnion) MarshalJSON

func (u FineTuningNewParamsBatchSizeUnion) MarshalJSON() ([]byte, error)

func (*FineTuningNewParamsBatchSizeUnion) UnmarshalJSON

func (u *FineTuningNewParamsBatchSizeUnion) UnmarshalJSON(data []byte) error

type FineTuningNewParamsLrScheduler

type FineTuningNewParamsLrScheduler struct {
	// Any of "linear", "cosine".
	LrSchedulerType string                                             `json:"lr_scheduler_type,omitzero" api:"required"`
	LrSchedulerArgs FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion `json:"lr_scheduler_args,omitzero"`
	// contains filtered or unexported fields
}

The learning rate scheduler to use. It specifies how the learning rate is adjusted during training.

The property LrSchedulerType is required.

func (FineTuningNewParamsLrScheduler) MarshalJSON

func (r FineTuningNewParamsLrScheduler) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParamsLrScheduler) UnmarshalJSON

func (r *FineTuningNewParamsLrScheduler) UnmarshalJSON(data []byte) error

type FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

type FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio" api:"required"`
	// Number or fraction of cycles for the cosine learning rate scheduler
	NumCycles float64 `json:"num_cycles" api:"required"`
	// contains filtered or unexported fields
}

The properties MinLrRatio, NumCycles are required.

func (FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) MarshalJSON

func (*FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON

type FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

type FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio param.Opt[float64] `json:"min_lr_ratio,omitzero"`
	// contains filtered or unexported fields
}

func (FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) MarshalJSON

func (*FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON

type FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion

type FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion struct {
	OfFineTuningNewsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs *FineTuningNewParamsLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs `json:",omitzero,inline"`
	OfFineTuningNewsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs *FineTuningNewParamsLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) GetMinLrRatio

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) GetNumCycles

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) MarshalJSON

func (*FineTuningNewParamsLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON

type FineTuningNewParamsMultimodalParams added in v0.4.0

type FineTuningNewParamsMultimodalParams struct {
	// Whether to train the vision encoder of the model. Only available for multimodal
	// models.
	TrainVision param.Opt[bool] `json:"train_vision,omitzero"`
	// contains filtered or unexported fields
}

func (FineTuningNewParamsMultimodalParams) MarshalJSON added in v0.4.0

func (r FineTuningNewParamsMultimodalParams) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParamsMultimodalParams) UnmarshalJSON added in v0.4.0

func (r *FineTuningNewParamsMultimodalParams) UnmarshalJSON(data []byte) error

type FineTuningNewParamsTrainingMethodTrainingMethodDpo

type FineTuningNewParamsTrainingMethodTrainingMethodDpo struct {
	// Any of "dpo".
	Method                        string             `json:"method,omitzero" api:"required"`
	DpoBeta                       param.Opt[float64] `json:"dpo_beta,omitzero"`
	DpoNormalizeLogratiosByLength param.Opt[bool]    `json:"dpo_normalize_logratios_by_length,omitzero"`
	DpoReferenceFree              param.Opt[bool]    `json:"dpo_reference_free,omitzero"`
	RpoAlpha                      param.Opt[float64] `json:"rpo_alpha,omitzero"`
	SimpoGamma                    param.Opt[float64] `json:"simpo_gamma,omitzero"`
	// contains filtered or unexported fields
}

The property Method is required.

func (FineTuningNewParamsTrainingMethodTrainingMethodDpo) MarshalJSON

func (r FineTuningNewParamsTrainingMethodTrainingMethodDpo) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParamsTrainingMethodTrainingMethodDpo) UnmarshalJSON

type FineTuningNewParamsTrainingMethodTrainingMethodSft

type FineTuningNewParamsTrainingMethodTrainingMethodSft struct {
	// Any of "sft".
	Method string `json:"method,omitzero" api:"required"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Method, TrainOnInputs are required.

func (FineTuningNewParamsTrainingMethodTrainingMethodSft) MarshalJSON

func (r FineTuningNewParamsTrainingMethodTrainingMethodSft) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParamsTrainingMethodTrainingMethodSft) UnmarshalJSON

type FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsString

type FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsString string
const (
	FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsStringAuto FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsString = "auto"
)

type FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion

type FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion struct {
	OfBool param.Opt[bool] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfFineTuningNewsTrainingMethodTrainingMethodSftTrainOnInputsString)
	OfFineTuningNewsTrainingMethodTrainingMethodSftTrainOnInputsString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) MarshalJSON

func (*FineTuningNewParamsTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON

type FineTuningNewParamsTrainingMethodUnion

type FineTuningNewParamsTrainingMethodUnion struct {
	OfFineTuningNewsTrainingMethodTrainingMethodSft *FineTuningNewParamsTrainingMethodTrainingMethodSft `json:",omitzero,inline"`
	OfFineTuningNewsTrainingMethodTrainingMethodDpo *FineTuningNewParamsTrainingMethodTrainingMethodDpo `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningNewParamsTrainingMethodUnion) GetDpoBeta

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) GetDpoNormalizeLogratiosByLength

func (u FineTuningNewParamsTrainingMethodUnion) GetDpoNormalizeLogratiosByLength() *bool

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) GetDpoReferenceFree

func (u FineTuningNewParamsTrainingMethodUnion) GetDpoReferenceFree() *bool

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) GetMethod

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) GetRpoAlpha

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) GetSimpoGamma

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) GetTrainOnInputs

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingMethodUnion) MarshalJSON

func (u FineTuningNewParamsTrainingMethodUnion) MarshalJSON() ([]byte, error)

func (*FineTuningNewParamsTrainingMethodUnion) UnmarshalJSON

func (u *FineTuningNewParamsTrainingMethodUnion) UnmarshalJSON(data []byte) error

type FineTuningNewParamsTrainingTypeFullTrainingType

type FineTuningNewParamsTrainingTypeFullTrainingType struct {
	// Any of "Full".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The property Type is required.

func (FineTuningNewParamsTrainingTypeFullTrainingType) MarshalJSON

func (r FineTuningNewParamsTrainingTypeFullTrainingType) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParamsTrainingTypeFullTrainingType) UnmarshalJSON

type FineTuningNewParamsTrainingTypeLoRaTrainingType

type FineTuningNewParamsTrainingTypeLoRaTrainingType struct {
	// Scaling factor applied to the LoRA adapter weights.
	LoraAlpha int64 `json:"lora_alpha" api:"required"`
	// Rank of the LoRA adapter matrices.
	LoraR int64 `json:"lora_r" api:"required"`
	// Identifies this request as a LoRA fine-tune.
	//
	// Any of "Lora".
	Type string `json:"type,omitzero" api:"required"`
	// Dropout probability applied to LoRA adapter inputs.
	LoraDropout param.Opt[float64] `json:"lora_dropout,omitzero"`
	// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE
	// expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention
	// modules on compatible models. Fine-tuning jobs that target expert modules
	// produce adapter-only output unless the selected model supports merged expert
	// LoRA output.
	LoraTrainableModules param.Opt[string] `json:"lora_trainable_modules,omitzero"`
	// contains filtered or unexported fields
}

LoRA training configuration for a fine-tuning job.

The properties LoraAlpha, LoraR, Type are required.

func (FineTuningNewParamsTrainingTypeLoRaTrainingType) MarshalJSON

func (r FineTuningNewParamsTrainingTypeLoRaTrainingType) MarshalJSON() (data []byte, err error)

func (*FineTuningNewParamsTrainingTypeLoRaTrainingType) UnmarshalJSON

type FineTuningNewParamsTrainingTypeUnion

type FineTuningNewParamsTrainingTypeUnion struct {
	OfFineTuningNewsTrainingTypeFullTrainingType *FineTuningNewParamsTrainingTypeFullTrainingType `json:",omitzero,inline"`
	OfFineTuningNewsTrainingTypeLoRaTrainingType *FineTuningNewParamsTrainingTypeLoRaTrainingType `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (FineTuningNewParamsTrainingTypeUnion) GetLoraAlpha

func (u FineTuningNewParamsTrainingTypeUnion) GetLoraAlpha() *int64

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingTypeUnion) GetLoraDropout

func (u FineTuningNewParamsTrainingTypeUnion) GetLoraDropout() *float64

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingTypeUnion) GetLoraR

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingTypeUnion) GetLoraTrainableModules

func (u FineTuningNewParamsTrainingTypeUnion) GetLoraTrainableModules() *string

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingTypeUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (FineTuningNewParamsTrainingTypeUnion) MarshalJSON

func (u FineTuningNewParamsTrainingTypeUnion) MarshalJSON() ([]byte, error)

func (*FineTuningNewParamsTrainingTypeUnion) UnmarshalJSON

func (u *FineTuningNewParamsTrainingTypeUnion) UnmarshalJSON(data []byte) error

type FineTuningNewResponse

type FineTuningNewResponse struct {
	// Unique identifier for the fine-tune job
	ID string `json:"id" api:"required"`
	// Creation timestamp of the fine-tune job
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Any of "pending", "queued", "running", "compressing", "uploading",
	// "cancel_requested", "cancelled", "error", "completed".
	Status FineTuningNewResponseStatus `json:"status" api:"required"`
	// Last update timestamp of the fine-tune job
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// ID of the user who created the fine-tune job.
	UserID string `json:"user_id" api:"required"`
	// Batch size used for training
	BatchSize int64 `json:"batch_size"`
	// Whether the early-stopping criterion triggered.
	EarlyStopped bool `json:"early_stopped"`
	// Best validation loss observed, corresponding to early_stopping_best_step. Null
	// if no improving evaluation was recorded.
	EarlyStoppingBestMetric float64 `json:"early_stopping_best_metric" api:"nullable"`
	// Step associated with the selected early-stopping artifact. When
	// early_stopping_best_metric is null, no finite best metric was recorded; this is
	// the halt step, not a best-checkpoint step.
	EarlyStoppingBestStep int64 `json:"early_stopping_best_step"`
	// Events related to this fine-tune job
	Events []FinetuneEvent `json:"events"`
	// Checkpoint used to continue training
	FromCheckpoint string `json:"from_checkpoint"`
	// Hugging Face Hub repo to start training from
	FromHfModel string `json:"from_hf_model"`
	// The revision of the Hugging Face Hub model to continue training from
	HfModelRevision string `json:"hf_model_revision"`
	// Learning rate used for training
	LearningRate float64 `json:"learning_rate"`
	// Learning rate scheduler configuration
	LrScheduler FineTuningNewResponseLrScheduler `json:"lr_scheduler"`
	// Maximum gradient norm for clipping
	MaxGradNorm float64 `json:"max_grad_norm"`
	// Maximum sequence length to use for training. If not specified, uses the maximum
	// allowed for the model and training method.
	MaxSeqLength int64 `json:"max_seq_length"`
	// Base model used for fine-tuning
	Model           string `json:"model"`
	ModelOutputName string `json:"model_output_name"`
	// Number of checkpoints saved during training
	NCheckpoints int64 `json:"n_checkpoints"`
	// Number of training epochs
	NEpochs int64 `json:"n_epochs"`
	// Number of evaluations during training
	NEvals int64 `json:"n_evals"`
	// Owner address information
	OwnerAddress string `json:"owner_address"`
	// Whether sequence packing is being used for training.
	Packing bool `json:"packing"`
	// Progress information for the fine-tuning job
	Progress FineTuningNewResponseProgress `json:"progress"`
	// Random seed used for training. Integer when set; null if not stored (e.g. legacy
	// jobs) or no explicit seed was recorded.
	RandomSeed int64 `json:"random_seed" api:"nullable"`
	// Start timestamp of the current stage of the fine-tune job
	StartedAt time.Time `json:"started_at" format:"date-time"`
	// Suffix added to the fine-tuned model name
	Suffix string `json:"suffix"`
	// Count of tokens processed
	TokenCount int64 `json:"token_count"`
	// Total price for the fine-tuning job
	TotalPrice int64 `json:"total_price"`
	// File-ID of the training file
	TrainingFile string `json:"training_file"`
	// Method of training used
	TrainingMethod FineTuningNewResponseTrainingMethodUnion `json:"training_method"`
	// Type of training used (full or LoRA)
	TrainingType FineTuningNewResponseTrainingTypeUnion `json:"training_type"`
	// File-ID of the validation file
	ValidationFile string `json:"validation_file"`
	// Weights & Biases run name
	WandbName string `json:"wandb_name"`
	// Weights & Biases project name
	WandbProjectName string `json:"wandb_project_name"`
	// Ratio of warmup steps
	WarmupRatio float64 `json:"warmup_ratio"`
	// Weight decay value used
	WeightDecay float64 `json:"weight_decay"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                      respjson.Field
		CreatedAt               respjson.Field
		Status                  respjson.Field
		UpdatedAt               respjson.Field
		UserID                  respjson.Field
		BatchSize               respjson.Field
		EarlyStopped            respjson.Field
		EarlyStoppingBestMetric respjson.Field
		EarlyStoppingBestStep   respjson.Field
		Events                  respjson.Field
		FromCheckpoint          respjson.Field
		FromHfModel             respjson.Field
		HfModelRevision         respjson.Field
		LearningRate            respjson.Field
		LrScheduler             respjson.Field
		MaxGradNorm             respjson.Field
		MaxSeqLength            respjson.Field
		Model                   respjson.Field
		ModelOutputName         respjson.Field
		NCheckpoints            respjson.Field
		NEpochs                 respjson.Field
		NEvals                  respjson.Field
		OwnerAddress            respjson.Field
		Packing                 respjson.Field
		Progress                respjson.Field
		RandomSeed              respjson.Field
		StartedAt               respjson.Field
		Suffix                  respjson.Field
		TokenCount              respjson.Field
		TotalPrice              respjson.Field
		TrainingFile            respjson.Field
		TrainingMethod          respjson.Field
		TrainingType            respjson.Field
		ValidationFile          respjson.Field
		WandbName               respjson.Field
		WandbProjectName        respjson.Field
		WarmupRatio             respjson.Field
		WeightDecay             respjson.Field
		ExtraFields             map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A truncated version of the fine-tune response, used for POST /fine-tunes, GET /fine-tunes and POST /fine-tunes/{id}/cancel endpoints

func (FineTuningNewResponse) RawJSON

func (r FineTuningNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FineTuningNewResponse) UnmarshalJSON

func (r *FineTuningNewResponse) UnmarshalJSON(data []byte) error

type FineTuningNewResponseLrScheduler

type FineTuningNewResponseLrScheduler struct {
	// Any of "linear", "cosine".
	LrSchedulerType string                                               `json:"lr_scheduler_type" api:"required"`
	LrSchedulerArgs FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion `json:"lr_scheduler_args"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LrSchedulerType respjson.Field
		LrSchedulerArgs respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Learning rate scheduler configuration

func (FineTuningNewResponseLrScheduler) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseLrScheduler) UnmarshalJSON

func (r *FineTuningNewResponseLrScheduler) UnmarshalJSON(data []byte) error

type FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

type FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio" api:"required"`
	// Number or fraction of cycles for the cosine learning rate scheduler
	NumCycles float64 `json:"num_cycles" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		NumCycles   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON

type FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

type FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON

type FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion

type FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion struct {
	MinLrRatio float64 `json:"min_lr_ratio"`
	// This field is from variant
	// [FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs].
	NumCycles float64 `json:"num_cycles"`
	JSON      struct {
		MinLrRatio respjson.Field
		NumCycles  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion contains all possible properties and values from FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs, FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

func (u FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs() (v FineTuningNewResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs)

func (FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

func (u FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) AsFineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs() (v FineTuningNewResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs)

func (FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON

type FineTuningNewResponseProgress added in v0.2.0

type FineTuningNewResponseProgress struct {
	// Whether time estimate is available
	EstimateAvailable bool `json:"estimate_available" api:"required"`
	// Estimated time remaining in seconds for the fine-tuning job to next state
	SecondsRemaining int64 `json:"seconds_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EstimateAvailable respjson.Field
		SecondsRemaining  respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Progress information for the fine-tuning job

func (FineTuningNewResponseProgress) RawJSON added in v0.2.0

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseProgress) UnmarshalJSON added in v0.2.0

func (r *FineTuningNewResponseProgress) UnmarshalJSON(data []byte) error

type FineTuningNewResponseStatus

type FineTuningNewResponseStatus string
const (
	FineTuningNewResponseStatusPending         FineTuningNewResponseStatus = "pending"
	FineTuningNewResponseStatusQueued          FineTuningNewResponseStatus = "queued"
	FineTuningNewResponseStatusRunning         FineTuningNewResponseStatus = "running"
	FineTuningNewResponseStatusCompressing     FineTuningNewResponseStatus = "compressing"
	FineTuningNewResponseStatusUploading       FineTuningNewResponseStatus = "uploading"
	FineTuningNewResponseStatusCancelRequested FineTuningNewResponseStatus = "cancel_requested"
	FineTuningNewResponseStatusCancelled       FineTuningNewResponseStatus = "cancelled"
	FineTuningNewResponseStatusError           FineTuningNewResponseStatus = "error"
	FineTuningNewResponseStatusCompleted       FineTuningNewResponseStatus = "completed"
)

type FineTuningNewResponseTrainingMethodTrainingMethodDpo

type FineTuningNewResponseTrainingMethodTrainingMethodDpo struct {
	// Any of "dpo".
	Method                        string  `json:"method" api:"required"`
	DpoBeta                       float64 `json:"dpo_beta"`
	DpoNormalizeLogratiosByLength bool    `json:"dpo_normalize_logratios_by_length"`
	DpoReferenceFree              bool    `json:"dpo_reference_free"`
	RpoAlpha                      float64 `json:"rpo_alpha"`
	SimpoGamma                    float64 `json:"simpo_gamma"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method                        respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		ExtraFields                   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningNewResponseTrainingMethodTrainingMethodDpo) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingMethodTrainingMethodDpo) UnmarshalJSON

type FineTuningNewResponseTrainingMethodTrainingMethodSft

type FineTuningNewResponseTrainingMethodTrainingMethodSft struct {
	// Any of "sft".
	Method string `json:"method" api:"required"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method        respjson.Field
		TrainOnInputs respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningNewResponseTrainingMethodTrainingMethodSft) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingMethodTrainingMethodSft) UnmarshalJSON

type FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString

type FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString string
const (
	FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsStringAuto FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString = "auto"
)

type FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion

type FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion struct {
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString string `json:",inline"`
	JSON                                                                      struct {
		OfBool                                                                    respjson.Field
		OfFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion contains all possible properties and values from [bool], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfBool OfFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString]

func (FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool

func (FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString

func (u FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)

func (FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON

type FineTuningNewResponseTrainingMethodUnion

type FineTuningNewResponseTrainingMethodUnion struct {
	Method string `json:"method"`
	// This field is from variant
	// [FineTuningNewResponseTrainingMethodTrainingMethodSft].
	TrainOnInputs FineTuningNewResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs"`
	// This field is from variant
	// [FineTuningNewResponseTrainingMethodTrainingMethodDpo].
	DpoBeta float64 `json:"dpo_beta"`
	// This field is from variant
	// [FineTuningNewResponseTrainingMethodTrainingMethodDpo].
	DpoNormalizeLogratiosByLength bool `json:"dpo_normalize_logratios_by_length"`
	// This field is from variant
	// [FineTuningNewResponseTrainingMethodTrainingMethodDpo].
	DpoReferenceFree bool `json:"dpo_reference_free"`
	// This field is from variant
	// [FineTuningNewResponseTrainingMethodTrainingMethodDpo].
	RpoAlpha float64 `json:"rpo_alpha"`
	// This field is from variant
	// [FineTuningNewResponseTrainingMethodTrainingMethodDpo].
	SimpoGamma float64 `json:"simpo_gamma"`
	JSON       struct {
		Method                        respjson.Field
		TrainOnInputs                 respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningNewResponseTrainingMethodUnion contains all possible properties and values from FineTuningNewResponseTrainingMethodTrainingMethodSft, FineTuningNewResponseTrainingMethodTrainingMethodDpo.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningNewResponseTrainingMethodUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodDpo

func (u FineTuningNewResponseTrainingMethodUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodDpo() (v FineTuningNewResponseTrainingMethodTrainingMethodDpo)

func (FineTuningNewResponseTrainingMethodUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodSft

func (u FineTuningNewResponseTrainingMethodUnion) AsFineTuningNewResponseTrainingMethodTrainingMethodSft() (v FineTuningNewResponseTrainingMethodTrainingMethodSft)

func (FineTuningNewResponseTrainingMethodUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingMethodUnion) UnmarshalJSON

func (r *FineTuningNewResponseTrainingMethodUnion) UnmarshalJSON(data []byte) error

type FineTuningNewResponseTrainingTypeFullTrainingType

type FineTuningNewResponseTrainingTypeFullTrainingType struct {
	// Any of "Full".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FineTuningNewResponseTrainingTypeFullTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingTypeFullTrainingType) UnmarshalJSON

type FineTuningNewResponseTrainingTypeLoRaTrainingType

type FineTuningNewResponseTrainingTypeLoRaTrainingType struct {
	// Scaling factor applied to the LoRA adapter weights.
	LoraAlpha int64 `json:"lora_alpha" api:"required"`
	// Rank of the LoRA adapter matrices.
	LoraR int64 `json:"lora_r" api:"required"`
	// Identifies this request as a LoRA fine-tune.
	//
	// Any of "Lora".
	Type string `json:"type" api:"required"`
	// Dropout probability applied to LoRA adapter inputs.
	LoraDropout float64 `json:"lora_dropout"`
	// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE
	// expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention
	// modules on compatible models. Fine-tuning jobs that target expert modules
	// produce adapter-only output unless the selected model supports merged expert
	// LoRA output.
	LoraTrainableModules string `json:"lora_trainable_modules"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		Type                 respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LoRA training configuration for a fine-tuning job.

func (FineTuningNewResponseTrainingTypeLoRaTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingTypeLoRaTrainingType) UnmarshalJSON

type FineTuningNewResponseTrainingTypeUnion

type FineTuningNewResponseTrainingTypeUnion struct {
	Type string `json:"type"`
	// This field is from variant [FineTuningNewResponseTrainingTypeLoRaTrainingType].
	LoraAlpha int64 `json:"lora_alpha"`
	// This field is from variant [FineTuningNewResponseTrainingTypeLoRaTrainingType].
	LoraR int64 `json:"lora_r"`
	// This field is from variant [FineTuningNewResponseTrainingTypeLoRaTrainingType].
	LoraDropout float64 `json:"lora_dropout"`
	// This field is from variant [FineTuningNewResponseTrainingTypeLoRaTrainingType].
	LoraTrainableModules string `json:"lora_trainable_modules"`
	JSON                 struct {
		Type                 respjson.Field
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FineTuningNewResponseTrainingTypeUnion contains all possible properties and values from FineTuningNewResponseTrainingTypeFullTrainingType, FineTuningNewResponseTrainingTypeLoRaTrainingType.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FineTuningNewResponseTrainingTypeUnion) AsFineTuningNewResponseTrainingTypeFullTrainingType

func (u FineTuningNewResponseTrainingTypeUnion) AsFineTuningNewResponseTrainingTypeFullTrainingType() (v FineTuningNewResponseTrainingTypeFullTrainingType)

func (FineTuningNewResponseTrainingTypeUnion) AsFineTuningNewResponseTrainingTypeLoRaTrainingType

func (u FineTuningNewResponseTrainingTypeUnion) AsFineTuningNewResponseTrainingTypeLoRaTrainingType() (v FineTuningNewResponseTrainingTypeLoRaTrainingType)

func (FineTuningNewResponseTrainingTypeUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FineTuningNewResponseTrainingTypeUnion) UnmarshalJSON

func (r *FineTuningNewResponseTrainingTypeUnion) UnmarshalJSON(data []byte) error

type FineTuningPreviewParams added in v0.12.0

type FineTuningPreviewParams struct {
	// Name of the base model whose tokenizer and chat template will be used.
	Model string `json:"model" api:"required"`
	// File-ID of the uploaded JSONL training file to sample for preview.
	TrainingFile string `json:"training_file" api:"required"`
	// Maximum number of rows from the start of the training file to tokenize.
	TopK param.Opt[int64] `json:"top_k,omitzero"`
	// Whether prompt or user-message tokens should contribute to training loss in the
	// preview.
	TrainOnInputs param.Opt[bool] `json:"train_on_inputs,omitzero"`
	// Fine-tuning method to preview. Only supervised fine-tuning is currently
	// supported.
	//
	// Any of "sft".
	TrainingMethod FineTuningPreviewParamsTrainingMethod `json:"training_method,omitzero"`
	// contains filtered or unexported fields
}

func (FineTuningPreviewParams) MarshalJSON added in v0.12.0

func (r FineTuningPreviewParams) MarshalJSON() (data []byte, err error)

func (*FineTuningPreviewParams) UnmarshalJSON added in v0.12.0

func (r *FineTuningPreviewParams) UnmarshalJSON(data []byte) error

type FineTuningPreviewParamsTrainingMethod added in v0.12.0

type FineTuningPreviewParamsTrainingMethod string

Fine-tuning method to preview. Only supervised fine-tuning is currently supported.

const (
	FineTuningPreviewParamsTrainingMethodSft FineTuningPreviewParamsTrainingMethod = "sft"
)

type FineTuningService

type FineTuningService struct {
	Options []option.RequestOption
}

FineTuningService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFineTuningService method instead.

func NewFineTuningService

func NewFineTuningService(opts ...option.RequestOption) (r FineTuningService)

NewFineTuningService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FineTuningService) Cancel

Cancel a currently running fine-tuning job. Returns a FinetuneResponseTruncated object.

func (*FineTuningService) Content

func (r *FineTuningService) Content(ctx context.Context, query FineTuningContentParams, opts ...option.RequestOption) (res *http.Response, err error)

Receive a compressed fine-tuned model or checkpoint.

func (*FineTuningService) Delete

Delete a fine-tuning job.

func (*FineTuningService) EstimatePrice added in v0.2.0

Estimate the price of a fine-tuning job.

func (*FineTuningService) Get

func (r *FineTuningService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *FinetuneResponse, err error)

List the metadata for a single fine-tuning job.

func (*FineTuningService) GetTokenizedDataset added in v0.13.0

func (r *FineTuningService) GetTokenizedDataset(ctx context.Context, id string, opts ...option.RequestOption) (res *FineTuneTokenizedDatasetRetrieveResponse, err error)

Get a presigned URL for the tokenized dataset archive generated for a fine-tune job.

func (*FineTuningService) List

List the metadata for all fine-tuning jobs. Returns a list of FinetuneResponseTruncated objects.

func (*FineTuningService) ListCheckpoints

func (r *FineTuningService) ListCheckpoints(ctx context.Context, id string, opts ...option.RequestOption) (res *FineTuningListCheckpointsResponse, err error)

List the checkpoints for a single fine-tuning job.

func (*FineTuningService) ListEvents

func (r *FineTuningService) ListEvents(ctx context.Context, id string, opts ...option.RequestOption) (res *FineTuningListEventsResponse, err error)

List the events for a single fine-tuning job.

func (*FineTuningService) ListMetrics added in v0.10.0

Retrieves recorded training metrics for a fine-tuning job in chronological order. All query parameters are optional: omit them to retrieve all metrics.

func (*FineTuningService) ModelLimits added in v0.11.0

Get model limits for a specific fine-tuning model.

func (*FineTuningService) New

Create a fine-tuning job with the provided model and training data.

func (*FineTuningService) Preview added in v0.12.0

Preview how sampled rows from a fine-tuning training file will be tokenized before packing.

type FinetuneEvent

type FinetuneEvent struct {
	CreatedAt string `json:"created_at" api:"required"`
	Message   string `json:"message" api:"required"`
	// The object type, which is always `fine-tune-event`.
	Object constant.FineTuneEvent `json:"object" default:"fine-tune-event"`
	// Any of "job_pending", "job_start", "job_stopped", "model_downloading",
	// "model_download_complete", "training_data_downloading",
	// "training_data_download_complete", "validation_data_downloading",
	// "validation_data_download_complete", "wandb_init", "training_start",
	// "checkpoint_save", "billing_limit", "epoch_complete", "training_complete",
	// "model_compressing", "model_compression_complete", "model_uploading",
	// "model_upload_complete", "job_complete", "job_error", "cancel_requested",
	// "job_restarted", "refund", "warning", "early_stopped",
	// "tokenized_dataset_upload_complete".
	Type           FinetuneEventType `json:"type" api:"required"`
	CheckpointPath string            `json:"checkpoint_path"`
	// For early_stopped events, the best validation loss observed. Null if no
	// improving evaluation was recorded.
	EarlyStoppingBestMetricValue float64 `json:"early_stopping_best_metric_value" api:"nullable"`
	// For early_stopped events, the selected best-checkpoint step when a finite best
	// metric exists. If early_stopping_best_metric_value is null, this is the halt
	// step.
	EarlyStoppingBestStep int64 `json:"early_stopping_best_step" api:"nullable"`
	// Any of "info", "warning", "error", "legacy_info", "legacy_iwarning",
	// "legacy_ierror".
	Level      FinetuneEventLevel `json:"level" api:"nullable"`
	ModelPath  string             `json:"model_path"`
	ParamCount int64              `json:"param_count"`
	Step       int64              `json:"step"`
	TokenCount int64              `json:"token_count"`
	// Storage path for the tokenized dataset archive associated with this event.
	TokenizedDatasetPath string `json:"tokenized_dataset_path"`
	TotalSteps           int64  `json:"total_steps"`
	WandbURL             string `json:"wandb_url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreatedAt                    respjson.Field
		Message                      respjson.Field
		Object                       respjson.Field
		Type                         respjson.Field
		CheckpointPath               respjson.Field
		EarlyStoppingBestMetricValue respjson.Field
		EarlyStoppingBestStep        respjson.Field
		Level                        respjson.Field
		ModelPath                    respjson.Field
		ParamCount                   respjson.Field
		Step                         respjson.Field
		TokenCount                   respjson.Field
		TokenizedDatasetPath         respjson.Field
		TotalSteps                   respjson.Field
		WandbURL                     respjson.Field
		ExtraFields                  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneEvent) RawJSON

func (r FinetuneEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*FinetuneEvent) UnmarshalJSON

func (r *FinetuneEvent) UnmarshalJSON(data []byte) error

type FinetuneEventLevel

type FinetuneEventLevel string
const (
	FinetuneEventLevelInfo           FinetuneEventLevel = "info"
	FinetuneEventLevelWarning        FinetuneEventLevel = "warning"
	FinetuneEventLevelError          FinetuneEventLevel = "error"
	FinetuneEventLevelLegacyInfo     FinetuneEventLevel = "legacy_info"
	FinetuneEventLevelLegacyIwarning FinetuneEventLevel = "legacy_iwarning"
	FinetuneEventLevelLegacyIerror   FinetuneEventLevel = "legacy_ierror"
)

type FinetuneEventType

type FinetuneEventType string
const (
	FinetuneEventTypeJobPending                     FinetuneEventType = "job_pending"
	FinetuneEventTypeJobStart                       FinetuneEventType = "job_start"
	FinetuneEventTypeJobStopped                     FinetuneEventType = "job_stopped"
	FinetuneEventTypeModelDownloading               FinetuneEventType = "model_downloading"
	FinetuneEventTypeModelDownloadComplete          FinetuneEventType = "model_download_complete"
	FinetuneEventTypeTrainingDataDownloading        FinetuneEventType = "training_data_downloading"
	FinetuneEventTypeTrainingDataDownloadComplete   FinetuneEventType = "training_data_download_complete"
	FinetuneEventTypeValidationDataDownloading      FinetuneEventType = "validation_data_downloading"
	FinetuneEventTypeValidationDataDownloadComplete FinetuneEventType = "validation_data_download_complete"
	FinetuneEventTypeWandbInit                      FinetuneEventType = "wandb_init"
	FinetuneEventTypeTrainingStart                  FinetuneEventType = "training_start"
	FinetuneEventTypeCheckpointSave                 FinetuneEventType = "checkpoint_save"
	FinetuneEventTypeBillingLimit                   FinetuneEventType = "billing_limit"
	FinetuneEventTypeEpochComplete                  FinetuneEventType = "epoch_complete"
	FinetuneEventTypeTrainingComplete               FinetuneEventType = "training_complete"
	FinetuneEventTypeModelCompressing               FinetuneEventType = "model_compressing"
	FinetuneEventTypeModelCompressionComplete       FinetuneEventType = "model_compression_complete"
	FinetuneEventTypeModelUploading                 FinetuneEventType = "model_uploading"
	FinetuneEventTypeModelUploadComplete            FinetuneEventType = "model_upload_complete"
	FinetuneEventTypeJobComplete                    FinetuneEventType = "job_complete"
	FinetuneEventTypeJobError                       FinetuneEventType = "job_error"
	FinetuneEventTypeCancelRequested                FinetuneEventType = "cancel_requested"
	FinetuneEventTypeJobRestarted                   FinetuneEventType = "job_restarted"
	FinetuneEventTypeRefund                         FinetuneEventType = "refund"
	FinetuneEventTypeWarning                        FinetuneEventType = "warning"
	FinetuneEventTypeEarlyStopped                   FinetuneEventType = "early_stopped"
	FinetuneEventTypeTokenizedDatasetUploadComplete FinetuneEventType = "tokenized_dataset_upload_complete"
)

type FinetuneModelLimits added in v0.11.0

type FinetuneModelLimits struct {
	// Default gradient accumulation steps used when a fine-tune request omits the
	// value or sets it to 0.
	DefaultGradientAccumulationSteps int64 `json:"default_gradient_accumulation_steps" api:"required"`
	// Limits for LoRA training.
	LoraTraining FinetuneModelLimitsLoraTraining `json:"lora_training" api:"required"`
	// Maximum learning rate.
	MaxLearningRate float64 `json:"max_learning_rate" api:"required"`
	// Maximum number of checkpoints that can be saved during a fine-tuning job.
	MaxNumCheckpoints int64 `json:"max_num_checkpoints" api:"required"`
	// Maximum number of training epochs.
	MaxNumEpochs int64 `json:"max_num_epochs" api:"required"`
	// Maximum number of evaluations.
	MaxNumEvals int64 `json:"max_num_evals" api:"required"`
	// Maximum sequence length supported for DPO training.
	MaxSeqLengthDpo int64 `json:"max_seq_length_dpo" api:"required"`
	// Maximum sequence length supported for SFT training.
	MaxSeqLengthSft int64 `json:"max_seq_length_sft" api:"required"`
	// Whether a merged checkpoint (the base model with the trained LoRA adapter fused
	// in) is produced for LoRA fine-tunes of this model, in addition to the standalone
	// adapter.
	MergeOutputLora bool `json:"merge_output_lora" api:"required"`
	// Minimum learning rate.
	MinLearningRate float64 `json:"min_learning_rate" api:"required"`
	// Minimum value allowed for the max_seq_length hyperparameter.
	MinMaxSeqLength int64 `json:"min_max_seq_length" api:"required"`
	// The name of the model.
	ModelName string `json:"model_name" api:"required"`
	// Whether the model supports full (non-LoRA) fine-tuning. When false, only LoRA
	// fine-tuning is available and the full_training limits are reported as zero.
	SupportsFullTraining bool `json:"supports_full_training" api:"required"`
	// Whether the model supports reasoning.
	SupportsReasoning bool `json:"supports_reasoning" api:"required"`
	// Whether the model supports tool/function calling.
	SupportsTools bool `json:"supports_tools" api:"required"`
	// Whether the model supports vision/multimodal inputs.
	SupportsVision bool `json:"supports_vision" api:"required"`
	// Limits for full training.
	FullTraining FinetuneModelLimitsFullTraining `json:"full_training"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DefaultGradientAccumulationSteps respjson.Field
		LoraTraining                     respjson.Field
		MaxLearningRate                  respjson.Field
		MaxNumCheckpoints                respjson.Field
		MaxNumEpochs                     respjson.Field
		MaxNumEvals                      respjson.Field
		MaxSeqLengthDpo                  respjson.Field
		MaxSeqLengthSft                  respjson.Field
		MergeOutputLora                  respjson.Field
		MinLearningRate                  respjson.Field
		MinMaxSeqLength                  respjson.Field
		ModelName                        respjson.Field
		SupportsFullTraining             respjson.Field
		SupportsReasoning                respjson.Field
		SupportsTools                    respjson.Field
		SupportsVision                   respjson.Field
		FullTraining                     respjson.Field
		ExtraFields                      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Model limits for fine-tuning.

func (FinetuneModelLimits) RawJSON added in v0.11.0

func (r FinetuneModelLimits) RawJSON() string

Returns the unmodified JSON received from the API

func (*FinetuneModelLimits) UnmarshalJSON added in v0.11.0

func (r *FinetuneModelLimits) UnmarshalJSON(data []byte) error

type FinetuneModelLimitsFullTraining added in v0.11.0

type FinetuneModelLimitsFullTraining struct {
	// Maximum batch size for SFT full training.
	MaxBatchSize int64 `json:"max_batch_size" api:"required"`
	// Maximum batch size for DPO full training.
	MaxBatchSizeDpo int64 `json:"max_batch_size_dpo" api:"required"`
	// Minimum batch size for full training.
	MinBatchSize int64 `json:"min_batch_size" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MaxBatchSize    respjson.Field
		MaxBatchSizeDpo respjson.Field
		MinBatchSize    respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Limits for full training.

func (FinetuneModelLimitsFullTraining) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*FinetuneModelLimitsFullTraining) UnmarshalJSON added in v0.11.0

func (r *FinetuneModelLimitsFullTraining) UnmarshalJSON(data []byte) error

type FinetuneModelLimitsLoraTraining added in v0.11.0

type FinetuneModelLimitsLoraTraining struct {
	// Default LoRA rank applied when a fine-tune request omits training_type.
	DefaultRank int64 `json:"default_rank" api:"required"`
	// Maximum batch size for SFT LoRA training.
	MaxBatchSize int64 `json:"max_batch_size" api:"required"`
	// Maximum batch size for DPO LoRA training.
	MaxBatchSizeDpo int64 `json:"max_batch_size_dpo" api:"required"`
	// Maximum LoRA rank.
	MaxRank int64 `json:"max_rank" api:"required"`
	// Minimum batch size for LoRA training.
	MinBatchSize int64 `json:"min_batch_size" api:"required"`
	// Available target modules for LoRA.
	TargetModules []string `json:"target_modules" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DefaultRank     respjson.Field
		MaxBatchSize    respjson.Field
		MaxBatchSizeDpo respjson.Field
		MaxRank         respjson.Field
		MinBatchSize    respjson.Field
		TargetModules   respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Limits for LoRA training.

func (FinetuneModelLimitsLoraTraining) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*FinetuneModelLimitsLoraTraining) UnmarshalJSON added in v0.11.0

func (r *FinetuneModelLimitsLoraTraining) UnmarshalJSON(data []byte) error

type FinetuneResponse

type FinetuneResponse struct {
	ID string `json:"id" api:"required" format:"uuid"`
	// Any of "pending", "queued", "running", "compressing", "uploading",
	// "cancel_requested", "cancelled", "error", "completed".
	Status FinetuneResponseStatus `json:"status" api:"required"`
	// ID of the user who created the fine-tune job.
	UserID string `json:"user_id" api:"required"`
	// Together model registry object ID for the final adapter weights on LoRA jobs.
	AdapterObjectID string `json:"adapter_object_id"`
	// Together model registry name for the final adapter weights on LoRA jobs,
	// formatted as `<project_slug>/<model_name>-adapter`.
	AdapterObjectName string `json:"adapter_object_name"`
	// Together model registry revision ID for the final adapter weights on LoRA jobs.
	AdapterObjectRevisionID string                         `json:"adapter_object_revision_id"`
	BatchSize               FinetuneResponseBatchSizeUnion `json:"batch_size"`
	CreatedAt               time.Time                      `json:"created_at" format:"date-time"`
	// Whether the early-stopping criterion triggered.
	EarlyStopped bool `json:"early_stopped"`
	// Best validation loss observed, corresponding to early_stopping_best_step. Null
	// if no improving evaluation was recorded (for example, a non-finite first
	// evaluation).
	EarlyStoppingBestMetric float64 `json:"early_stopping_best_metric" api:"nullable"`
	// Step associated with the selected early-stopping artifact. When
	// early_stopping_best_metric is null, no finite best metric was recorded; this is
	// the halt step, not a best-checkpoint step.
	EarlyStoppingBestStep int64                       `json:"early_stopping_best_step"`
	EpochsCompleted       int64                       `json:"epochs_completed"`
	EvalSteps             int64                       `json:"eval_steps"`
	Events                []FinetuneEvent             `json:"events"`
	FromCheckpoint        string                      `json:"from_checkpoint"`
	FromHfModel           string                      `json:"from_hf_model"`
	HfModelRevision       string                      `json:"hf_model_revision"`
	JobID                 string                      `json:"job_id"`
	LearningRate          float64                     `json:"learning_rate"`
	LrScheduler           FinetuneResponseLrScheduler `json:"lr_scheduler"`
	MaxGradNorm           float64                     `json:"max_grad_norm"`
	Model                 string                      `json:"model"`
	// Together model registry object ID for the final model weights (e.g. `ml_...`).
	ModelObjectID string `json:"model_object_id"`
	// Together model registry name for the final model weights, formatted as
	// `<project_slug>/<model_name>`.
	ModelObjectName string `json:"model_object_name"`
	// Together model registry revision ID for the final model weights (e.g. `rv_...`).
	ModelObjectRevisionID string                           `json:"model_object_revision_id"`
	ModelOutputName       string                           `json:"model_output_name"`
	ModelOutputPath       string                           `json:"model_output_path"`
	MultimodalParams      FinetuneResponseMultimodalParams `json:"multimodal_params"`
	NCheckpoints          int64                            `json:"n_checkpoints"`
	NEpochs               int64                            `json:"n_epochs"`
	NEvals                int64                            `json:"n_evals"`
	ParamCount            int64                            `json:"param_count"`
	// Progress information for a fine-tuning job
	Progress   FinetuneResponseProgress `json:"progress"`
	QueueDepth int64                    `json:"queue_depth"`
	StartedAt  time.Time                `json:"started_at" format:"date-time"`
	TokenCount int64                    `json:"token_count"`
	// Storage path for the tokenized dataset archive generated for this fine-tune job.
	TokenizedDatasetPath string `json:"tokenized_dataset_path"`
	// Timestamp when the tokenized dataset archive was uploaded.
	TokenizedDatasetUploadedAt time.Time                           `json:"tokenized_dataset_uploaded_at" format:"date-time"`
	TotalPrice                 int64                               `json:"total_price"`
	TrainOnInputs              FinetuneResponseTrainOnInputsUnion  `json:"train_on_inputs"`
	TrainingFile               string                              `json:"training_file"`
	TrainingMethod             FinetuneResponseTrainingMethodUnion `json:"training_method"`
	// LoRA training configuration for a fine-tuning job.
	TrainingType         FinetuneResponseTrainingTypeUnion `json:"training_type"`
	TrainingfileNumlines int64                             `json:"trainingfile_numlines"`
	TrainingfileSize     int64                             `json:"trainingfile_size"`
	UpdatedAt            time.Time                         `json:"updated_at" format:"date-time"`
	ValidationFile       string                            `json:"validation_file"`
	WandbProjectName     string                            `json:"wandb_project_name"`
	WandbURL             string                            `json:"wandb_url"`
	WarmupRatio          float64                           `json:"warmup_ratio"`
	WeightDecay          float64                           `json:"weight_decay"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                         respjson.Field
		Status                     respjson.Field
		UserID                     respjson.Field
		AdapterObjectID            respjson.Field
		AdapterObjectName          respjson.Field
		AdapterObjectRevisionID    respjson.Field
		BatchSize                  respjson.Field
		CreatedAt                  respjson.Field
		EarlyStopped               respjson.Field
		EarlyStoppingBestMetric    respjson.Field
		EarlyStoppingBestStep      respjson.Field
		EpochsCompleted            respjson.Field
		EvalSteps                  respjson.Field
		Events                     respjson.Field
		FromCheckpoint             respjson.Field
		FromHfModel                respjson.Field
		HfModelRevision            respjson.Field
		JobID                      respjson.Field
		LearningRate               respjson.Field
		LrScheduler                respjson.Field
		MaxGradNorm                respjson.Field
		Model                      respjson.Field
		ModelObjectID              respjson.Field
		ModelObjectName            respjson.Field
		ModelObjectRevisionID      respjson.Field
		ModelOutputName            respjson.Field
		ModelOutputPath            respjson.Field
		MultimodalParams           respjson.Field
		NCheckpoints               respjson.Field
		NEpochs                    respjson.Field
		NEvals                     respjson.Field
		ParamCount                 respjson.Field
		Progress                   respjson.Field
		QueueDepth                 respjson.Field
		StartedAt                  respjson.Field
		TokenCount                 respjson.Field
		TokenizedDatasetPath       respjson.Field
		TokenizedDatasetUploadedAt respjson.Field
		TotalPrice                 respjson.Field
		TrainOnInputs              respjson.Field
		TrainingFile               respjson.Field
		TrainingMethod             respjson.Field
		TrainingType               respjson.Field
		TrainingfileNumlines       respjson.Field
		TrainingfileSize           respjson.Field
		UpdatedAt                  respjson.Field
		ValidationFile             respjson.Field
		WandbProjectName           respjson.Field
		WandbURL                   respjson.Field
		WarmupRatio                respjson.Field
		WeightDecay                respjson.Field
		ExtraFields                map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponse) RawJSON

func (r FinetuneResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FinetuneResponse) UnmarshalJSON

func (r *FinetuneResponse) UnmarshalJSON(data []byte) error

type FinetuneResponseBatchSizeString

type FinetuneResponseBatchSizeString string
const (
	FinetuneResponseBatchSizeStringMax FinetuneResponseBatchSizeString = "max"
)

type FinetuneResponseBatchSizeUnion

type FinetuneResponseBatchSizeUnion struct {
	// This field will be present if the value is a [int64] instead of an object.
	OfInt int64 `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfFinetuneResponseBatchSizeString string `json:",inline"`
	JSON                              struct {
		OfInt                             respjson.Field
		OfFinetuneResponseBatchSizeString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FinetuneResponseBatchSizeUnion contains all possible properties and values from [int64], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfInt OfFinetuneResponseBatchSizeString]

func (FinetuneResponseBatchSizeUnion) AsFinetuneResponseBatchSizeString

func (u FinetuneResponseBatchSizeUnion) AsFinetuneResponseBatchSizeString() (v string)

func (FinetuneResponseBatchSizeUnion) AsInt

func (u FinetuneResponseBatchSizeUnion) AsInt() (v int64)

func (FinetuneResponseBatchSizeUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseBatchSizeUnion) UnmarshalJSON

func (r *FinetuneResponseBatchSizeUnion) UnmarshalJSON(data []byte) error

type FinetuneResponseLrScheduler

type FinetuneResponseLrScheduler struct {
	// Any of "linear", "cosine".
	LrSchedulerType string                                          `json:"lr_scheduler_type" api:"required"`
	LrSchedulerArgs FinetuneResponseLrSchedulerLrSchedulerArgsUnion `json:"lr_scheduler_args"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LrSchedulerType respjson.Field
		LrSchedulerArgs respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseLrScheduler) RawJSON

func (r FinetuneResponseLrScheduler) RawJSON() string

Returns the unmodified JSON received from the API

func (*FinetuneResponseLrScheduler) UnmarshalJSON

func (r *FinetuneResponseLrScheduler) UnmarshalJSON(data []byte) error

type FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

type FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio" api:"required"`
	// Number or fraction of cycles for the cosine learning rate scheduler
	NumCycles float64 `json:"num_cycles" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		NumCycles   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs) UnmarshalJSON

type FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

type FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs struct {
	// The ratio of the final learning rate to the peak learning rate
	MinLrRatio float64 `json:"min_lr_ratio"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MinLrRatio  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs) UnmarshalJSON

type FinetuneResponseLrSchedulerLrSchedulerArgsUnion

type FinetuneResponseLrSchedulerLrSchedulerArgsUnion struct {
	MinLrRatio float64 `json:"min_lr_ratio"`
	// This field is from variant
	// [FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs].
	NumCycles float64 `json:"num_cycles"`
	JSON      struct {
		MinLrRatio respjson.Field
		NumCycles  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FinetuneResponseLrSchedulerLrSchedulerArgsUnion contains all possible properties and values from FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs, FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FinetuneResponseLrSchedulerLrSchedulerArgsUnion) AsFinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs

func (u FinetuneResponseLrSchedulerLrSchedulerArgsUnion) AsFinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs() (v FinetuneResponseLrSchedulerLrSchedulerArgsCosineLrSchedulerArgs)

func (FinetuneResponseLrSchedulerLrSchedulerArgsUnion) AsFinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs

func (u FinetuneResponseLrSchedulerLrSchedulerArgsUnion) AsFinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs() (v FinetuneResponseLrSchedulerLrSchedulerArgsLinearLrSchedulerArgs)

func (FinetuneResponseLrSchedulerLrSchedulerArgsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseLrSchedulerLrSchedulerArgsUnion) UnmarshalJSON

type FinetuneResponseMultimodalParams added in v0.4.0

type FinetuneResponseMultimodalParams struct {
	// Whether to train the vision encoder of the model. Only available for multimodal
	// models.
	TrainVision bool `json:"train_vision"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		TrainVision respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseMultimodalParams) RawJSON added in v0.4.0

Returns the unmodified JSON received from the API

func (*FinetuneResponseMultimodalParams) UnmarshalJSON added in v0.4.0

func (r *FinetuneResponseMultimodalParams) UnmarshalJSON(data []byte) error

type FinetuneResponseProgress added in v0.2.0

type FinetuneResponseProgress struct {
	// Whether time estimate is available
	EstimateAvailable bool `json:"estimate_available" api:"required"`
	// Estimated time remaining in seconds for the fine-tuning job to next state
	SecondsRemaining int64 `json:"seconds_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EstimateAvailable respjson.Field
		SecondsRemaining  respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Progress information for a fine-tuning job

func (FinetuneResponseProgress) RawJSON added in v0.2.0

func (r FinetuneResponseProgress) RawJSON() string

Returns the unmodified JSON received from the API

func (*FinetuneResponseProgress) UnmarshalJSON added in v0.2.0

func (r *FinetuneResponseProgress) UnmarshalJSON(data []byte) error

type FinetuneResponseStatus

type FinetuneResponseStatus string
const (
	FinetuneResponseStatusPending         FinetuneResponseStatus = "pending"
	FinetuneResponseStatusQueued          FinetuneResponseStatus = "queued"
	FinetuneResponseStatusRunning         FinetuneResponseStatus = "running"
	FinetuneResponseStatusCompressing     FinetuneResponseStatus = "compressing"
	FinetuneResponseStatusUploading       FinetuneResponseStatus = "uploading"
	FinetuneResponseStatusCancelRequested FinetuneResponseStatus = "cancel_requested"
	FinetuneResponseStatusCancelled       FinetuneResponseStatus = "cancelled"
	FinetuneResponseStatusError           FinetuneResponseStatus = "error"
	FinetuneResponseStatusCompleted       FinetuneResponseStatus = "completed"
)

type FinetuneResponseTrainOnInputsString

type FinetuneResponseTrainOnInputsString string
const (
	FinetuneResponseTrainOnInputsStringAuto FinetuneResponseTrainOnInputsString = "auto"
)

type FinetuneResponseTrainOnInputsUnion

type FinetuneResponseTrainOnInputsUnion struct {
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfFinetuneResponseTrainOnInputsString string `json:",inline"`
	JSON                                  struct {
		OfBool                                respjson.Field
		OfFinetuneResponseTrainOnInputsString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FinetuneResponseTrainOnInputsUnion contains all possible properties and values from [bool], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfBool OfFinetuneResponseTrainOnInputsString]

func (FinetuneResponseTrainOnInputsUnion) AsBool

func (FinetuneResponseTrainOnInputsUnion) AsFinetuneResponseTrainOnInputsString

func (u FinetuneResponseTrainOnInputsUnion) AsFinetuneResponseTrainOnInputsString() (v string)

func (FinetuneResponseTrainOnInputsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainOnInputsUnion) UnmarshalJSON

func (r *FinetuneResponseTrainOnInputsUnion) UnmarshalJSON(data []byte) error

type FinetuneResponseTrainingMethodTrainingMethodDpo

type FinetuneResponseTrainingMethodTrainingMethodDpo struct {
	// Any of "dpo".
	Method                        string  `json:"method" api:"required"`
	DpoBeta                       float64 `json:"dpo_beta"`
	DpoNormalizeLogratiosByLength bool    `json:"dpo_normalize_logratios_by_length"`
	DpoReferenceFree              bool    `json:"dpo_reference_free"`
	RpoAlpha                      float64 `json:"rpo_alpha"`
	SimpoGamma                    float64 `json:"simpo_gamma"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method                        respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		ExtraFields                   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseTrainingMethodTrainingMethodDpo) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingMethodTrainingMethodDpo) UnmarshalJSON

type FinetuneResponseTrainingMethodTrainingMethodSft

type FinetuneResponseTrainingMethodTrainingMethodSft struct {
	// Any of "sft".
	Method string `json:"method" api:"required"`
	// Whether to mask user messages in conversational data or prompts in instruction
	// data.
	TrainOnInputs FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Method        respjson.Field
		TrainOnInputs respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseTrainingMethodTrainingMethodSft) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingMethodTrainingMethodSft) UnmarshalJSON

type FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString

type FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString string
const (
	FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsStringAuto FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString = "auto"
)

type FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion

type FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion struct {
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString string `json:",inline"`
	JSON                                                                 struct {
		OfBool                                                               respjson.Field
		OfFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion contains all possible properties and values from [bool], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfBool OfFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString]

func (FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsBool

func (FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString

func (u FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) AsFinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsString() (v string)

func (FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion) UnmarshalJSON

type FinetuneResponseTrainingMethodUnion

type FinetuneResponseTrainingMethodUnion struct {
	Method string `json:"method"`
	// This field is from variant [FinetuneResponseTrainingMethodTrainingMethodSft].
	TrainOnInputs FinetuneResponseTrainingMethodTrainingMethodSftTrainOnInputsUnion `json:"train_on_inputs"`
	// This field is from variant [FinetuneResponseTrainingMethodTrainingMethodDpo].
	DpoBeta float64 `json:"dpo_beta"`
	// This field is from variant [FinetuneResponseTrainingMethodTrainingMethodDpo].
	DpoNormalizeLogratiosByLength bool `json:"dpo_normalize_logratios_by_length"`
	// This field is from variant [FinetuneResponseTrainingMethodTrainingMethodDpo].
	DpoReferenceFree bool `json:"dpo_reference_free"`
	// This field is from variant [FinetuneResponseTrainingMethodTrainingMethodDpo].
	RpoAlpha float64 `json:"rpo_alpha"`
	// This field is from variant [FinetuneResponseTrainingMethodTrainingMethodDpo].
	SimpoGamma float64 `json:"simpo_gamma"`
	JSON       struct {
		Method                        respjson.Field
		TrainOnInputs                 respjson.Field
		DpoBeta                       respjson.Field
		DpoNormalizeLogratiosByLength respjson.Field
		DpoReferenceFree              respjson.Field
		RpoAlpha                      respjson.Field
		SimpoGamma                    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FinetuneResponseTrainingMethodUnion contains all possible properties and values from FinetuneResponseTrainingMethodTrainingMethodSft, FinetuneResponseTrainingMethodTrainingMethodDpo.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FinetuneResponseTrainingMethodUnion) AsFinetuneResponseTrainingMethodTrainingMethodDpo

func (u FinetuneResponseTrainingMethodUnion) AsFinetuneResponseTrainingMethodTrainingMethodDpo() (v FinetuneResponseTrainingMethodTrainingMethodDpo)

func (FinetuneResponseTrainingMethodUnion) AsFinetuneResponseTrainingMethodTrainingMethodSft

func (u FinetuneResponseTrainingMethodUnion) AsFinetuneResponseTrainingMethodTrainingMethodSft() (v FinetuneResponseTrainingMethodTrainingMethodSft)

func (FinetuneResponseTrainingMethodUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingMethodUnion) UnmarshalJSON

func (r *FinetuneResponseTrainingMethodUnion) UnmarshalJSON(data []byte) error

type FinetuneResponseTrainingTypeFullTrainingType

type FinetuneResponseTrainingTypeFullTrainingType struct {
	// Any of "Full".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FinetuneResponseTrainingTypeFullTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingTypeFullTrainingType) UnmarshalJSON

func (r *FinetuneResponseTrainingTypeFullTrainingType) UnmarshalJSON(data []byte) error

type FinetuneResponseTrainingTypeLoRaTrainingType

type FinetuneResponseTrainingTypeLoRaTrainingType struct {
	// Scaling factor applied to the LoRA adapter weights.
	LoraAlpha int64 `json:"lora_alpha" api:"required"`
	// Rank of the LoRA adapter matrices.
	LoraR int64 `json:"lora_r" api:"required"`
	// Identifies this request as a LoRA fine-tune.
	//
	// Any of "Lora".
	Type string `json:"type" api:"required"`
	// Dropout probability applied to LoRA adapter inputs.
	LoraDropout float64 `json:"lora_dropout"`
	// Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE
	// expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention
	// modules on compatible models. Fine-tuning jobs that target expert modules
	// produce adapter-only output unless the selected model supports merged expert
	// LoRA output.
	LoraTrainableModules string `json:"lora_trainable_modules"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		Type                 respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LoRA training configuration for a fine-tuning job.

func (FinetuneResponseTrainingTypeLoRaTrainingType) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingTypeLoRaTrainingType) UnmarshalJSON

func (r *FinetuneResponseTrainingTypeLoRaTrainingType) UnmarshalJSON(data []byte) error

type FinetuneResponseTrainingTypeUnion

type FinetuneResponseTrainingTypeUnion struct {
	Type string `json:"type"`
	// This field is from variant [FinetuneResponseTrainingTypeLoRaTrainingType].
	LoraAlpha int64 `json:"lora_alpha"`
	// This field is from variant [FinetuneResponseTrainingTypeLoRaTrainingType].
	LoraR int64 `json:"lora_r"`
	// This field is from variant [FinetuneResponseTrainingTypeLoRaTrainingType].
	LoraDropout float64 `json:"lora_dropout"`
	// This field is from variant [FinetuneResponseTrainingTypeLoRaTrainingType].
	LoraTrainableModules string `json:"lora_trainable_modules"`
	JSON                 struct {
		Type                 respjson.Field
		LoraAlpha            respjson.Field
		LoraR                respjson.Field
		LoraDropout          respjson.Field
		LoraTrainableModules respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FinetuneResponseTrainingTypeUnion contains all possible properties and values from FinetuneResponseTrainingTypeFullTrainingType, FinetuneResponseTrainingTypeLoRaTrainingType.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FinetuneResponseTrainingTypeUnion) AsFinetuneResponseTrainingTypeFullTrainingType

func (u FinetuneResponseTrainingTypeUnion) AsFinetuneResponseTrainingTypeFullTrainingType() (v FinetuneResponseTrainingTypeFullTrainingType)

func (FinetuneResponseTrainingTypeUnion) AsFinetuneResponseTrainingTypeLoRaTrainingType

func (u FinetuneResponseTrainingTypeUnion) AsFinetuneResponseTrainingTypeLoRaTrainingType() (v FinetuneResponseTrainingTypeLoRaTrainingType)

func (FinetuneResponseTrainingTypeUnion) RawJSON

Returns the unmodified JSON received from the API

func (*FinetuneResponseTrainingTypeUnion) UnmarshalJSON

func (r *FinetuneResponseTrainingTypeUnion) UnmarshalJSON(data []byte) error

type ImageDataB64

type ImageDataB64 struct {
	B64Json string `json:"b64_json" api:"required"`
	Index   int64  `json:"index" api:"required"`
	// Any of "b64_json".
	Type ImageDataB64Type `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		B64Json     respjson.Field
		Index       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ImageDataB64) RawJSON

func (r ImageDataB64) RawJSON() string

Returns the unmodified JSON received from the API

func (*ImageDataB64) UnmarshalJSON

func (r *ImageDataB64) UnmarshalJSON(data []byte) error

type ImageDataB64Type

type ImageDataB64Type string
const (
	ImageDataB64TypeB64Json ImageDataB64Type = "b64_json"
)

type ImageDataURL

type ImageDataURL struct {
	Index int64 `json:"index" api:"required"`
	// Any of "url".
	Type ImageDataURLType `json:"type" api:"required"`
	URL  string           `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Index       respjson.Field
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ImageDataURL) RawJSON

func (r ImageDataURL) RawJSON() string

Returns the unmodified JSON received from the API

func (*ImageDataURL) UnmarshalJSON

func (r *ImageDataURL) UnmarshalJSON(data []byte) error

type ImageDataURLType

type ImageDataURLType string
const (
	ImageDataURLTypeURL ImageDataURLType = "url"
)

type ImageFile

type ImageFile struct {
	ID    string               `json:"id" api:"required"`
	Data  []ImageFileDataUnion `json:"data" api:"required"`
	Model string               `json:"model" api:"required"`
	// The object type, which is always `list`.
	Object constant.List `json:"object" default:"list"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Data        respjson.Field
		Model       respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ImageFile) RawJSON

func (r ImageFile) RawJSON() string

Returns the unmodified JSON received from the API

func (*ImageFile) UnmarshalJSON

func (r *ImageFile) UnmarshalJSON(data []byte) error

type ImageFileDataUnion

type ImageFileDataUnion struct {
	// This field is from variant [ImageDataB64].
	B64Json string `json:"b64_json"`
	Index   int64  `json:"index"`
	// Any of "b64_json", "url".
	Type string `json:"type"`
	// This field is from variant [ImageDataURL].
	URL  string `json:"url"`
	JSON struct {
		B64Json respjson.Field
		Index   respjson.Field
		Type    respjson.Field
		URL     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ImageFileDataUnion contains all possible properties and values from ImageDataB64, ImageDataURL.

Use the ImageFileDataUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ImageFileDataUnion) AsAny

func (u ImageFileDataUnion) AsAny() anyImageFileData

Use the following switch statement to find the correct variant

switch variant := ImageFileDataUnion.AsAny().(type) {
case together.ImageDataB64:
case together.ImageDataURL:
default:
  fmt.Errorf("no variant present")
}

func (ImageFileDataUnion) AsB64Json

func (u ImageFileDataUnion) AsB64Json() (v ImageDataB64)

func (ImageFileDataUnion) AsURL

func (u ImageFileDataUnion) AsURL() (v ImageDataURL)

func (ImageFileDataUnion) RawJSON

func (u ImageFileDataUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*ImageFileDataUnion) UnmarshalJSON

func (r *ImageFileDataUnion) UnmarshalJSON(data []byte) error

type ImageGenerateParams

type ImageGenerateParams struct {
	// The model to use for image generation.
	//
	// [See all of Together AI's image models](https://docs.together.ai/docs/serverless-models#image-models)
	Model ImageGenerateParamsModel `json:"model,omitzero" api:"required"`
	// A description of the desired images. Maximum length varies by model.
	Prompt string `json:"prompt" api:"required"`
	// If true, disables the safety checker for image generation.
	DisableSafetyChecker param.Opt[bool] `json:"disable_safety_checker,omitzero"`
	// Adjusts the alignment of the generated image with the input prompt. Higher
	// values (e.g., 8-10) make the output more faithful to the prompt, while lower
	// values (e.g., 1-5) encourage more creative freedom.
	GuidanceScale param.Opt[float64] `json:"guidance_scale,omitzero"`
	// Height of the image to generate in number of pixels.
	Height param.Opt[int64] `json:"height,omitzero"`
	// URL of an image to use for image models that support it.
	ImageURL param.Opt[string] `json:"image_url,omitzero"`
	// Number of image results to generate.
	N param.Opt[int64] `json:"n,omitzero"`
	// The prompt or prompts not to guide the image generation.
	NegativePrompt param.Opt[string] `json:"negative_prompt,omitzero"`
	// Seed used for generation. Can be used to reproduce image generations.
	Seed param.Opt[int64] `json:"seed,omitzero"`
	// Number of generation steps.
	Steps param.Opt[int64] `json:"steps,omitzero"`
	// Width of the image to generate in number of pixels.
	Width param.Opt[int64] `json:"width,omitzero"`
	// An array of objects that define LoRAs (Low-Rank Adaptations) to influence the
	// generated image.
	ImageLoras []ImageGenerateParamsImageLora `json:"image_loras,omitzero"`
	// The format of the image response. Can be either be `jpeg` or `png`. Defaults to
	// `jpeg`.
	//
	// Any of "jpeg", "png".
	OutputFormat ImageGenerateParamsOutputFormat `json:"output_format,omitzero"`
	// An array of image URLs that guide the overall appearance and style of the
	// generated image. These reference images influence the visual characteristics
	// consistently across the generation.
	ReferenceImages []string `json:"reference_images,omitzero"`
	// Format of the image response. Can be either a base64 string or a URL.
	//
	// Any of "base64", "url".
	ResponseFormat ImageGenerateParamsResponseFormat `json:"response_format,omitzero"`
	// contains filtered or unexported fields
}

func (ImageGenerateParams) MarshalJSON

func (r ImageGenerateParams) MarshalJSON() (data []byte, err error)

func (*ImageGenerateParams) UnmarshalJSON

func (r *ImageGenerateParams) UnmarshalJSON(data []byte) error

type ImageGenerateParamsImageLora

type ImageGenerateParamsImageLora struct {
	// The URL of the LoRA to apply (e.g.
	// https://huggingface.co/strangerzonehf/Flux-Midjourney-Mix2-LoRA).
	Path string `json:"path" api:"required"`
	// The strength of the LoRA's influence. Most LoRA's recommend a value of 1.
	Scale float64 `json:"scale" api:"required"`
	// contains filtered or unexported fields
}

The properties Path, Scale are required.

func (ImageGenerateParamsImageLora) MarshalJSON

func (r ImageGenerateParamsImageLora) MarshalJSON() (data []byte, err error)

func (*ImageGenerateParamsImageLora) UnmarshalJSON

func (r *ImageGenerateParamsImageLora) UnmarshalJSON(data []byte) error

type ImageGenerateParamsModel

type ImageGenerateParamsModel string

The model to use for image generation.

[See all of Together AI's image models](https://docs.together.ai/docs/serverless-models#image-models)

const (
	ImageGenerateParamsModelBlackForestLabsFlux1SchnellFree ImageGenerateParamsModel = "black-forest-labs/FLUX.1-schnell-Free"
	ImageGenerateParamsModelBlackForestLabsFlux1Schnell     ImageGenerateParamsModel = "black-forest-labs/FLUX.1-schnell"
	ImageGenerateParamsModelBlackForestLabsFlux1_1Pro       ImageGenerateParamsModel = "black-forest-labs/FLUX.1.1-pro"
)

type ImageGenerateParamsOutputFormat

type ImageGenerateParamsOutputFormat string

The format of the image response. Can be either be `jpeg` or `png`. Defaults to `jpeg`.

const (
	ImageGenerateParamsOutputFormatJpeg ImageGenerateParamsOutputFormat = "jpeg"
	ImageGenerateParamsOutputFormatPng  ImageGenerateParamsOutputFormat = "png"
)

type ImageGenerateParamsResponseFormat

type ImageGenerateParamsResponseFormat string

Format of the image response. Can be either a base64 string or a URL.

const (
	ImageGenerateParamsResponseFormatBase64 ImageGenerateParamsResponseFormat = "base64"
	ImageGenerateParamsResponseFormatURL    ImageGenerateParamsResponseFormat = "url"
)

type ImageService

type ImageService struct {
	Options []option.RequestOption
}

ImageService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewImageService method instead.

func NewImageService

func NewImageService(opts ...option.RequestOption) (r ImageService)

NewImageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ImageService) Generate

func (r *ImageService) Generate(ctx context.Context, body ImageGenerateParams, opts ...option.RequestOption) (res *ImageFile, err error)

Use an image model to generate an image for a given prompt.

type InferenceInstanceType added in v0.11.0

type InferenceInstanceType struct {
	// Stable hardware instance type identifier used by deployment configs.
	ID string `json:"id" api:"required"`
	// Human-readable summary of the hardware configuration.
	Description string `json:"description" api:"required"`
	// Number of GPUs in one replica of this instance type.
	GPUCount int64 `json:"gpuCount" api:"required"`
	// Memory available on each GPU, in GiB.
	GPUMemoryGib int64 `json:"gpuMemoryGib" api:"required"`
	// GPU accelerator model, such as `H100` or `B200`.
	GPUType string `json:"gpuType" api:"required"`
	// Human-readable instance type name.
	Name string `json:"name" api:"required"`
	// On-demand price for one running replica, in US cents per hour.
	PriceCentsPerHour int64 `json:"priceCentsPerHour" api:"required"`
	// Regions where this instance type is offered.
	Regions []InferenceInstanceTypeRegion `json:"regions" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		Description       respjson.Field
		GPUCount          respjson.Field
		GPUMemoryGib      respjson.Field
		GPUType           respjson.Field
		Name              respjson.Field
		PriceCentsPerHour respjson.Field
		Regions           respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

GPU hardware configuration on which one inference replica can run.

func (InferenceInstanceType) RawJSON added in v0.11.0

func (r InferenceInstanceType) RawJSON() string

Returns the unmodified JSON received from the API

func (*InferenceInstanceType) UnmarshalJSON added in v0.11.0

func (r *InferenceInstanceType) UnmarshalJSON(data []byte) error

type InferenceInstanceTypeRegion added in v0.11.0

type InferenceInstanceTypeRegion struct {
	// Region name where an instance type is offered.
	Name string `json:"name" api:"required"`
	// Compliance regimes certified in this region with best-effort headroom for each
	// policy. Entries can overlap; read the entry matching the deployment policy
	// instead of summing entries.
	Compliance []InferenceInstanceTypeRegionCompliance `json:"compliance"`
	// Best-effort estimate of how many additional replicas currently fit in a region.
	Headroom InferenceInstanceTypeRegionHeadroom `json:"headroom"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Compliance  respjson.Field
		Headroom    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Region where an instance type is offered.

func (InferenceInstanceTypeRegion) RawJSON added in v0.11.0

func (r InferenceInstanceTypeRegion) RawJSON() string

Returns the unmodified JSON received from the API

func (*InferenceInstanceTypeRegion) UnmarshalJSON added in v0.11.0

func (r *InferenceInstanceTypeRegion) UnmarshalJSON(data []byte) error

type InferenceInstanceTypeRegionCompliance added in v0.13.0

type InferenceInstanceTypeRegionCompliance struct {
	// Best-effort estimate of how many additional replicas currently fit in a region.
	Headroom InferenceInstanceTypeRegionComplianceHeadroom `json:"headroom" api:"required"`
	// Compliance regimes required by a deployment placement policy.
	Policy InferenceInstanceTypeRegionCompliancePolicy `json:"policy" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Headroom    respjson.Field
		Policy      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compliance-specific regional availability for one instance type policy.

func (InferenceInstanceTypeRegionCompliance) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*InferenceInstanceTypeRegionCompliance) UnmarshalJSON added in v0.13.0

func (r *InferenceInstanceTypeRegionCompliance) UnmarshalJSON(data []byte) error

type InferenceInstanceTypeRegionComplianceHeadroom added in v0.13.0

type InferenceInstanceTypeRegionComplianceHeadroom struct {
	// Whether the value is exact or a lower bound.
	//
	// Any of "RELATION_EQ", "RELATION_GTE".
	Relation string `json:"relation" api:"required"`
	// Capped count of replicas that currently fit.
	Value int64 `json:"value"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Relation    respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Best-effort estimate of how many additional replicas currently fit in a region.

func (InferenceInstanceTypeRegionComplianceHeadroom) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*InferenceInstanceTypeRegionComplianceHeadroom) UnmarshalJSON added in v0.13.0

func (r *InferenceInstanceTypeRegionComplianceHeadroom) UnmarshalJSON(data []byte) error

type InferenceInstanceTypeRegionCompliancePolicy added in v0.13.0

type InferenceInstanceTypeRegionCompliancePolicy struct {
	// Restrict placement to HIPAA-attested clusters.
	Hipaa bool `json:"hipaa"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hipaa       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compliance regimes required by a deployment placement policy.

func (InferenceInstanceTypeRegionCompliancePolicy) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*InferenceInstanceTypeRegionCompliancePolicy) UnmarshalJSON added in v0.13.0

func (r *InferenceInstanceTypeRegionCompliancePolicy) UnmarshalJSON(data []byte) error

type InferenceInstanceTypeRegionHeadroom added in v0.11.0

type InferenceInstanceTypeRegionHeadroom struct {
	// Whether the value is exact or a lower bound.
	//
	// Any of "RELATION_EQ", "RELATION_GTE".
	Relation string `json:"relation" api:"required"`
	// Capped count of replicas that currently fit.
	Value int64 `json:"value"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Relation    respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Best-effort estimate of how many additional replicas currently fit in a region.

func (InferenceInstanceTypeRegionHeadroom) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*InferenceInstanceTypeRegionHeadroom) UnmarshalJSON added in v0.11.0

func (r *InferenceInstanceTypeRegionHeadroom) UnmarshalJSON(data []byte) error

type LatencyMetrics added in v0.13.0

type LatencyMetrics struct {
	// 50th-percentile inter-token latency, in milliseconds.
	ItlP50Ms float64 `json:"itlP50Ms"`
	// 90th-percentile inter-token latency, in milliseconds.
	ItlP90Ms float64 `json:"itlP90Ms"`
	// 99th-percentile inter-token latency, in milliseconds.
	ItlP99Ms float64 `json:"itlP99Ms"`
	// 50th-percentile end-to-end request latency, in milliseconds.
	LatencyP50Ms float64 `json:"latencyP50Ms"`
	// 90th-percentile end-to-end request latency, in milliseconds.
	LatencyP90Ms float64 `json:"latencyP90Ms"`
	// 99th-percentile end-to-end request latency, in milliseconds.
	LatencyP99Ms float64 `json:"latencyP99Ms"`
	// 50th-percentile time to first token, in milliseconds.
	TtftP50Ms float64 `json:"ttftP50Ms"`
	// 90th-percentile time to first token, in milliseconds.
	TtftP90Ms float64 `json:"ttftP90Ms"`
	// 99th-percentile time to first token, in milliseconds.
	TtftP99Ms float64 `json:"ttftP99Ms"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ItlP50Ms     respjson.Field
		ItlP90Ms     respjson.Field
		ItlP99Ms     respjson.Field
		LatencyP50Ms respjson.Field
		LatencyP90Ms respjson.Field
		LatencyP99Ms respjson.Field
		TtftP50Ms    respjson.Field
		TtftP90Ms    respjson.Field
		TtftP99Ms    respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Time-to-first-token, end-to-end, and inter-token latency percentiles in milliseconds.

func (LatencyMetrics) RawJSON added in v0.13.0

func (r LatencyMetrics) RawJSON() string

Returns the unmodified JSON received from the API

func (*LatencyMetrics) UnmarshalJSON added in v0.13.0

func (r *LatencyMetrics) UnmarshalJSON(data []byte) error

type LogProbs

type LogProbs struct {
	// List of token IDs corresponding to the logprobs
	TokenIDs []float64 `json:"token_ids"`
	// List of token log probabilities
	TokenLogprobs []float64 `json:"token_logprobs"`
	// List of token strings
	Tokens []string `json:"tokens"`
	// Top log probabilities for the tokens.
	TopLogprobs map[string]float64 `json:"top_logprobs"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		TokenIDs      respjson.Field
		TokenLogprobs respjson.Field
		Tokens        respjson.Field
		TopLogprobs   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogProbs) RawJSON

func (r LogProbs) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogProbs) UnmarshalJSON

func (r *LogProbs) UnmarshalJSON(data []byte) error

type MetricResult added in v0.13.0

type MetricResult struct {
	// Evaluation form used by the metric rule.
	//
	// Any of "METRIC_CHECK_TYPE_THRESHOLD", "METRIC_CHECK_TYPE_REGRESSION".
	Check MetricResultCheck `json:"check"`
	// Direction that indicates whether higher or lower values are worse.
	//
	// Any of "REGRESSION_DIRECTION_HIGHER_IS_WORSE",
	// "REGRESSION_DIRECTION_LOWER_IS_WORSE".
	Direction MetricResultDirection `json:"direction"`
	// Rule-specific failure text. Set only when verdict is METRIC_VERDICT_BREACHED and
	// the gate recorded one.
	FailureReason string `json:"failureReason"`
	// Regression percentage limit used when check is METRIC_CHECK_TYPE_REGRESSION.
	MaxRegressionPercent float64 `json:"maxRegressionPercent"`
	// Metric name as exported to the observability backend.
	Name string `json:"name"`
	// Threshold comparison operator.
	//
	// Any of "THRESHOLD_OPERATOR_GT", "THRESHOLD_OPERATOR_GTE",
	// "THRESHOLD_OPERATOR_LT", "THRESHOLD_OPERATOR_LTE".
	Operator MetricResultOperator `json:"operator"`
	// Percentile value, such as 99. Set only when stat is METRIC_STAT_TYPE_PERCENTILE.
	Percentile int64 `json:"percentile"`
	// Observed source baseline. Set only for regression checks with a recorded
	// observation; a 0 reading serializes explicitly.
	SourceValue float64 `json:"sourceValue"`
	// Aggregation used for the metric.
	//
	// Any of "METRIC_STAT_TYPE_AVG", "METRIC_STAT_TYPE_PERCENTILE".
	Stat MetricResultStat `json:"stat"`
	// Observed target value. Set when the gate recorded an observation; absent on
	// synthesized unavailable results. A 0 reading serializes explicitly.
	TargetValue float64 `json:"targetValue"`
	// Threshold criteria used when check is METRIC_CHECK_TYPE_THRESHOLD.
	Threshold float64 `json:"threshold"`
	// Rule decision recorded by the metric gate. Absent when no decision was recorded.
	//
	// Any of "METRIC_VERDICT_PASS", "METRIC_VERDICT_BREACHED",
	// "METRIC_VERDICT_UNAVAILABLE".
	Verdict MetricResultVerdict `json:"verdict"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Check                respjson.Field
		Direction            respjson.Field
		FailureReason        respjson.Field
		MaxRegressionPercent respjson.Field
		Name                 respjson.Field
		Operator             respjson.Field
		Percentile           respjson.Field
		SourceValue          respjson.Field
		Stat                 respjson.Field
		TargetValue          respjson.Field
		Threshold            respjson.Field
		Verdict              respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Observed metric result enriched with rollout rule criteria and the rule's recorded verdict. Unmeasured rules are synthesized with verdict METRIC_VERDICT_UNAVAILABLE and no source or target value.

func (MetricResult) RawJSON added in v0.13.0

func (r MetricResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricResult) UnmarshalJSON added in v0.13.0

func (r *MetricResult) UnmarshalJSON(data []byte) error

type MetricResultCheck added in v0.13.0

type MetricResultCheck string

Evaluation form used by the metric rule.

const (
	MetricResultCheckMetricCheckTypeThreshold  MetricResultCheck = "METRIC_CHECK_TYPE_THRESHOLD"
	MetricResultCheckMetricCheckTypeRegression MetricResultCheck = "METRIC_CHECK_TYPE_REGRESSION"
)

type MetricResultDirection added in v0.13.0

type MetricResultDirection string

Direction that indicates whether higher or lower values are worse.

const (
	MetricResultDirectionRegressionDirectionHigherIsWorse MetricResultDirection = "REGRESSION_DIRECTION_HIGHER_IS_WORSE"
	MetricResultDirectionRegressionDirectionLowerIsWorse  MetricResultDirection = "REGRESSION_DIRECTION_LOWER_IS_WORSE"
)

type MetricResultOperator added in v0.13.0

type MetricResultOperator string

Threshold comparison operator.

const (
	MetricResultOperatorThresholdOperatorGt  MetricResultOperator = "THRESHOLD_OPERATOR_GT"
	MetricResultOperatorThresholdOperatorGte MetricResultOperator = "THRESHOLD_OPERATOR_GTE"
	MetricResultOperatorThresholdOperatorLt  MetricResultOperator = "THRESHOLD_OPERATOR_LT"
	MetricResultOperatorThresholdOperatorLte MetricResultOperator = "THRESHOLD_OPERATOR_LTE"
)

type MetricResultStat added in v0.13.0

type MetricResultStat string

Aggregation used for the metric.

const (
	MetricResultStatMetricStatTypeAvg        MetricResultStat = "METRIC_STAT_TYPE_AVG"
	MetricResultStatMetricStatTypePercentile MetricResultStat = "METRIC_STAT_TYPE_PERCENTILE"
)

type MetricResultVerdict added in v0.13.0

type MetricResultVerdict string

Rule decision recorded by the metric gate. Absent when no decision was recorded.

const (
	MetricResultVerdictMetricVerdictPass        MetricResultVerdict = "METRIC_VERDICT_PASS"
	MetricResultVerdictMetricVerdictBreached    MetricResultVerdict = "METRIC_VERDICT_BREACHED"
	MetricResultVerdictMetricVerdictUnavailable MetricResultVerdict = "METRIC_VERDICT_UNAVAILABLE"
)

type MetricRule added in v0.13.0

type MetricRule struct {
	// Required catalogue key for the metric to gate on. `serving_latency` is retired.
	//
	// Any of "inflight_requests", "router_error_rate", "router_latency".
	Name MetricRuleName `json:"name" api:"required"`
	// Percentile value, such as 99. Set only when stat is METRIC_STAT_TYPE_PERCENTILE.
	Percentile int64 `json:"percentile"`
	// Regression criteria that fail when the target regresses against the source
	// beyond a limit.
	RegressionCheck RegressionCheck `json:"regressionCheck"`
	// Aggregation used for the metric. Optional for router_error_rate and
	// inflight_requests; omitted values default to METRIC_STAT_TYPE_AVG. Required for
	// router_latency, where AVG or PERCENTILE may be used.
	//
	// Any of "METRIC_STAT_TYPE_AVG", "METRIC_STAT_TYPE_PERCENTILE".
	Stat MetricRuleStat `json:"stat"`
	// Threshold criteria that fail when the target metric violates the configured
	// bound.
	ThresholdCheck ThresholdCheck `json:"thresholdCheck"`
	// Optional query window for the metric. Defaults to the step soak duration.
	Window string `json:"window"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name            respjson.Field
		Percentile      respjson.Field
		RegressionCheck respjson.Field
		Stat            respjson.Field
		ThresholdCheck  respjson.Field
		Window          respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metric gate evaluated during a rollout.

func (MetricRule) RawJSON added in v0.13.0

func (r MetricRule) RawJSON() string

Returns the unmodified JSON received from the API

func (MetricRule) ToParam added in v0.13.0

func (r MetricRule) ToParam() MetricRuleParam

ToParam converts this MetricRule to a MetricRuleParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with MetricRuleParam.Overrides()

func (*MetricRule) UnmarshalJSON added in v0.13.0

func (r *MetricRule) UnmarshalJSON(data []byte) error

type MetricRuleName added in v0.13.0

type MetricRuleName string

Required catalogue key for the metric to gate on. `serving_latency` is retired.

const (
	MetricRuleNameInflightRequests MetricRuleName = "inflight_requests"
	MetricRuleNameRouterErrorRate  MetricRuleName = "router_error_rate"
	MetricRuleNameRouterLatency    MetricRuleName = "router_latency"
)

type MetricRuleParam added in v0.13.0

type MetricRuleParam struct {
	// Required catalogue key for the metric to gate on. `serving_latency` is retired.
	//
	// Any of "inflight_requests", "router_error_rate", "router_latency".
	Name MetricRuleName `json:"name,omitzero" api:"required"`
	// Percentile value, such as 99. Set only when stat is METRIC_STAT_TYPE_PERCENTILE.
	Percentile param.Opt[int64] `json:"percentile,omitzero"`
	// Optional query window for the metric. Defaults to the step soak duration.
	Window param.Opt[string] `json:"window,omitzero"`
	// Regression criteria that fail when the target regresses against the source
	// beyond a limit.
	RegressionCheck RegressionCheckParam `json:"regressionCheck,omitzero"`
	// Aggregation used for the metric. Optional for router_error_rate and
	// inflight_requests; omitted values default to METRIC_STAT_TYPE_AVG. Required for
	// router_latency, where AVG or PERCENTILE may be used.
	//
	// Any of "METRIC_STAT_TYPE_AVG", "METRIC_STAT_TYPE_PERCENTILE".
	Stat MetricRuleStat `json:"stat,omitzero"`
	// Threshold criteria that fail when the target metric violates the configured
	// bound.
	ThresholdCheck ThresholdCheckParam `json:"thresholdCheck,omitzero"`
	// contains filtered or unexported fields
}

Metric gate evaluated during a rollout.

The property Name is required.

func (MetricRuleParam) MarshalJSON added in v0.13.0

func (r MetricRuleParam) MarshalJSON() (data []byte, err error)

func (*MetricRuleParam) UnmarshalJSON added in v0.13.0

func (r *MetricRuleParam) UnmarshalJSON(data []byte) error

type MetricRuleStat added in v0.13.0

type MetricRuleStat string

Aggregation used for the metric. Optional for router_error_rate and inflight_requests; omitted values default to METRIC_STAT_TYPE_AVG. Required for router_latency, where AVG or PERCENTILE may be used.

const (
	MetricRuleStatMetricStatTypeAvg        MetricRuleStat = "METRIC_STAT_TYPE_AVG"
	MetricRuleStatMetricStatTypePercentile MetricRuleStat = "METRIC_STAT_TYPE_PERCENTILE"
)

type MetricsTimeRange added in v0.13.0

type MetricsTimeRange struct {
	// Exclusive end of the time range.
	EndTime time.Time `json:"endTime" format:"date-time"`
	// Inclusive start of the time range.
	StartTime time.Time `json:"startTime" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EndTime     respjson.Field
		StartTime   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Closed-open time range used by metrics and analytics responses.

func (MetricsTimeRange) RawJSON added in v0.13.0

func (r MetricsTimeRange) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsTimeRange) UnmarshalJSON added in v0.13.0

func (r *MetricsTimeRange) UnmarshalJSON(data []byte) error

type Model added in v0.11.0

type Model struct {
	// Unique model identifier.
	ID string `json:"id" api:"required"`
	// Project-qualified model name in the form `<project_slug>/<model_name>`. Create
	// and update requests may use the bare or qualified form.
	Name string `json:"name" api:"required"`
	// ID of the organization that owns the model's project.
	OrganizationID string `json:"organizationId" api:"required"`
	// ID of the project that owns the model.
	ProjectID string `json:"projectId" api:"required"`
	// Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project;
	// `VISIBILITY_INTERNAL` shares it with the organization.
	//
	// Any of "VISIBILITY_PRIVATE", "VISIBILITY_INTERNAL".
	Visibility ModelVisibility `json:"visibility" api:"required"`
	// Architecture, size, precision, and speculative-decoding metadata derived from
	// the model files.
	Weights ModelWeights `json:"weights" api:"required"`
	// Resource name of the base model, using
	// `projects/{baseProject}/models/{baseModelId}`; empty when the model has no base.
	BaseModel string `json:"baseModel"`
	// ID of the supported or custom base model from which this model was derived.
	BaseModelID string `json:"baseModelId"`
	// Human-readable description of the model and its intended use.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Name           respjson.Field
		OrganizationID respjson.Field
		ProjectID      respjson.Field
		Visibility     respjson.Field
		Weights        respjson.Field
		BaseModel      respjson.Field
		BaseModelID    respjson.Field
		Description    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Custom or derived model registered in a project and backed by versioned weight files.

func (Model) RawJSON added in v0.11.0

func (r Model) RawJSON() string

Returns the unmodified JSON received from the API

func (*Model) UnmarshalJSON added in v0.11.0

func (r *Model) UnmarshalJSON(data []byte) error

type ModelConfigGetParams added in v0.13.0

type ModelConfigGetParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type ModelConfigListParams added in v0.13.0

type ModelConfigListParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of results to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Model resource-name filter using `projects/{projectId}/models/{modelId}`;
	// alternative to `referenceModelId`. If both are set, they must agree.
	ReferenceModel param.Opt[string] `query:"referenceModel,omitzero" json:"-"`
	// Deprecated. Use `referenceModel`. Reference model identifier filter; if both are
	// set, they must agree.
	ReferenceModelID param.Opt[string] `query:"referenceModelId,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ModelConfigListParams) URLQuery added in v0.13.0

func (r ModelConfigListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ModelConfigListParams's query parameters as `url.Values`.

type ModelConfigService added in v0.13.0

type ModelConfigService struct {
	Options []option.RequestOption
}

ModelConfigService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModelConfigService method instead.

func NewModelConfigService added in v0.13.0

func NewModelConfigService(opts ...option.RequestOption) (r ModelConfigService)

NewModelConfigService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ModelConfigService) Get added in v0.13.0

func (r *ModelConfigService) Get(ctx context.Context, id string, query ModelConfigGetParams, opts ...option.RequestOption) (res *Config, err error)

Retrieves a model configuration revision by ID, including its runtime selectors and certifications.

func (*ModelConfigService) List added in v0.13.0

Lists production-ready configuration revisions compatible with a reference model. Specify the model with `referenceModel` or the deprecated `referenceModelId`; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project.

func (*ModelConfigService) ListAutoPaging added in v0.13.0

Lists production-ready configuration revisions compatible with a reference model. Specify the model with `referenceModel` or the deprecated `referenceModelId`; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project.

type ModelDeleteParams added in v0.13.0

type ModelDeleteParams struct {
	// ID of the project that owns the model.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type ModelDeleteResponse added in v0.13.0

type ModelDeleteResponse struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Empty response returned after a successful delete operation.

func (ModelDeleteResponse) RawJSON added in v0.13.0

func (r ModelDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelDeleteResponse) UnmarshalJSON added in v0.13.0

func (r *ModelDeleteResponse) UnmarshalJSON(data []byte) error

type ModelDtypeCount added in v0.13.0

type ModelDtypeCount struct {
	// Number of model parameters stored with this data type.
	Count string `json:"count" api:"required"`
	// Numerical data type, such as `float16`, `bfloat16`, or `int8`.
	Dtype string `json:"dtype" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Dtype       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Number of model parameters stored in one numerical data type.

func (ModelDtypeCount) RawJSON added in v0.13.0

func (r ModelDtypeCount) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelDtypeCount) UnmarshalJSON added in v0.13.0

func (r *ModelDtypeCount) UnmarshalJSON(data []byte) error

type ModelGetParams added in v0.13.0

type ModelGetParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type ModelListFilesParams added in v0.13.0

type ModelListFilesParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Revision identifier to read from.
	RevisionID param.Opt[string] `query:"revisionId,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ModelListFilesParams) URLQuery added in v0.13.0

func (r ModelListFilesParams) URLQuery() (v url.Values, err error)

URLQuery serializes ModelListFilesParams's query parameters as `url.Values`.

type ModelListFilesResponse added in v0.13.0

type ModelListFilesResponse struct {
	// Files in the selected model revision.
	Data   []ModelListFilesResponseData `json:"data" api:"required"`
	Object constant.List                `json:"object" default:"list"`
	// Cursor for the next page. Null if there are no more results.
	NextCursor string `json:"next_cursor"`
	// Time when the listed model revision was created.
	RevisionCreatedAt time.Time `json:"revisionCreatedAt" format:"date-time"`
	// ID of the model revision whose files are listed.
	RevisionID string `json:"revisionId"`
	// Total size of all files in the revision, in bytes.
	TotalSizeBytes string `json:"totalSizeBytes"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data              respjson.Field
		Object            respjson.Field
		NextCursor        respjson.Field
		RevisionCreatedAt respjson.Field
		RevisionID        respjson.Field
		TotalSizeBytes    respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Files and aggregate size information for one model revision.

func (ModelListFilesResponse) RawJSON added in v0.13.0

func (r ModelListFilesResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelListFilesResponse) UnmarshalJSON added in v0.13.0

func (r *ModelListFilesResponse) UnmarshalJSON(data []byte) error

type ModelListFilesResponseData added in v0.13.0

type ModelListFilesResponseData struct {
	// Content hash for integrity verification and upload deduplication.
	Hash string `json:"hash"`
	// File path within the model revision.
	Path string `json:"path"`
	// File size in bytes.
	SizeBytes string `json:"sizeBytes"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hash        respjson.Field
		Path        respjson.Field
		SizeBytes   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata for one file in a model revision.

func (ModelListFilesResponseData) RawJSON added in v0.13.0

func (r ModelListFilesResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelListFilesResponseData) UnmarshalJSON added in v0.13.0

func (r *ModelListFilesResponseData) UnmarshalJSON(data []byte) error

type ModelListOrgScopedParams added in v0.13.0

type ModelListOrgScopedParams struct {
	// Cursor from a previous list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of results to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ModelListOrgScopedParams) URLQuery added in v0.13.0

func (r ModelListOrgScopedParams) URLQuery() (v url.Values, err error)

URLQuery serializes ModelListOrgScopedParams's query parameters as `url.Values`.

type ModelListParams added in v0.2.0

type ModelListParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous model list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of models to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Organization whose shared models should be included. Defaults to the
	// authenticated project's organization.
	OrganizationID param.Opt[string] `query:"organizationId,omitzero" json:"-"`
	// Model visibility. Private means it is scoped to the project. Internal means it
	// is scoped to the organization.
	//
	// Any of "VISIBILITY_PRIVATE", "VISIBILITY_INTERNAL".
	Visibility ModelListParamsVisibility `query:"visibility,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ModelListParams) URLQuery added in v0.2.0

func (r ModelListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ModelListParams's query parameters as `url.Values`.

type ModelListParamsVisibility added in v0.13.0

type ModelListParamsVisibility string

Model visibility. Private means it is scoped to the project. Internal means it is scoped to the organization.

const (
	ModelListParamsVisibilityVisibilityPrivate  ModelListParamsVisibility = "VISIBILITY_PRIVATE"
	ModelListParamsVisibilityVisibilityInternal ModelListParamsVisibility = "VISIBILITY_INTERNAL"
)

type ModelListRevisionsParams added in v0.13.0

type ModelListRevisionsParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type ModelListRevisionsResponse added in v0.13.0

type ModelListRevisionsResponse struct {
	// Immutable revisions available for the model.
	Data []ModelListRevisionsResponseData `json:"data"`
	// Cursor for the next page. Null if there are no more results.
	NextCursor string `json:"next_cursor"`
	// Object type. Always `list`.
	//
	// Any of "list".
	Object ModelListRevisionsResponseObject `json:"object"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		NextCursor  respjson.Field
		Object      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Immutable model revisions and pagination metadata.

func (ModelListRevisionsResponse) RawJSON added in v0.13.0

func (r ModelListRevisionsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelListRevisionsResponse) UnmarshalJSON added in v0.13.0

func (r *ModelListRevisionsResponse) UnmarshalJSON(data []byte) error

type ModelListRevisionsResponseData added in v0.13.0

type ModelListRevisionsResponseData struct {
	// Timestamp when the revision was created.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// Revision identifier.
	RevisionID string `json:"revisionId" api:"required"`
	// Timestamp when validation most recently ran for the revision.
	LastValidatedAt time.Time `json:"lastValidatedAt" format:"date-time"`
	// Validation errors reported for the revision.
	ValidationErrors []ModelListRevisionsResponseDataValidationError `json:"validationErrors"`
	// Current validation status for the revision.
	//
	// Any of "REVISION_VALIDATION_STATUS_PENDING",
	// "REVISION_VALIDATION_STATUS_SUCCESS", "REVISION_VALIDATION_STATUS_FAILED",
	// "REVISION_VALIDATION_STATUS_ERROR".
	ValidationStatus string `json:"validationStatus"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreatedAt        respjson.Field
		RevisionID       respjson.Field
		LastValidatedAt  respjson.Field
		ValidationErrors respjson.Field
		ValidationStatus respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Revision metadata for a volume object.

func (ModelListRevisionsResponseData) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ModelListRevisionsResponseData) UnmarshalJSON added in v0.13.0

func (r *ModelListRevisionsResponseData) UnmarshalJSON(data []byte) error

type ModelListRevisionsResponseDataValidationError added in v0.13.0

type ModelListRevisionsResponseDataValidationError struct {
	// Human-readable validation error message.
	Message string `json:"message"`
	// Validation rule that produced the error.
	Rule string `json:"rule"`
	// Severity level reported by the validation rule.
	Severity string `json:"severity"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Rule        respjson.Field
		Severity    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One validation error reported for a model revision.

func (ModelListRevisionsResponseDataValidationError) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ModelListRevisionsResponseDataValidationError) UnmarshalJSON added in v0.13.0

func (r *ModelListRevisionsResponseDataValidationError) UnmarshalJSON(data []byte) error

type ModelListRevisionsResponseObject added in v0.13.0

type ModelListRevisionsResponseObject string

Object type. Always `list`.

const (
	ModelListRevisionsResponseObjectList ModelListRevisionsResponseObject = "list"
)

type ModelListSupportedParams added in v0.13.0

type ModelListSupportedParams struct {
	// Cursor from a previous supported-model list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of models to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Case-insensitive search across model IDs, names, and descriptions.
	Search param.Opt[string] `query:"search,omitzero" json:"-"`
	// Filter models to those with a deployment profile in the selected adapter serving
	// mode.
	//
	// Any of "ADAPTER_MODE_FIXED", "ADAPTER_MODE_DYNAMIC", "ADAPTER_MODE_DISABLED".
	AdapterMode ModelListSupportedParamsAdapterMode `query:"adapterMode,omitzero" json:"-"`
	// Filter models by input modality.
	//
	// Any of "MODALITY_TEXT", "MODALITY_IMAGE", "MODALITY_AUDIO", "MODALITY_VIDEO".
	Modality ModelListSupportedParamsModality `query:"modality,omitzero" json:"-"`
	// Filter models by product surface.
	//
	// Any of "PRODUCT_SERVERLESS", "PRODUCT_DEDICATED", "PRODUCT_FINE_TUNING".
	Product ModelListSupportedParamsProduct `query:"product,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ModelListSupportedParams) URLQuery added in v0.13.0

func (r ModelListSupportedParams) URLQuery() (v url.Values, err error)

URLQuery serializes ModelListSupportedParams's query parameters as `url.Values`.

type ModelListSupportedParamsAdapterMode added in v0.13.0

type ModelListSupportedParamsAdapterMode string

Filter models to those with a deployment profile in the selected adapter serving mode.

const (
	ModelListSupportedParamsAdapterModeAdapterModeFixed    ModelListSupportedParamsAdapterMode = "ADAPTER_MODE_FIXED"
	ModelListSupportedParamsAdapterModeAdapterModeDynamic  ModelListSupportedParamsAdapterMode = "ADAPTER_MODE_DYNAMIC"
	ModelListSupportedParamsAdapterModeAdapterModeDisabled ModelListSupportedParamsAdapterMode = "ADAPTER_MODE_DISABLED"
)

type ModelListSupportedParamsModality added in v0.13.0

type ModelListSupportedParamsModality string

Filter models by input modality.

const (
	ModelListSupportedParamsModalityModalityText  ModelListSupportedParamsModality = "MODALITY_TEXT"
	ModelListSupportedParamsModalityModalityImage ModelListSupportedParamsModality = "MODALITY_IMAGE"
	ModelListSupportedParamsModalityModalityAudio ModelListSupportedParamsModality = "MODALITY_AUDIO"
	ModelListSupportedParamsModalityModalityVideo ModelListSupportedParamsModality = "MODALITY_VIDEO"
)

type ModelListSupportedParamsProduct added in v0.13.0

type ModelListSupportedParamsProduct string

Filter models by product surface.

const (
	ModelListSupportedParamsProductProductServerless ModelListSupportedParamsProduct = "PRODUCT_SERVERLESS"
	ModelListSupportedParamsProductProductDedicated  ModelListSupportedParamsProduct = "PRODUCT_DEDICATED"
	ModelListSupportedParamsProductProductFineTuning ModelListSupportedParamsProduct = "PRODUCT_FINE_TUNING"
)

type ModelNewParams added in v0.13.0

type ModelNewParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// ID of the supported base model from which this model was derived.
	BaseModelID string `json:"baseModelId" api:"required"`
	// Name for the custom model. May be bare or qualified as
	// `<project_slug>/<model_name>`; a supplied project slug must match the project in
	// the request path.
	Name string `json:"name" api:"required"`
	// Volume type to create. Use `model` or `adapter`; plural `models` and `adapters`
	// are also accepted.
	Type string `json:"type" api:"required"`
	// Human-readable description of the model and its intended use.
	Description param.Opt[string] `json:"description,omitzero"`
	// contains filtered or unexported fields
}

func (ModelNewParams) MarshalJSON added in v0.13.0

func (r ModelNewParams) MarshalJSON() (data []byte, err error)

func (*ModelNewParams) UnmarshalJSON added in v0.13.0

func (r *ModelNewParams) UnmarshalJSON(data []byte) error

type ModelParametersResp added in v0.13.0

type ModelParametersResp struct {
	// Parameter counts grouped by numerical data type.
	ByDtype []ModelDtypeCount `json:"byDtype" api:"required"`
	// Total number of parameters in the model weights.
	Total string `json:"total" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ByDtype     respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Model parameter count and precision breakdown.

func (ModelParametersResp) RawJSON added in v0.13.0

func (r ModelParametersResp) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelParametersResp) UnmarshalJSON added in v0.13.0

func (r *ModelParametersResp) UnmarshalJSON(data []byte) error

type ModelRemoteUploadEventsParams added in v0.13.0

type ModelRemoteUploadEventsParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous remote upload event list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of events to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ModelRemoteUploadEventsParams) URLQuery added in v0.13.0

func (r ModelRemoteUploadEventsParams) URLQuery() (v url.Values, err error)

URLQuery serializes ModelRemoteUploadEventsParams's query parameters as `url.Values`.

type ModelRemoteUploadEventsResponse added in v0.13.0

type ModelRemoteUploadEventsResponse struct {
	// Events for the remote upload.
	Data []ModelRemoteUploadEventsResponseData `json:"data" api:"required"`
	// Object type. Always `list`.
	Object constant.List `json:"object" default:"list"`
	// Cursor for the next page. Null if there are no more results.
	NextCursor string `json:"next_cursor"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Object      respjson.Field
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Status and diagnostic events for a remote model import job.

func (ModelRemoteUploadEventsResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ModelRemoteUploadEventsResponse) UnmarshalJSON added in v0.13.0

func (r *ModelRemoteUploadEventsResponse) UnmarshalJSON(data []byte) error

type ModelRemoteUploadEventsResponseData added in v0.13.0

type ModelRemoteUploadEventsResponseData struct {
	// Unique event identifier.
	ID string `json:"id" api:"required"`
	// Time when the event was recorded.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// Severity of the event.
	//
	// Any of "LEVEL_DEBUG", "LEVEL_INFO", "LEVEL_WARN", "LEVEL_ERROR".
	Level string `json:"level" api:"required"`
	// Human-readable progress or diagnostic message.
	Message string `json:"message" api:"required"`
	// Stable event type emitted by the importer, such as `download.started`.
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Level       respjson.Field
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Progress or diagnostic event emitted while importing remote model files.

func (ModelRemoteUploadEventsResponseData) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ModelRemoteUploadEventsResponseData) UnmarshalJSON added in v0.13.0

func (r *ModelRemoteUploadEventsResponseData) UnmarshalJSON(data []byte) error

type ModelRemoteUploadGetParams added in v0.13.0

type ModelRemoteUploadGetParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type ModelRemoteUploadGetResponse added in v0.13.0

type ModelRemoteUploadGetResponse struct {
	// Unique ID of the remote model import job.
	ID string `json:"id" api:"required"`
	// Time when the import job was created.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// ID of the registered model receiving the imported files.
	ModelID string `json:"modelId" api:"required"`
	// ID of the project that owns the import job.
	ProjectID string `json:"projectId" api:"required"`
	// Hugging Face repository or presigned URL being imported.
	RemoteURL string `json:"remoteUrl" api:"required"`
	// Current lifecycle state of the asynchronous import job.
	//
	// Any of "REMOTE_UPLOAD_STATUS_PENDING", "REMOTE_UPLOAD_STATUS_RUNNING",
	// "REMOTE_UPLOAD_STATUS_ERROR", "REMOTE_UPLOAD_STATUS_SUCCEEDED",
	// "REMOTE_UPLOAD_STATUS_FAILED".
	Status ModelRemoteUploadGetResponseStatus `json:"status" api:"required"`
	// Maximum worker restarts allowed before the job fails permanently.
	MaxRestarts int64 `json:"maxRestarts"`
	// Number of times the import worker has restarted this job.
	RestartCount int64 `json:"restartCount"`
	// Human-readable progress or failure detail for the current status.
	StatusMessage string `json:"statusMessage"`
	// Time when the import job was last updated.
	UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		ModelID       respjson.Field
		ProjectID     respjson.Field
		RemoteURL     respjson.Field
		Status        respjson.Field
		MaxRestarts   respjson.Field
		RestartCount  respjson.Field
		StatusMessage respjson.Field
		UpdatedAt     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Asynchronous job that imports remote files into a registered model and creates a model revision.

func (ModelRemoteUploadGetResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ModelRemoteUploadGetResponse) UnmarshalJSON added in v0.13.0

func (r *ModelRemoteUploadGetResponse) UnmarshalJSON(data []byte) error

type ModelRemoteUploadGetResponseStatus added in v0.13.0

type ModelRemoteUploadGetResponseStatus string

Current lifecycle state of the asynchronous import job.

const (
	ModelRemoteUploadGetResponseStatusRemoteUploadStatusPending   ModelRemoteUploadGetResponseStatus = "REMOTE_UPLOAD_STATUS_PENDING"
	ModelRemoteUploadGetResponseStatusRemoteUploadStatusRunning   ModelRemoteUploadGetResponseStatus = "REMOTE_UPLOAD_STATUS_RUNNING"
	ModelRemoteUploadGetResponseStatusRemoteUploadStatusError     ModelRemoteUploadGetResponseStatus = "REMOTE_UPLOAD_STATUS_ERROR"
	ModelRemoteUploadGetResponseStatusRemoteUploadStatusSucceeded ModelRemoteUploadGetResponseStatus = "REMOTE_UPLOAD_STATUS_SUCCEEDED"
	ModelRemoteUploadGetResponseStatusRemoteUploadStatusFailed    ModelRemoteUploadGetResponseStatus = "REMOTE_UPLOAD_STATUS_FAILED"
)

type ModelRemoteUploadListParams added in v0.13.0

type ModelRemoteUploadListParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Cursor from a previous remote upload list response.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of uploads to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ModelRemoteUploadListParams) URLQuery added in v0.13.0

func (r ModelRemoteUploadListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ModelRemoteUploadListParams's query parameters as `url.Values`.

type ModelRemoteUploadListResponse added in v0.13.0

type ModelRemoteUploadListResponse struct {
	// Unique ID of the remote model import job.
	ID string `json:"id" api:"required"`
	// Time when the import job was created.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// ID of the registered model receiving the imported files.
	ModelID string `json:"modelId" api:"required"`
	// ID of the project that owns the import job.
	ProjectID string `json:"projectId" api:"required"`
	// Hugging Face repository or presigned URL being imported.
	RemoteURL string `json:"remoteUrl" api:"required"`
	// Current lifecycle state of the asynchronous import job.
	//
	// Any of "REMOTE_UPLOAD_STATUS_PENDING", "REMOTE_UPLOAD_STATUS_RUNNING",
	// "REMOTE_UPLOAD_STATUS_ERROR", "REMOTE_UPLOAD_STATUS_SUCCEEDED",
	// "REMOTE_UPLOAD_STATUS_FAILED".
	Status ModelRemoteUploadListResponseStatus `json:"status" api:"required"`
	// Maximum worker restarts allowed before the job fails permanently.
	MaxRestarts int64 `json:"maxRestarts"`
	// Number of times the import worker has restarted this job.
	RestartCount int64 `json:"restartCount"`
	// Human-readable progress or failure detail for the current status.
	StatusMessage string `json:"statusMessage"`
	// Time when the import job was last updated.
	UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		ModelID       respjson.Field
		ProjectID     respjson.Field
		RemoteURL     respjson.Field
		Status        respjson.Field
		MaxRestarts   respjson.Field
		RestartCount  respjson.Field
		StatusMessage respjson.Field
		UpdatedAt     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Asynchronous job that imports remote files into a registered model and creates a model revision.

func (ModelRemoteUploadListResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ModelRemoteUploadListResponse) UnmarshalJSON added in v0.13.0

func (r *ModelRemoteUploadListResponse) UnmarshalJSON(data []byte) error

type ModelRemoteUploadListResponseStatus added in v0.13.0

type ModelRemoteUploadListResponseStatus string

Current lifecycle state of the asynchronous import job.

const (
	ModelRemoteUploadListResponseStatusRemoteUploadStatusPending   ModelRemoteUploadListResponseStatus = "REMOTE_UPLOAD_STATUS_PENDING"
	ModelRemoteUploadListResponseStatusRemoteUploadStatusRunning   ModelRemoteUploadListResponseStatus = "REMOTE_UPLOAD_STATUS_RUNNING"
	ModelRemoteUploadListResponseStatusRemoteUploadStatusError     ModelRemoteUploadListResponseStatus = "REMOTE_UPLOAD_STATUS_ERROR"
	ModelRemoteUploadListResponseStatusRemoteUploadStatusSucceeded ModelRemoteUploadListResponseStatus = "REMOTE_UPLOAD_STATUS_SUCCEEDED"
	ModelRemoteUploadListResponseStatusRemoteUploadStatusFailed    ModelRemoteUploadListResponseStatus = "REMOTE_UPLOAD_STATUS_FAILED"
)

type ModelRemoteUploadNewParams added in v0.13.0

type ModelRemoteUploadNewParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// ID of the registered model that will receive the imported files.
	ModelID string `json:"modelId" api:"required"`
	// Hugging Face repository URL or presigned archive URL to import.
	RemoteURL string `json:"remoteUrl" api:"required"`
	// Optional source credential used to access a private remote location. The value
	// is write-only and is not returned.
	Token param.Opt[string] `json:"token,omitzero"`
	// contains filtered or unexported fields
}

func (ModelRemoteUploadNewParams) MarshalJSON added in v0.13.0

func (r ModelRemoteUploadNewParams) MarshalJSON() (data []byte, err error)

func (*ModelRemoteUploadNewParams) UnmarshalJSON added in v0.13.0

func (r *ModelRemoteUploadNewParams) UnmarshalJSON(data []byte) error

type ModelRemoteUploadNewResponse added in v0.13.0

type ModelRemoteUploadNewResponse struct {
	// Unique ID of the remote model import job.
	ID string `json:"id" api:"required"`
	// Time when the import job was created.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// ID of the registered model receiving the imported files.
	ModelID string `json:"modelId" api:"required"`
	// ID of the project that owns the import job.
	ProjectID string `json:"projectId" api:"required"`
	// Hugging Face repository or presigned URL being imported.
	RemoteURL string `json:"remoteUrl" api:"required"`
	// Current lifecycle state of the asynchronous import job.
	//
	// Any of "REMOTE_UPLOAD_STATUS_PENDING", "REMOTE_UPLOAD_STATUS_RUNNING",
	// "REMOTE_UPLOAD_STATUS_ERROR", "REMOTE_UPLOAD_STATUS_SUCCEEDED",
	// "REMOTE_UPLOAD_STATUS_FAILED".
	Status ModelRemoteUploadNewResponseStatus `json:"status" api:"required"`
	// Maximum worker restarts allowed before the job fails permanently.
	MaxRestarts int64 `json:"maxRestarts"`
	// Number of times the import worker has restarted this job.
	RestartCount int64 `json:"restartCount"`
	// Human-readable progress or failure detail for the current status.
	StatusMessage string `json:"statusMessage"`
	// Time when the import job was last updated.
	UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		ModelID       respjson.Field
		ProjectID     respjson.Field
		RemoteURL     respjson.Field
		Status        respjson.Field
		MaxRestarts   respjson.Field
		RestartCount  respjson.Field
		StatusMessage respjson.Field
		UpdatedAt     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Asynchronous job that imports remote files into a registered model and creates a model revision.

func (ModelRemoteUploadNewResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ModelRemoteUploadNewResponse) UnmarshalJSON added in v0.13.0

func (r *ModelRemoteUploadNewResponse) UnmarshalJSON(data []byte) error

type ModelRemoteUploadNewResponseStatus added in v0.13.0

type ModelRemoteUploadNewResponseStatus string

Current lifecycle state of the asynchronous import job.

const (
	ModelRemoteUploadNewResponseStatusRemoteUploadStatusPending   ModelRemoteUploadNewResponseStatus = "REMOTE_UPLOAD_STATUS_PENDING"
	ModelRemoteUploadNewResponseStatusRemoteUploadStatusRunning   ModelRemoteUploadNewResponseStatus = "REMOTE_UPLOAD_STATUS_RUNNING"
	ModelRemoteUploadNewResponseStatusRemoteUploadStatusError     ModelRemoteUploadNewResponseStatus = "REMOTE_UPLOAD_STATUS_ERROR"
	ModelRemoteUploadNewResponseStatusRemoteUploadStatusSucceeded ModelRemoteUploadNewResponseStatus = "REMOTE_UPLOAD_STATUS_SUCCEEDED"
	ModelRemoteUploadNewResponseStatusRemoteUploadStatusFailed    ModelRemoteUploadNewResponseStatus = "REMOTE_UPLOAD_STATUS_FAILED"
)

type ModelRemoteUploadService added in v0.13.0

type ModelRemoteUploadService struct {
	Options []option.RequestOption
}

ModelRemoteUploadService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModelRemoteUploadService method instead.

func NewModelRemoteUploadService added in v0.13.0

func NewModelRemoteUploadService(opts ...option.RequestOption) (r ModelRemoteUploadService)

NewModelRemoteUploadService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ModelRemoteUploadService) Events added in v0.13.0

Lists progress and diagnostic events for a remote model import job.

func (*ModelRemoteUploadService) Get added in v0.13.0

Retrieves the status, progress details, retry counts, and timestamps for a remote model import job.

func (*ModelRemoteUploadService) List added in v0.13.0

Lists asynchronous jobs that import model files from Hugging Face or a presigned remote URL.

func (*ModelRemoteUploadService) ListAutoPaging added in v0.13.0

Lists asynchronous jobs that import model files from Hugging Face or a presigned remote URL.

func (*ModelRemoteUploadService) New added in v0.13.0

Starts an asynchronous job that imports model files from Hugging Face or a presigned URL into a registered model and creates a model revision when the import completes.

type ModelService

type ModelService struct {
	Options       []option.RequestOption
	RemoteUploads ModelRemoteUploadService
	Configs       ModelConfigService
}

ModelService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModelService method instead.

func NewModelService

func NewModelService(opts ...option.RequestOption) (r ModelService)

NewModelService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ModelService) Delete added in v0.13.0

func (r *ModelService) Delete(ctx context.Context, id string, body ModelDeleteParams, opts ...option.RequestOption) (res *ModelDeleteResponse, err error)

Permanently deletes a custom model resource. The model must not be in use by an active deployment.

func (*ModelService) Get added in v0.13.0

func (r *ModelService) Get(ctx context.Context, id string, query ModelGetParams, opts ...option.RequestOption) (res *Model, err error)

Retrieves a custom model's metadata, visibility, weight information, and base-model relationship.

func (*ModelService) GetSupported added in v0.13.0

func (r *ModelService) GetSupported(ctx context.Context, id string, opts ...option.RequestOption) (res *SupportedModel, err error)

Retrieves a Together-hosted base model and the certified model, configuration, hardware, and performance profiles available for deployment.

func (*ModelService) List

Lists custom model resources owned by the specified project. Use the organization endpoint to list models shared across projects or the supported-model catalog to discover Together-hosted base models.

func (*ModelService) ListAutoPaging added in v0.13.0

Lists custom model resources owned by the specified project. Use the organization endpoint to list models shared across projects or the supported-model catalog to discover Together-hosted base models.

func (*ModelService) ListFiles added in v0.13.0

func (r *ModelService) ListFiles(ctx context.Context, id string, params ModelListFilesParams, opts ...option.RequestOption) (res *ModelListFilesResponse, err error)

Lists files in the latest or specified revision of a model, including paths, sizes, and content hashes.

func (*ModelService) ListOrgScoped added in v0.13.0

func (r *ModelService) ListOrgScoped(ctx context.Context, organizationID string, query ModelListOrgScopedParams, opts ...option.RequestOption) (res *pagination.CursorPagination[Model], err error)

Lists custom models shared with every project in the specified organization. Project-private and public models are not included.

func (*ModelService) ListOrgScopedAutoPaging added in v0.13.0

func (r *ModelService) ListOrgScopedAutoPaging(ctx context.Context, organizationID string, query ModelListOrgScopedParams, opts ...option.RequestOption) *pagination.CursorPaginationAutoPager[Model]

Lists custom models shared with every project in the specified organization. Project-private and public models are not included.

func (*ModelService) ListRevisions added in v0.13.0

func (r *ModelService) ListRevisions(ctx context.Context, id string, query ModelListRevisionsParams, opts ...option.RequestOption) (res *ModelListRevisionsResponse, err error)

Lists the immutable file revisions available for a custom model, newest first.

func (*ModelService) ListSupported added in v0.13.0

Lists Together-hosted base models that can be deployed for dedicated inference, together with their capabilities and certified deployment profiles.

func (*ModelService) ListSupportedAutoPaging added in v0.13.0

Lists Together-hosted base models that can be deployed for dedicated inference, together with their capabilities and certified deployment profiles.

func (*ModelService) New added in v0.13.0

func (r *ModelService) New(ctx context.Context, params ModelNewParams, opts ...option.RequestOption) (res *Model, err error)

Registers a custom model resource in the project. Registration creates the model's metadata; upload or import model files separately before deploying it.

func (*ModelService) Update added in v0.13.0

func (r *ModelService) Update(ctx context.Context, id string, params ModelUpdateParams, opts ...option.RequestOption) (res *Model, err error)

Updates mutable model metadata such as its inference name, description, base model, or visibility.

type ModelUpdateParams added in v0.13.0

type ModelUpdateParams struct {
	// Project identifier.
	//
	// Use [option.WithProjectID] on the client to set a global default for this field.
	ProjectID param.Opt[string] `path:"projectId,omitzero" api:"required" json:"-"`
	// Fields to update. If omitted, all mutable fields are overwritten.
	UpdateMask param.Opt[string] `query:"updateMask,omitzero" format:"field-mask" json:"-"`
	// Updated user-facing model description.
	Description param.Opt[string] `json:"description,omitzero"`
	// Updated inference-addressable model name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project;
	// `VISIBILITY_INTERNAL` shares it with the organization.
	//
	// Any of "VISIBILITY_PRIVATE", "VISIBILITY_INTERNAL".
	Visibility ModelUpdateParamsVisibility `json:"visibility,omitzero"`
	// contains filtered or unexported fields
}

func (ModelUpdateParams) MarshalJSON added in v0.13.0

func (r ModelUpdateParams) MarshalJSON() (data []byte, err error)

func (ModelUpdateParams) URLQuery added in v0.13.0

func (r ModelUpdateParams) URLQuery() (v url.Values, err error)

URLQuery serializes ModelUpdateParams's query parameters as `url.Values`.

func (*ModelUpdateParams) UnmarshalJSON added in v0.13.0

func (r *ModelUpdateParams) UnmarshalJSON(data []byte) error

type ModelUpdateParamsVisibility added in v0.13.0

type ModelUpdateParamsVisibility string

Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.

const (
	ModelUpdateParamsVisibilityVisibilityPrivate  ModelUpdateParamsVisibility = "VISIBILITY_PRIVATE"
	ModelUpdateParamsVisibilityVisibilityInternal ModelUpdateParamsVisibility = "VISIBILITY_INTERNAL"
)

type ModelVisibility added in v0.11.0

type ModelVisibility string

Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.

const (
	ModelVisibilityVisibilityPrivate  ModelVisibility = "VISIBILITY_PRIVATE"
	ModelVisibilityVisibilityInternal ModelVisibility = "VISIBILITY_INTERNAL"
)

type ModelWeights added in v0.11.0

type ModelWeights struct {
	// Model architecture detected from the weight metadata.
	Architecture string `json:"architecture"`
	// Maximum context length reported by the model metadata.
	ContextLength string `json:"contextLength"`
	// Draft-model speculator family for draft speculative decoding.
	//
	// Any of "DRAFT_SPECULATOR_TYPE_EAGLE", "DRAFT_SPECULATOR_TYPE_PHOENIX".
	DraftSpeculatorType ModelWeightsDraftSpeculatorType `json:"draftSpeculatorType"`
	// Total parameter count and breakdown by numerical data type.
	Parameters ModelParametersResp `json:"parameters"`
	// Speculative decoding mechanism for speculator weights.
	//
	// Any of "SPECULATOR_MECHANISM_DRAFT", "SPECULATOR_MECHANISM_LOOKAHEAD",
	// "SPECULATOR_MECHANISM_MTP".
	SpeculatorMechanism ModelWeightsSpeculatorMechanism `json:"speculatorMechanism"`
	// Role of the weights: full model, speculative draft model, or LoRA adapter.
	//
	// Any of "WEIGHTS_TYPE_DEFAULT", "WEIGHTS_TYPE_SPECULATOR",
	// "WEIGHTS_TYPE_ADAPTER".
	Type ModelWeightsType `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Architecture        respjson.Field
		ContextLength       respjson.Field
		DraftSpeculatorType respjson.Field
		Parameters          respjson.Field
		SpeculatorMechanism respjson.Field
		Type                respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Architecture, size, precision, and speculative-decoding metadata for model weights.

func (ModelWeights) RawJSON added in v0.11.0

func (r ModelWeights) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelWeights) UnmarshalJSON added in v0.11.0

func (r *ModelWeights) UnmarshalJSON(data []byte) error

type ModelWeightsDraftSpeculatorType added in v0.13.0

type ModelWeightsDraftSpeculatorType string

Draft-model speculator family for draft speculative decoding.

const (
	ModelWeightsDraftSpeculatorTypeDraftSpeculatorTypeEagle   ModelWeightsDraftSpeculatorType = "DRAFT_SPECULATOR_TYPE_EAGLE"
	ModelWeightsDraftSpeculatorTypeDraftSpeculatorTypePhoenix ModelWeightsDraftSpeculatorType = "DRAFT_SPECULATOR_TYPE_PHOENIX"
)

type ModelWeightsSpeculatorMechanism added in v0.13.0

type ModelWeightsSpeculatorMechanism string

Speculative decoding mechanism for speculator weights.

const (
	ModelWeightsSpeculatorMechanismSpeculatorMechanismDraft     ModelWeightsSpeculatorMechanism = "SPECULATOR_MECHANISM_DRAFT"
	ModelWeightsSpeculatorMechanismSpeculatorMechanismLookahead ModelWeightsSpeculatorMechanism = "SPECULATOR_MECHANISM_LOOKAHEAD"
	ModelWeightsSpeculatorMechanismSpeculatorMechanismMtp       ModelWeightsSpeculatorMechanism = "SPECULATOR_MECHANISM_MTP"
)

type ModelWeightsType added in v0.13.0

type ModelWeightsType string

Role of the weights: full model, speculative draft model, or LoRA adapter.

const (
	ModelWeightsTypeWeightsTypeDefault    ModelWeightsType = "WEIGHTS_TYPE_DEFAULT"
	ModelWeightsTypeWeightsTypeSpeculator ModelWeightsType = "WEIGHTS_TYPE_SPECULATOR"
	ModelWeightsTypeWeightsTypeAdapter    ModelWeightsType = "WEIGHTS_TYPE_ADAPTER"
)

type OrganizationService added in v0.13.0

type OrganizationService struct {
	Options []option.RequestOption
	Usage   OrganizationUsageService
}

OrganizationService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOrganizationService method instead.

func NewOrganizationService added in v0.13.0

func NewOrganizationService(opts ...option.RequestOption) (r OrganizationService)

NewOrganizationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type OrganizationUsageCostListParams added in v0.13.0

type OrganizationUsageCostListParams struct {
	// Opaque cursor from a previous response's `next_cursor`. Only valid for the month
	// and granularity it was issued for. Current-month data is a moving snapshot: each
	// page reflects data as of its request, so newly completed windows may appear at
	// the end of the sequence.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of time windows per page (max 1000).
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Billing month in YYYY-MM format. Defaults to the current month, which returns
	// data through yesterday (daily) or the last completed hour (hourly).
	Month param.Opt[string] `query:"month,omitzero" json:"-"`
	// Organization to report on. Usage is always reported for the organization that
	// owns the API key, so this is optional; supplying an ID that is not that
	// organization returns 403.
	OrganizationID param.Opt[string] `query:"organization_id,omitzero" json:"-"`
	// Time window size for rows. 'hour' returns ~24x more rows than 'day'.
	//
	// Any of "day", "hour".
	Granularity OrganizationUsageCostListParamsGranularity `query:"granularity,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (OrganizationUsageCostListParams) URLQuery added in v0.13.0

func (r OrganizationUsageCostListParams) URLQuery() (v url.Values, err error)

URLQuery serializes OrganizationUsageCostListParams's query parameters as `url.Values`.

type OrganizationUsageCostListParamsGranularity added in v0.13.0

type OrganizationUsageCostListParamsGranularity string

Time window size for rows. 'hour' returns ~24x more rows than 'day'.

const (
	OrganizationUsageCostListParamsGranularityDay  OrganizationUsageCostListParamsGranularity = "day"
	OrganizationUsageCostListParamsGranularityHour OrganizationUsageCostListParamsGranularity = "hour"
)

type OrganizationUsageCostService added in v0.13.0

type OrganizationUsageCostService struct {
	Options []option.RequestOption
}

OrganizationUsageCostService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOrganizationUsageCostService method instead.

func NewOrganizationUsageCostService added in v0.13.0

func NewOrganizationUsageCostService(opts ...option.RequestOption) (r OrganizationUsageCostService)

NewOrganizationUsageCostService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*OrganizationUsageCostService) List added in v0.13.0

Returns an organization's billing usage for a month as cost-annotated line items grouped into time windows. Finalized windows are returned through the end of yesterday at daily granularity, or the last completed hour at hourly granularity (UTC).

func (*OrganizationUsageCostService) ListAutoPaging added in v0.13.0

Returns an organization's billing usage for a month as cost-annotated line items grouped into time windows. Finalized windows are returned through the end of yesterday at daily granularity, or the last completed hour at hourly granularity (UTC).

type OrganizationUsageService added in v0.13.0

type OrganizationUsageService struct {
	Options []option.RequestOption
	Costs   OrganizationUsageCostService
}

OrganizationUsageService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOrganizationUsageService method instead.

func NewOrganizationUsageService added in v0.13.0

func NewOrganizationUsageService(opts ...option.RequestOption) (r OrganizationUsageService)

NewOrganizationUsageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type PauseInfo added in v0.13.0

type PauseInfo struct {
	// Timestamp when the rollout was paused.
	PausedAt time.Time `json:"pausedAt" api:"required" format:"date-time"`
	// Human-readable reason recorded when the rollout was paused.
	Reason string `json:"reason"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PausedAt    respjson.Field
		Reason      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pause metadata returned while a rollout is paused.

func (PauseInfo) RawJSON added in v0.13.0

func (r PauseInfo) RawJSON() string

Returns the unmodified JSON received from the API

func (*PauseInfo) UnmarshalJSON added in v0.13.0

func (r *PauseInfo) UnmarshalJSON(data []byte) error

type PlacementProfile added in v0.11.0

type PlacementProfile struct {
	// Unique placement profile identifier.
	ID string `json:"id" api:"required"`
	// Human-readable placement profile name.
	Name string `json:"name" api:"required"`
	// Organization that owns the placement profile.
	OrganizationID string `json:"organizationId" api:"required"`
	// Preferred deployment regions in descending priority order.
	PreferredRegions []string `json:"preferredRegions" api:"required"`
	// Project that owns the placement profile.
	ProjectID string `json:"projectId" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		Name             respjson.Field
		OrganizationID   respjson.Field
		PreferredRegions respjson.Field
		ProjectID        respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Reusable ordered region preferences for scheduling a project's deployments.

func (PlacementProfile) RawJSON added in v0.11.0

func (r PlacementProfile) RawJSON() string

Returns the unmodified JSON received from the API

func (*PlacementProfile) UnmarshalJSON added in v0.11.0

func (r *PlacementProfile) UnmarshalJSON(data []byte) error

type Project added in v0.13.0

type Project struct {
	// Unique project identifier.
	ID string `json:"id" api:"required"`
	// Display name of the project.
	Name string `json:"name" api:"required"`
	// ID of the organization that owns the project.
	OrganizationID string `json:"organization_id" api:"required"`
	// Display name of the organization that owns the project.
	OrganizationName string `json:"organization_name" api:"required"`
	// Customer-facing project slug.
	Slug string `json:"slug" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		Name             respjson.Field
		OrganizationID   respjson.Field
		OrganizationName respjson.Field
		Slug             respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A project the authenticated caller can access.

func (Project) RawJSON added in v0.13.0

func (r Project) RawJSON() string

Returns the unmodified JSON received from the API

func (*Project) UnmarshalJSON added in v0.13.0

func (r *Project) UnmarshalJSON(data []byte) error

type ProjectListParams added in v0.13.0

type ProjectListParams struct {
	// Paginate the response utilizing a responses next_cursor field.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// Maximum number of user projects in the page.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ProjectListParams) URLQuery added in v0.13.0

func (r ProjectListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ProjectListParams's query parameters as `url.Values`.

type ProjectService added in v0.13.0

type ProjectService struct {
	Options []option.RequestOption
}

ProjectService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProjectService method instead.

func NewProjectService added in v0.13.0

func NewProjectService(opts ...option.RequestOption) (r ProjectService)

NewProjectService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProjectService) List added in v0.13.0

Retrieve a list of accessible projects.

func (*ProjectService) ListAutoPaging added in v0.13.0

Retrieve a list of accessible projects.

type RegressionCheck added in v0.13.0

type RegressionCheck struct {
	// Required direction that indicates whether higher or lower metric values are
	// worse.
	//
	// Any of "REGRESSION_DIRECTION_HIGHER_IS_WORSE",
	// "REGRESSION_DIRECTION_LOWER_IS_WORSE".
	Direction RegressionCheckDirection `json:"direction" api:"required"`
	// Finite maximum allowed regression percentage, greater than or equal to 0.
	// Omitting this value is read as 0. A value of 0 is the strictest budget; any
	// regression fails, and exactly-at-budget passes.
	MaxRegressionPercent float64 `json:"maxRegressionPercent"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Direction            respjson.Field
		MaxRegressionPercent respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Regression criteria that fail when the target regresses against the source beyond a limit.

func (RegressionCheck) RawJSON added in v0.13.0

func (r RegressionCheck) RawJSON() string

Returns the unmodified JSON received from the API

func (RegressionCheck) ToParam added in v0.13.0

ToParam converts this RegressionCheck to a RegressionCheckParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with RegressionCheckParam.Overrides()

func (*RegressionCheck) UnmarshalJSON added in v0.13.0

func (r *RegressionCheck) UnmarshalJSON(data []byte) error

type RegressionCheckDirection added in v0.13.0

type RegressionCheckDirection string

Required direction that indicates whether higher or lower metric values are worse.

const (
	RegressionCheckDirectionRegressionDirectionHigherIsWorse RegressionCheckDirection = "REGRESSION_DIRECTION_HIGHER_IS_WORSE"
	RegressionCheckDirectionRegressionDirectionLowerIsWorse  RegressionCheckDirection = "REGRESSION_DIRECTION_LOWER_IS_WORSE"
)

type RegressionCheckParam added in v0.13.0

type RegressionCheckParam struct {
	// Required direction that indicates whether higher or lower metric values are
	// worse.
	//
	// Any of "REGRESSION_DIRECTION_HIGHER_IS_WORSE",
	// "REGRESSION_DIRECTION_LOWER_IS_WORSE".
	Direction RegressionCheckDirection `json:"direction,omitzero" api:"required"`
	// Finite maximum allowed regression percentage, greater than or equal to 0.
	// Omitting this value is read as 0. A value of 0 is the strictest budget; any
	// regression fails, and exactly-at-budget passes.
	MaxRegressionPercent param.Opt[float64] `json:"maxRegressionPercent,omitzero"`
	// contains filtered or unexported fields
}

Regression criteria that fail when the target regresses against the source beyond a limit.

The property Direction is required.

func (RegressionCheckParam) MarshalJSON added in v0.13.0

func (r RegressionCheckParam) MarshalJSON() (data []byte, err error)

func (*RegressionCheckParam) UnmarshalJSON added in v0.13.0

func (r *RegressionCheckParam) UnmarshalJSON(data []byte) error

type Remediation added in v0.10.0

type Remediation struct {
	ID         string `json:"id" api:"required"`
	ClusterID  string `json:"cluster_id" api:"required"`
	InstanceID string `json:"instance_id" api:"required"`
	// Remediation mode specifies how the remediation should be performed.
	//
	// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any
	//   available host.
	// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and
	//   provisions a new one on a different host.
	// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without
	//   provisioning a replacement.
	// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
	// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal
	//   host while preserving host and node identity.
	//
	// Any of "REMEDIATION_MODE_VM_ONLY", "REMEDIATION_MODE_HOST_AWARE",
	// "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", "REMEDIATION_MODE_REBOOT_VM",
	// "REMEDIATION_MODE_HOST_POWER_CYCLE".
	Mode RemediationMode `json:"mode" api:"required"`
	// RemediationState represents the lifecycle state of a remediation.
	//
	// - `PENDING_APPROVAL`: Awaiting approval before processing can begin.
	// - `PENDING`: Approved and queued for processing.
	// - `RUNNING`: Actively being processed.
	// - `SUCCEEDED`: Successfully completed.
	// - `FAILED`: Failed with an error.
	// - `CANCELLED`: Cancelled by user or system.
	// - `AUTO_RESOLVED`: The underlying issue was automatically resolved before
	//   processing.
	// - `QUARANTINING`: Cordoning or preparing the host before remediation.
	// - `QUARANTINED`: Host has been cordoned or isolated for remediation.
	//
	// Any of "PENDING_APPROVAL", "PENDING", "RUNNING", "SUCCEEDED", "FAILED",
	// "CANCELLED", "AUTO_RESOLVED", "QUARANTINING", "QUARANTINED".
	State RemediationState `json:"state" api:"required"`
	// RemediationTrigger specifies how the remediation was triggered.
	//
	// - `REMEDIATION_TRIGGER_MANUAL`: A user-initiated remediation (either via web UI
	//   or API call).
	// - `REMEDIATION_TRIGGER_AUTOMATED`: A system-initiated remediation that requires
	//   approval.
	//
	// Any of "REMEDIATION_TRIGGER_MANUAL", "REMEDIATION_TRIGGER_AUTOMATED".
	Trigger RemediationTrigger `json:"trigger" api:"required"`
	// Active health check run ID (UUID) that triggered this remediation.
	ActiveHealthCheckRunID string `json:"active_health_check_run_id"`
	// When the remediation was created.
	CreateTime time.Time `json:"create_time" format:"date-time"`
	// When the remediation completed.
	EndTime time.Time `json:"end_time" format:"date-time"`
	// Error message if the remediation failed.
	ErrorMessage string `json:"error_message"`
	// Display name of the targeted instance.
	InstanceName string `json:"instance_name"`
	// Passive health check alerts linked to this remediation, including resolved
	// alerts.
	LinkedAlerts []RemediationLinkedAlert `json:"linked_alerts"`
	// Passive health check event ID that triggered this remediation.
	PassiveHealthCheckEventID string `json:"passive_health_check_event_id"`
	// User-provided reason for the remediation.
	Reason string `json:"reason"`
	// Who requested the remediation.
	RequestedBy string `json:"requested_by"`
	// Review comment.
	ReviewComment string `json:"review_comment"`
	// When the remediation was reviewed.
	ReviewTime time.Time `json:"review_time" format:"date-time"`
	// Who reviewed the remediation.
	ReviewedBy string `json:"reviewed_by"`
	// When processing started.
	StartTime time.Time `json:"start_time" format:"date-time"`
	// When the remediation was last updated.
	UpdateTime time.Time `json:"update_time" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                        respjson.Field
		ClusterID                 respjson.Field
		InstanceID                respjson.Field
		Mode                      respjson.Field
		State                     respjson.Field
		Trigger                   respjson.Field
		ActiveHealthCheckRunID    respjson.Field
		CreateTime                respjson.Field
		EndTime                   respjson.Field
		ErrorMessage              respjson.Field
		InstanceName              respjson.Field
		LinkedAlerts              respjson.Field
		PassiveHealthCheckEventID respjson.Field
		Reason                    respjson.Field
		RequestedBy               respjson.Field
		ReviewComment             respjson.Field
		ReviewTime                respjson.Field
		ReviewedBy                respjson.Field
		StartTime                 respjson.Field
		UpdateTime                respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Remediation represents a node remediation request for an instance. An instance can have multiple remediations over time (e.g., failed attempts followed by retries).

func (Remediation) RawJSON added in v0.10.0

func (r Remediation) RawJSON() string

Returns the unmodified JSON received from the API

func (Remediation) ToParam added in v0.10.0

func (r Remediation) ToParam() RemediationParam

ToParam converts this Remediation to a RemediationParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with RemediationParam.Overrides()

func (*Remediation) UnmarshalJSON added in v0.10.0

func (r *Remediation) UnmarshalJSON(data []byte) error

type RemediationLinkedAlert added in v0.11.0

type RemediationLinkedAlert struct {
	// Alertmanager alert name.
	AlertName string `json:"alert_name" api:"required"`
	// Typed content parsed from passive health check alert annotations.
	Annotation RemediationLinkedAlertAnnotation `json:"annotation" api:"required"`
	// Legacy Alertmanager annotations as key-value strings.
	Annotations map[string]string `json:"annotations" api:"required"`
	// Cluster UUID the alert was raised against.
	ClusterID string `json:"cluster_id" api:"required"`
	// Primary key UUID for the passive health check alert.
	PassiveHealthCheckAlertID string `json:"passive_health_check_alert_id" api:"required"`
	// Canonical severity tier for the alert.
	//
	// Any of "PHC_SEVERITY_INFO", "PHC_SEVERITY_WARNING", "PHC_SEVERITY_CRITICAL".
	Severity string `json:"severity" api:"required"`
	// Time when the underlying alert first fired.
	StartedAt time.Time `json:"started_at" api:"required" format:"date-time"`
	// VM name extracted from the Alertmanager labels.
	TargetVm string `json:"target_vm" api:"required"`
	// Resolved instance UUID. Empty until the alert is joined to an instance.
	InstanceID string `json:"instance_id"`
	// Remediation intent UUID attached to this alert, if any.
	NodeRemediationIntentID string `json:"node_remediation_intent_id"`
	// Time when the underlying alert resolved. Empty while the alert is firing.
	ResolvedAt time.Time `json:"resolved_at" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AlertName                 respjson.Field
		Annotation                respjson.Field
		Annotations               respjson.Field
		ClusterID                 respjson.Field
		PassiveHealthCheckAlertID respjson.Field
		Severity                  respjson.Field
		StartedAt                 respjson.Field
		TargetVm                  respjson.Field
		InstanceID                respjson.Field
		NodeRemediationIntentID   respjson.Field
		ResolvedAt                respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Passive health check alert returned by the health check API.

func (RemediationLinkedAlert) RawJSON added in v0.11.0

func (r RemediationLinkedAlert) RawJSON() string

Returns the unmodified JSON received from the API

func (*RemediationLinkedAlert) UnmarshalJSON added in v0.11.0

func (r *RemediationLinkedAlert) UnmarshalJSON(data []byte) error

type RemediationLinkedAlertAnnotation added in v0.13.0

type RemediationLinkedAlertAnnotation struct {
	// Static explanation for the alert.
	Description string `json:"description" api:"required"`
	// Per-firing summary line parsed from the evidence annotation.
	SummaryLine string `json:"summary_line" api:"required"`
	// Alert title from the Alertmanager summary annotation.
	Title string `json:"title" api:"required"`
	// Details for a Slurm node unavailable passive health check alert.
	SlurmNodeUnavailable RemediationLinkedAlertAnnotationSlurmNodeUnavailable `json:"slurm_node_unavailable"`
	// Details for a DmesgXidError passive health check alert.
	Xid RemediationLinkedAlertAnnotationXid `json:"xid"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Description          respjson.Field
		SummaryLine          respjson.Field
		Title                respjson.Field
		SlurmNodeUnavailable respjson.Field
		Xid                  respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Typed content parsed from passive health check alert annotations.

func (RemediationLinkedAlertAnnotation) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*RemediationLinkedAlertAnnotation) UnmarshalJSON added in v0.13.0

func (r *RemediationLinkedAlertAnnotation) UnmarshalJSON(data []byte) error

type RemediationLinkedAlertAnnotationParam added in v0.13.0

type RemediationLinkedAlertAnnotationParam struct {
	// Details for a Slurm node unavailable passive health check alert.
	SlurmNodeUnavailable RemediationLinkedAlertAnnotationSlurmNodeUnavailableParam `json:"slurm_node_unavailable,omitzero"`
	// Details for a DmesgXidError passive health check alert.
	Xid RemediationLinkedAlertAnnotationXidParam `json:"xid,omitzero"`
	// contains filtered or unexported fields
}

Typed content parsed from passive health check alert annotations.

The properties Description, SummaryLine, Title are required.

func (RemediationLinkedAlertAnnotationParam) MarshalJSON added in v0.13.0

func (r RemediationLinkedAlertAnnotationParam) MarshalJSON() (data []byte, err error)

func (*RemediationLinkedAlertAnnotationParam) UnmarshalJSON added in v0.13.0

func (r *RemediationLinkedAlertAnnotationParam) UnmarshalJSON(data []byte) error

type RemediationLinkedAlertAnnotationSlurmNodeUnavailable added in v0.13.0

type RemediationLinkedAlertAnnotationSlurmNodeUnavailable struct {
	// Drain reason reported for the unavailable Slurm node.
	Reason string `json:"reason" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Reason      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Details for a Slurm node unavailable passive health check alert.

func (RemediationLinkedAlertAnnotationSlurmNodeUnavailable) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*RemediationLinkedAlertAnnotationSlurmNodeUnavailable) UnmarshalJSON added in v0.13.0

type RemediationLinkedAlertAnnotationSlurmNodeUnavailableParam added in v0.13.0

type RemediationLinkedAlertAnnotationSlurmNodeUnavailableParam struct {
	// contains filtered or unexported fields
}

Details for a Slurm node unavailable passive health check alert.

The property Reason is required.

func (RemediationLinkedAlertAnnotationSlurmNodeUnavailableParam) MarshalJSON added in v0.13.0

func (*RemediationLinkedAlertAnnotationSlurmNodeUnavailableParam) UnmarshalJSON added in v0.13.0

type RemediationLinkedAlertAnnotationXid added in v0.13.0

type RemediationLinkedAlertAnnotationXid struct {
	// Xid events observed during the alert window.
	Events []RemediationLinkedAlertAnnotationXidEvent `json:"events" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Events      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Details for a DmesgXidError passive health check alert.

func (RemediationLinkedAlertAnnotationXid) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*RemediationLinkedAlertAnnotationXid) UnmarshalJSON added in v0.13.0

func (r *RemediationLinkedAlertAnnotationXid) UnmarshalJSON(data []byte) error

type RemediationLinkedAlertAnnotationXidEvent added in v0.13.0

type RemediationLinkedAlertAnnotationXidEvent struct {
	// Number of times this Xid code appeared in the alert window.
	Count int64 `json:"count" api:"required"`
	// Driver mnemonic for the Xid code when metadata is available.
	Mnemonic string `json:"mnemonic" api:"required"`
	// NVIDIA Xid code, such as `79`.
	XidCode string `json:"xid_code" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Mnemonic    respjson.Field
		XidCode     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One NVIDIA Xid code observed during the alert window.

func (RemediationLinkedAlertAnnotationXidEvent) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*RemediationLinkedAlertAnnotationXidEvent) UnmarshalJSON added in v0.13.0

func (r *RemediationLinkedAlertAnnotationXidEvent) UnmarshalJSON(data []byte) error

type RemediationLinkedAlertAnnotationXidEventParam added in v0.13.0

type RemediationLinkedAlertAnnotationXidEventParam struct {
	// contains filtered or unexported fields
}

One NVIDIA Xid code observed during the alert window.

The properties Count, Mnemonic, XidCode are required.

func (RemediationLinkedAlertAnnotationXidEventParam) MarshalJSON added in v0.13.0

func (r RemediationLinkedAlertAnnotationXidEventParam) MarshalJSON() (data []byte, err error)

func (*RemediationLinkedAlertAnnotationXidEventParam) UnmarshalJSON added in v0.13.0

func (r *RemediationLinkedAlertAnnotationXidEventParam) UnmarshalJSON(data []byte) error

type RemediationLinkedAlertAnnotationXidParam added in v0.13.0

type RemediationLinkedAlertAnnotationXidParam struct {
	// contains filtered or unexported fields
}

Details for a DmesgXidError passive health check alert.

The property Events is required.

func (RemediationLinkedAlertAnnotationXidParam) MarshalJSON added in v0.13.0

func (r RemediationLinkedAlertAnnotationXidParam) MarshalJSON() (data []byte, err error)

func (*RemediationLinkedAlertAnnotationXidParam) UnmarshalJSON added in v0.13.0

func (r *RemediationLinkedAlertAnnotationXidParam) UnmarshalJSON(data []byte) error

type RemediationLinkedAlertParam added in v0.11.0

type RemediationLinkedAlertParam struct {
	// contains filtered or unexported fields
}

Passive health check alert returned by the health check API.

The properties AlertName, Annotation, Annotations, ClusterID, PassiveHealthCheckAlertID, Severity, StartedAt, TargetVm are required.

func (RemediationLinkedAlertParam) MarshalJSON added in v0.11.0

func (r RemediationLinkedAlertParam) MarshalJSON() (data []byte, err error)

func (*RemediationLinkedAlertParam) UnmarshalJSON added in v0.11.0

func (r *RemediationLinkedAlertParam) UnmarshalJSON(data []byte) error

type RemediationMode added in v0.10.0

type RemediationMode string

Remediation mode specifies how the remediation should be performed.

  • `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
  • `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
  • `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
  • `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
  • `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal host while preserving host and node identity.
const (
	RemediationModeRemediationModeVmOnly                  RemediationMode = "REMEDIATION_MODE_VM_ONLY"
	RemediationModeRemediationModeHostAware               RemediationMode = "REMEDIATION_MODE_HOST_AWARE"
	RemediationModeRemediationModeEvictWithoutReplacement RemediationMode = "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT"
	RemediationModeRemediationModeRebootVm                RemediationMode = "REMEDIATION_MODE_REBOOT_VM"
	RemediationModeRemediationModeHostPowerCycle          RemediationMode = "REMEDIATION_MODE_HOST_POWER_CYCLE"
)

type RemediationParam added in v0.10.0

type RemediationParam struct {
	// Remediation mode specifies how the remediation should be performed.
	//
	// - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any
	//   available host.
	// - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and
	//   provisions a new one on a different host.
	// - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without
	//   provisioning a replacement.
	// - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
	// - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal
	//   host while preserving host and node identity.
	//
	// Any of "REMEDIATION_MODE_VM_ONLY", "REMEDIATION_MODE_HOST_AWARE",
	// "REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT", "REMEDIATION_MODE_REBOOT_VM",
	// "REMEDIATION_MODE_HOST_POWER_CYCLE".
	Mode RemediationMode `json:"mode,omitzero" api:"required"`
	// User-provided reason for the remediation.
	Reason param.Opt[string] `json:"reason,omitzero"`
	// contains filtered or unexported fields
}

Remediation represents a node remediation request for an instance. An instance can have multiple remediations over time (e.g., failed attempts followed by retries).

The properties ID, ClusterID, InstanceID, Mode, State, Trigger are required.

func (RemediationParam) MarshalJSON added in v0.10.0

func (r RemediationParam) MarshalJSON() (data []byte, err error)

func (*RemediationParam) UnmarshalJSON added in v0.10.0

func (r *RemediationParam) UnmarshalJSON(data []byte) error

type RemediationState added in v0.10.0

type RemediationState string

RemediationState represents the lifecycle state of a remediation.

  • `PENDING_APPROVAL`: Awaiting approval before processing can begin.
  • `PENDING`: Approved and queued for processing.
  • `RUNNING`: Actively being processed.
  • `SUCCEEDED`: Successfully completed.
  • `FAILED`: Failed with an error.
  • `CANCELLED`: Cancelled by user or system.
  • `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing.
  • `QUARANTINING`: Cordoning or preparing the host before remediation.
  • `QUARANTINED`: Host has been cordoned or isolated for remediation.
const (
	RemediationStatePendingApproval RemediationState = "PENDING_APPROVAL"
	RemediationStatePending         RemediationState = "PENDING"
	RemediationStateRunning         RemediationState = "RUNNING"
	RemediationStateSucceeded       RemediationState = "SUCCEEDED"
	RemediationStateFailed          RemediationState = "FAILED"
	RemediationStateCancelled       RemediationState = "CANCELLED"
	RemediationStateAutoResolved    RemediationState = "AUTO_RESOLVED"
	RemediationStateQuarantining    RemediationState = "QUARANTINING"
	RemediationStateQuarantined     RemediationState = "QUARANTINED"
)

type RemediationTrigger added in v0.10.0

type RemediationTrigger string

RemediationTrigger specifies how the remediation was triggered.

  • `REMEDIATION_TRIGGER_MANUAL`: A user-initiated remediation (either via web UI or API call).
  • `REMEDIATION_TRIGGER_AUTOMATED`: A system-initiated remediation that requires approval.
const (
	RemediationTriggerRemediationTriggerManual    RemediationTrigger = "REMEDIATION_TRIGGER_MANUAL"
	RemediationTriggerRemediationTriggerAutomated RemediationTrigger = "REMEDIATION_TRIGGER_AUTOMATED"
)

type RequestMetrics added in v0.13.0

type RequestMetrics struct {
	// Requests that failed during the time range.
	FailedRequests string `json:"failedRequests"`
	// Request counts keyed by HTTP status code.
	RequestsByStatusCode map[string]string `json:"requestsByStatusCode"`
	// Average requests per second over the time range.
	RequestsPerSecond float64 `json:"requestsPerSecond"`
	// Requests completed successfully during the time range.
	SuccessfulRequests string `json:"successfulRequests"`
	// Total requests received during the time range.
	TotalRequests string `json:"totalRequests"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FailedRequests       respjson.Field
		RequestsByStatusCode respjson.Field
		RequestsPerSecond    respjson.Field
		SuccessfulRequests   respjson.Field
		TotalRequests        respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Request counts, rate, and status-code distribution over a time range.

func (RequestMetrics) RawJSON added in v0.13.0

func (r RequestMetrics) RawJSON() string

Returns the unmodified JSON received from the API

func (*RequestMetrics) UnmarshalJSON added in v0.13.0

func (r *RequestMetrics) UnmarshalJSON(data []byte) error

type RerankNewParams

type RerankNewParams struct {
	// List of documents, which can be either strings or objects.
	Documents RerankNewParamsDocumentsUnion `json:"documents,omitzero" api:"required"`
	// The model to be used for the rerank request.
	//
	// [See all of Together AI's rerank models](https://docs.together.ai/docs/serverless-models#rerank-models)
	Model RerankNewParamsModel `json:"model,omitzero" api:"required"`
	// The search query to be used for ranking.
	Query string `json:"query" api:"required"`
	// Whether to return supplied documents with the response.
	ReturnDocuments param.Opt[bool] `json:"return_documents,omitzero"`
	// The number of top results to return.
	TopN param.Opt[int64] `json:"top_n,omitzero"`
	// List of keys in the JSON Object document to rank by. Defaults to use all
	// supplied keys for ranking.
	RankFields []string `json:"rank_fields,omitzero"`
	// contains filtered or unexported fields
}

func (RerankNewParams) MarshalJSON

func (r RerankNewParams) MarshalJSON() (data []byte, err error)

func (*RerankNewParams) UnmarshalJSON

func (r *RerankNewParams) UnmarshalJSON(data []byte) error

type RerankNewParamsDocumentsUnion

type RerankNewParamsDocumentsUnion struct {
	OfMapOfAnyMap []map[string]any `json:",omitzero,inline"`
	OfStringArray []string         `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (RerankNewParamsDocumentsUnion) MarshalJSON

func (u RerankNewParamsDocumentsUnion) MarshalJSON() ([]byte, error)

func (*RerankNewParamsDocumentsUnion) UnmarshalJSON

func (u *RerankNewParamsDocumentsUnion) UnmarshalJSON(data []byte) error

type RerankNewParamsModel

type RerankNewParamsModel string

The model to be used for the rerank request.

[See all of Together AI's rerank models](https://docs.together.ai/docs/serverless-models#rerank-models)

const (
	RerankNewParamsModelSalesforceLlamaRankV1 RerankNewParamsModel = "Salesforce/Llama-Rank-v1"
)

type RerankNewResponse

type RerankNewResponse struct {
	// The model to be used for the rerank request.
	Model string `json:"model" api:"required"`
	// The object type, which is always `rerank`.
	Object  constant.Rerank           `json:"object" default:"rerank"`
	Results []RerankNewResponseResult `json:"results" api:"required"`
	// Request ID
	ID    string              `json:"id"`
	Usage ChatCompletionUsage `json:"usage" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Model       respjson.Field
		Object      respjson.Field
		Results     respjson.Field
		ID          respjson.Field
		Usage       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RerankNewResponse) RawJSON

func (r RerankNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*RerankNewResponse) UnmarshalJSON

func (r *RerankNewResponse) UnmarshalJSON(data []byte) error

type RerankNewResponseResult

type RerankNewResponseResult struct {
	Document       RerankNewResponseResultDocument `json:"document" api:"required"`
	Index          int64                           `json:"index" api:"required"`
	RelevanceScore float64                         `json:"relevance_score" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Document       respjson.Field
		Index          respjson.Field
		RelevanceScore respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RerankNewResponseResult) RawJSON

func (r RerankNewResponseResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*RerankNewResponseResult) UnmarshalJSON

func (r *RerankNewResponseResult) UnmarshalJSON(data []byte) error

type RerankNewResponseResultDocument

type RerankNewResponseResultDocument struct {
	Text string `json:"text" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RerankNewResponseResultDocument) RawJSON

Returns the unmodified JSON received from the API

func (*RerankNewResponseResultDocument) UnmarshalJSON

func (r *RerankNewResponseResultDocument) UnmarshalJSON(data []byte) error

type RerankService

type RerankService struct {
	Options []option.RequestOption
}

RerankService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRerankService method instead.

func NewRerankService

func NewRerankService(opts ...option.RequestOption) (r RerankService)

NewRerankService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RerankService) New

Rerank a list of documents by relevance to a query. Returns a relevance score and ordering index for each document.

type ResourceUtilization added in v0.13.0

type ResourceUtilization struct {
	// Average CPU utilization across replicas, as a percentage.
	CPUUtilization float64 `json:"cpuUtilization"`
	// Average GPU memory utilization across replicas, as a percentage.
	GPUMemoryUtilization float64 `json:"gpuMemoryUtilization"`
	// Average GPU compute utilization across replicas, as a percentage.
	GPUUtilization float64 `json:"gpuUtilization"`
	// Average system memory utilization across replicas, as a percentage.
	MemoryUtilization float64 `json:"memoryUtilization"`
	// Average network throughput across replicas, in megabits per second.
	NetworkBandwidthMbps float64 `json:"networkBandwidthMbps"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CPUUtilization       respjson.Field
		GPUMemoryUtilization respjson.Field
		GPUUtilization       respjson.Field
		MemoryUtilization    respjson.Field
		NetworkBandwidthMbps respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Average compute, memory, and network utilization for replicas over a time range.

func (ResourceUtilization) RawJSON added in v0.13.0

func (r ResourceUtilization) RawJSON() string

Returns the unmodified JSON received from the API

func (*ResourceUtilization) UnmarshalJSON added in v0.13.0

func (r *ResourceUtilization) UnmarshalJSON(data []byte) error

type RollingConfig added in v0.13.0

type RollingConfig struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Rolling strategy configuration for small batches that ramp target replicas up while shrinking source replicas to what their remaining traffic share needs.

func (RollingConfig) RawJSON added in v0.13.0

func (r RollingConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (RollingConfig) ToParam added in v0.13.0

func (r RollingConfig) ToParam() RollingConfigParam

ToParam converts this RollingConfig to a RollingConfigParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with RollingConfigParam.Overrides()

func (*RollingConfig) UnmarshalJSON added in v0.13.0

func (r *RollingConfig) UnmarshalJSON(data []byte) error

type RollingConfigParam added in v0.13.0

type RollingConfigParam struct {
	// contains filtered or unexported fields
}

Rolling strategy configuration for small batches that ramp target replicas up while shrinking source replicas to what their remaining traffic share needs.

func (RollingConfigParam) MarshalJSON added in v0.13.0

func (r RollingConfigParam) MarshalJSON() (data []byte, err error)

func (*RollingConfigParam) UnmarshalJSON added in v0.13.0

func (r *RollingConfigParam) UnmarshalJSON(data []byte) error

type Rollout added in v0.13.0

type Rollout struct {
	// Output only. Unique rollout identifier.
	ID string `json:"id" api:"required"`
	// Output only. Timestamp when the rollout was created.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// Output only. Endpoint this rollout belongs to.
	EndpointID string `json:"endpointId" api:"required"`
	// Output only. Deployment that traffic is shifting away from.
	SourceDeploymentID string `json:"sourceDeploymentId" api:"required"`
	// Output only. High-level rollout lifecycle state.
	//
	// Any of "ROLLOUT_STATE_RUNNING", "ROLLOUT_STATE_PAUSED",
	// "ROLLOUT_STATE_STABILIZING", "ROLLOUT_STATE_COMPLETED", "ROLLOUT_STATE_PENDING",
	// "ROLLOUT_STATE_SYSTEM_PAUSED", "ROLLOUT_STATE_CANCELLING",
	// "ROLLOUT_STATE_CANCELED", "ROLLOUT_STATE_PAUSING".
	State RolloutState `json:"state" api:"required"`
	// Derived runtime progress for a rollout.
	Status RolloutStatus `json:"status" api:"required"`
	// Output only. Rollout strategy selected at creation.
	//
	// Any of "ROLLOUT_STRATEGY_TYPE_ROLLING", "ROLLOUT_STRATEGY_TYPE_CANARY",
	// "ROLLOUT_STRATEGY_TYPE_BLUE_GREEN".
	Strategy RolloutStrategy `json:"strategy" api:"required"`
	// Output only. Deployment that traffic is shifting toward.
	TargetDeploymentID string `json:"targetDeploymentId" api:"required"`
	// Output only. Timestamp when the rollout reached a terminal state.
	CompletedAt time.Time `json:"completedAt" format:"date-time"`
	// Output only. Zero-based index of the current step. Unset while PENDING; step 0
	// is reported explicitly after start.
	CurrentStep int64 `json:"currentStep"`
	// Output only. Applied percentage of traffic on the target deployment.
	CurrentTrafficPercent int64 `json:"currentTrafficPercent"`
	// Output only. Opaque version tag for optimistic concurrency control.
	Etag string `json:"etag"`
	// Pause metadata returned while a rollout is paused.
	PauseInfo PauseInfo `json:"pauseInfo"`
	// Output only. Timestamp when the rollout started running.
	StartedAt time.Time `json:"startedAt" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                    respjson.Field
		CreatedAt             respjson.Field
		EndpointID            respjson.Field
		SourceDeploymentID    respjson.Field
		State                 respjson.Field
		Status                respjson.Field
		Strategy              respjson.Field
		TargetDeploymentID    respjson.Field
		CompletedAt           respjson.Field
		CurrentStep           respjson.Field
		CurrentTrafficPercent respjson.Field
		Etag                  respjson.Field
		PauseInfo             respjson.Field
		StartedAt             respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Public view of a rollout resource, including runtime progress and any pause or abort reason.

func (Rollout) RawJSON added in v0.13.0

func (r Rollout) RawJSON() string

Returns the unmodified JSON received from the API

func (*Rollout) UnmarshalJSON added in v0.13.0

func (r *Rollout) UnmarshalJSON(data []byte) error

type RolloutCondition added in v0.13.0

type RolloutCondition struct {
	// Step index where the condition arose. Step 0 serializes explicitly.
	AtStep int64 `json:"atStep"`
	// Category that classifies why the rollout stopped.
	//
	// Any of "ROLLOUT_FAILURE_CATEGORY_METRIC_REGRESSION",
	// "ROLLOUT_FAILURE_CATEGORY_METRICS_UNAVAILABLE",
	// "ROLLOUT_FAILURE_CATEGORY_TARGET_NOT_READY",
	// "ROLLOUT_FAILURE_CATEGORY_SOURCE_NOT_DRAINED",
	// "ROLLOUT_FAILURE_CATEGORY_HEALTH_REGRESSION",
	// "ROLLOUT_FAILURE_CATEGORY_CAPACITY_EXHAUSTED",
	// "ROLLOUT_FAILURE_CATEGORY_ROUTING_ERROR",
	// "ROLLOUT_FAILURE_CATEGORY_DEPENDENCY_OUTAGE",
	// "ROLLOUT_FAILURE_CATEGORY_ABORTED_BY_OPERATOR",
	// "ROLLOUT_FAILURE_CATEGORY_INTERNAL",
	// "ROLLOUT_FAILURE_CATEGORY_POLICY_INFEASIBLE",
	// "ROLLOUT_FAILURE_CATEGORY_UNDER_SERVED",
	// "ROLLOUT_FAILURE_CATEGORY_ENTITLEMENT_LAPSED".
	Category RolloutConditionCategory `json:"category"`
	// Human-readable explanation for the condition.
	Message string `json:"message"`
	// Metrics observed at the failing gate, enriched with their criteria. Unmeasured
	// rules appear as synthesized rows with verdict METRIC_VERDICT_UNAVAILABLE and no
	// measured values.
	Metrics []MetricResult `json:"metrics"`
	// Timestamp when the condition was observed.
	ObservedAt time.Time `json:"observedAt" format:"date-time"`
	// Informational condition type. `CapacityLimited` means the current step advanced
	// partially because full capacity was not placeable.
	//
	// Any of "CapacityLimited".
	Type RolloutConditionType `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AtStep      respjson.Field
		Category    respjson.Field
		Message     respjson.Field
		Metrics     respjson.Field
		ObservedAt  respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Structured reason a rollout stopped progressing.

func (RolloutCondition) RawJSON added in v0.13.0

func (r RolloutCondition) RawJSON() string

Returns the unmodified JSON received from the API

func (*RolloutCondition) UnmarshalJSON added in v0.13.0

func (r *RolloutCondition) UnmarshalJSON(data []byte) error

type RolloutConditionCategory added in v0.13.0

type RolloutConditionCategory string

Category that classifies why the rollout stopped.

const (
	RolloutConditionCategoryRolloutFailureCategoryMetricRegression   RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_METRIC_REGRESSION"
	RolloutConditionCategoryRolloutFailureCategoryMetricsUnavailable RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_METRICS_UNAVAILABLE"
	RolloutConditionCategoryRolloutFailureCategoryTargetNotReady     RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_TARGET_NOT_READY"
	RolloutConditionCategoryRolloutFailureCategorySourceNotDrained   RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_SOURCE_NOT_DRAINED"
	RolloutConditionCategoryRolloutFailureCategoryHealthRegression   RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_HEALTH_REGRESSION"
	RolloutConditionCategoryRolloutFailureCategoryCapacityExhausted  RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_CAPACITY_EXHAUSTED"
	RolloutConditionCategoryRolloutFailureCategoryRoutingError       RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_ROUTING_ERROR"
	RolloutConditionCategoryRolloutFailureCategoryDependencyOutage   RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_DEPENDENCY_OUTAGE"
	RolloutConditionCategoryRolloutFailureCategoryAbortedByOperator  RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_ABORTED_BY_OPERATOR"
	RolloutConditionCategoryRolloutFailureCategoryInternal           RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_INTERNAL"
	RolloutConditionCategoryRolloutFailureCategoryPolicyInfeasible   RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_POLICY_INFEASIBLE"
	RolloutConditionCategoryRolloutFailureCategoryUnderServed        RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_UNDER_SERVED"
	RolloutConditionCategoryRolloutFailureCategoryEntitlementLapsed  RolloutConditionCategory = "ROLLOUT_FAILURE_CATEGORY_ENTITLEMENT_LAPSED"
)

type RolloutConditionType added in v0.13.0

type RolloutConditionType string

Informational condition type. `CapacityLimited` means the current step advanced partially because full capacity was not placeable.

const (
	RolloutConditionTypeCapacityLimited RolloutConditionType = "CapacityLimited"
)

type RolloutDefaultsPreview added in v0.13.0

type RolloutDefaultsPreview struct {
	// Source deployment replica count the defaults were computed from. Zero is a real
	// value.
	SourceReplicas int64 `json:"sourceReplicas" api:"required"`
	// Strategy, metric gates, timing, and cleanup policy for shifting traffic between
	// two deployments under one endpoint.
	Spec RolloutDefaultsPreviewSpec `json:"spec" api:"required"`
	// Target deployment autoscaling maximum replica count. Zero is a real value.
	TargetMaxReplicas int64 `json:"targetMaxReplicas" api:"required"`
	// Target deployment autoscaling minimum replica count. Zero is a real value.
	TargetMinReplicas int64 `json:"targetMinReplicas" api:"required"`
	// Target deployment replica count the defaults were computed from. Zero is a real
	// value.
	TargetReplicas int64 `json:"targetReplicas" api:"required"`
	// Findings to surface next to the form when a later gate will refuse the spec or a
	// standing guarantee is lost. An empty list means the shown values are safe to
	// submit as-is; render message for unrecognized codes.
	Warnings []RolloutDefaultsPreviewWarning `json:"warnings" api:"required"`
	// Steps the rollout is expected to walk when the caller leaves steps unset.
	// Display only. Empty when the caller supplied steps or no ladder applies.
	EstimatedEffectiveSteps []RolloutStep `json:"estimatedEffectiveSteps"`
	// Percentage of the pair's traffic currently reaching the target, the floor the
	// suggested steps start above. Unset when not a frozen pair or unknown; 0 is a
	// real measurement.
	EstimatedSeedPercent int64 `json:"estimatedSeedPercent"`
	// True when both deployments stand in the endpoint traffic split, so the rollout
	// resumes from the current split rather than from zero. See warnings for standing
	// split shapes that StartRollout will still reject.
	FrozenPair bool `json:"frozenPair"`
	// Expected autoscaling maximum replicas for the completed target; unset while the
	// final target replicas cannot be resolved.
	LandingMaxReplicas int64 `json:"landingMaxReplicas"`
	// Expected autoscaling minimum replicas for the completed target; unset while the
	// final target replicas cannot be resolved.
	LandingMinReplicas int64 `json:"landingMinReplicas"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		SourceReplicas          respjson.Field
		Spec                    respjson.Field
		TargetMaxReplicas       respjson.Field
		TargetMinReplicas       respjson.Field
		TargetReplicas          respjson.Field
		Warnings                respjson.Field
		EstimatedEffectiveSteps respjson.Field
		EstimatedSeedPercent    respjson.Field
		FrozenPair              respjson.Field
		LandingMaxReplicas      respjson.Field
		LandingMinReplicas      respjson.Field
		ExtraFields             map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Completed create-form state — the caller's spec with defaulted values filled in, the steps the rollout is expected to walk, and the capacity context the defaults were computed from. Display only.

func (RolloutDefaultsPreview) RawJSON added in v0.13.0

func (r RolloutDefaultsPreview) RawJSON() string

Returns the unmodified JSON received from the API

func (*RolloutDefaultsPreview) UnmarshalJSON added in v0.13.0

func (r *RolloutDefaultsPreview) UnmarshalJSON(data []byte) error

type RolloutDefaultsPreviewSpec added in v0.13.0

type RolloutDefaultsPreviewSpec struct {
	// Deployment that traffic shifts away from.
	SourceDeploymentID string `json:"sourceDeploymentId" api:"required"`
	// Deployment that traffic shifts toward.
	TargetDeploymentID string `json:"targetDeploymentId" api:"required"`
	// Blue-green strategy configuration for a single cutover to the target deployment.
	BlueGreen BlueGreenConfig `json:"blueGreen"`
	// Canary strategy configuration for gradual traffic progression. An empty config
	// uses the default 5, 25, 50, 100 percent ladder; over a frozen traffic-split pair
	// left by cancel, the default ladder is derived at start from the pair's current
	// served share so it begins above it.
	Canary CanaryConfig `json:"canary"`
	// Optional final replica count for the source deployment. Defaults to 0, which
	// drains and stops the source.
	FinalSourceReplicas int64 `json:"finalSourceReplicas"`
	// Optional target replica floor at completion. Must be at least 1 when set;
	// defaults to the source deployment's replica count at create time, or to the
	// source and target deployments' combined replica count when both already stand in
	// the endpoint traffic split after a cancel. The completed target's autoscaling
	// max lands at the landing ceiling, max(this value, the source max, the target's
	// own max); the rollout may lift the target max at first wake, at the first step
	// that needs it, or at completion unless an operator changes max mid-run. The
	// lifted ceiling remains after completion, and PreviewRolloutDefaults reports a
	// coming lift as ROLLOUT_WILL_RAISE_TARGET_MAX. A pre-existing target whose own
	// autoscaling min is higher keeps that floor, reported as
	// FINAL_BELOW_INHERITED_MIN. A target that starts stopped lands exactly at this
	// value; if the source min was higher, PreviewRolloutDefaults reports
	// FINAL_BELOW_SOURCE_MIN.
	FinalTargetReplicas int64 `json:"finalTargetReplicas"`
	// Optional metric gates evaluated after each step's soak. Canary only; rejected on
	// rolling and blue-green rollouts.
	Metrics []MetricRule `json:"metrics"`
	// Rolling strategy configuration for small batches that ramp target replicas up
	// while shrinking source replicas to what their remaining traffic share needs.
	Rolling RollingConfig `json:"rolling"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		SourceDeploymentID  respjson.Field
		TargetDeploymentID  respjson.Field
		BlueGreen           respjson.Field
		Canary              respjson.Field
		FinalSourceReplicas respjson.Field
		FinalTargetReplicas respjson.Field
		Metrics             respjson.Field
		Rolling             respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Strategy, metric gates, timing, and cleanup policy for shifting traffic between two deployments under one endpoint.

func (RolloutDefaultsPreviewSpec) RawJSON added in v0.13.0

func (r RolloutDefaultsPreviewSpec) RawJSON() string

Returns the unmodified JSON received from the API

func (*RolloutDefaultsPreviewSpec) UnmarshalJSON added in v0.13.0

func (r *RolloutDefaultsPreviewSpec) UnmarshalJSON(data []byte) error

type RolloutDefaultsPreviewWarning added in v0.13.0

type RolloutDefaultsPreviewWarning struct {
	// Machine-readable warning code. Current vocabulary is START_WILL_REJECT,
	// FINAL_BELOW_SOURCE_MIN, and FIRST_STEP_AT_SEED; render message for unrecognized
	// codes.
	Code string `json:"code" api:"required"`
	// Plain-language description of the finding, safe to show users as-is.
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A non-blocking finding attached to a rollout defaults preview; expected end-state facts are structured fields on RolloutDefaultsPreview.

func (RolloutDefaultsPreviewWarning) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*RolloutDefaultsPreviewWarning) UnmarshalJSON added in v0.13.0

func (r *RolloutDefaultsPreviewWarning) UnmarshalJSON(data []byte) error

type RolloutState added in v0.13.0

type RolloutState string

Output only. High-level rollout lifecycle state.

const (
	RolloutStateRolloutStateRunning      RolloutState = "ROLLOUT_STATE_RUNNING"
	RolloutStateRolloutStatePaused       RolloutState = "ROLLOUT_STATE_PAUSED"
	RolloutStateRolloutStateStabilizing  RolloutState = "ROLLOUT_STATE_STABILIZING"
	RolloutStateRolloutStateCompleted    RolloutState = "ROLLOUT_STATE_COMPLETED"
	RolloutStateRolloutStatePending      RolloutState = "ROLLOUT_STATE_PENDING"
	RolloutStateRolloutStateSystemPaused RolloutState = "ROLLOUT_STATE_SYSTEM_PAUSED"
	RolloutStateRolloutStateCancelling   RolloutState = "ROLLOUT_STATE_CANCELLING"
	RolloutStateRolloutStateCanceled     RolloutState = "ROLLOUT_STATE_CANCELED"
	RolloutStateRolloutStatePausing      RolloutState = "ROLLOUT_STATE_PAUSING"
)

type RolloutStatus added in v0.13.0

type RolloutStatus struct {
	// Per-step rollout execution summaries.
	Steps []RolloutStepStatus `json:"steps" api:"required"`
	// Total number of steps in the rollout progression. Always serializes when status
	// is present.
	TotalSteps int64 `json:"totalSteps" api:"required"`
	// Structured reason a rollout stopped progressing.
	Condition RolloutCondition `json:"condition"`
	// Informational conditions that describe the rollout's current state. Omitted when
	// empty; clients should treat an absent key as an empty list.
	Conditions []RolloutCondition `json:"conditions"`
	// Timestamp of the most recent progress update.
	UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Steps       respjson.Field
		TotalSteps  respjson.Field
		Condition   respjson.Field
		Conditions  respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Derived runtime progress for a rollout.

func (RolloutStatus) RawJSON added in v0.13.0

func (r RolloutStatus) RawJSON() string

Returns the unmodified JSON received from the API

func (*RolloutStatus) UnmarshalJSON added in v0.13.0

func (r *RolloutStatus) UnmarshalJSON(data []byte) error

type RolloutStep added in v0.13.0

type RolloutStep struct {
	// Required percentage of traffic on the target deployment for this step.
	Traffic int64 `json:"traffic" api:"required"`
	// Optional explicit target replica count for this step.
	Replicas int64 `json:"replicas"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Traffic     respjson.Field
		Replicas    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One stage of a canary rollout progression.

func (RolloutStep) RawJSON added in v0.13.0

func (r RolloutStep) RawJSON() string

Returns the unmodified JSON received from the API

func (RolloutStep) ToParam added in v0.13.0

func (r RolloutStep) ToParam() RolloutStepParam

ToParam converts this RolloutStep to a RolloutStepParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with RolloutStepParam.Overrides()

func (*RolloutStep) UnmarshalJSON added in v0.13.0

func (r *RolloutStep) UnmarshalJSON(data []byte) error

type RolloutStepParam added in v0.13.0

type RolloutStepParam struct {
	// Required percentage of traffic on the target deployment for this step.
	Traffic int64 `json:"traffic" api:"required"`
	// Optional explicit target replica count for this step.
	Replicas param.Opt[int64] `json:"replicas,omitzero"`
	// contains filtered or unexported fields
}

One stage of a canary rollout progression.

The property Traffic is required.

func (RolloutStepParam) MarshalJSON added in v0.13.0

func (r RolloutStepParam) MarshalJSON() (data []byte, err error)

func (*RolloutStepParam) UnmarshalJSON added in v0.13.0

func (r *RolloutStepParam) UnmarshalJSON(data []byte) error

type RolloutStepStatus added in v0.13.0

type RolloutStepStatus struct {
	// Timestamp when this step finished, was skipped over, or the rollout ended on it.
	// Unset while in progress.
	CompletedAt time.Time `json:"completedAt" format:"date-time"`
	// Failure reason set only when this step failed.
	FailureReason string `json:"failureReason"`
	// Metric gate results for this step, enriched with criteria and verdict.
	// Unmeasured rules appear as synthesized rows with verdict
	// METRIC_VERDICT_UNAVAILABLE and no measured values.
	Metrics []MetricResult `json:"metrics"`
	// Timestamp when this step's first sub-step ran. Unset for steps no sub-step
	// reached.
	StartedAt time.Time `json:"startedAt" format:"date-time"`
	// Outcome of this step. Finished steps are PASSED, the live step mirrors the
	// rollout state, skipped-over steps are SKIPPED, and unreached steps are PENDING.
	//
	// Any of "ROLLOUT_STEP_STATE_PENDING", "ROLLOUT_STEP_STATE_RUNNING",
	// "ROLLOUT_STEP_STATE_PASSED", "ROLLOUT_STEP_STATE_FAILED",
	// "ROLLOUT_STEP_STATE_PAUSED", "ROLLOUT_STEP_STATE_CANCELED",
	// "ROLLOUT_STEP_STATE_SKIPPED".
	State RolloutStepStatusState `json:"state"`
	// Index of this step in the rollout progression. Step 0 serializes explicitly.
	StepIndex int64 `json:"stepIndex"`
	// Target traffic percentage configured for this step. Always serializes for
	// recorded steps.
	TargetTrafficPercent int64 `json:"targetTrafficPercent"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompletedAt          respjson.Field
		FailureReason        respjson.Field
		Metrics              respjson.Field
		StartedAt            respjson.Field
		State                respjson.Field
		StepIndex            respjson.Field
		TargetTrafficPercent respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Collapsed execution state for one rollout step.

func (RolloutStepStatus) RawJSON added in v0.13.0

func (r RolloutStepStatus) RawJSON() string

Returns the unmodified JSON received from the API

func (*RolloutStepStatus) UnmarshalJSON added in v0.13.0

func (r *RolloutStepStatus) UnmarshalJSON(data []byte) error

type RolloutStepStatusState added in v0.13.0

type RolloutStepStatusState string

Outcome of this step. Finished steps are PASSED, the live step mirrors the rollout state, skipped-over steps are SKIPPED, and unreached steps are PENDING.

const (
	RolloutStepStatusStateRolloutStepStatePending  RolloutStepStatusState = "ROLLOUT_STEP_STATE_PENDING"
	RolloutStepStatusStateRolloutStepStateRunning  RolloutStepStatusState = "ROLLOUT_STEP_STATE_RUNNING"
	RolloutStepStatusStateRolloutStepStatePassed   RolloutStepStatusState = "ROLLOUT_STEP_STATE_PASSED"
	RolloutStepStatusStateRolloutStepStateFailed   RolloutStepStatusState = "ROLLOUT_STEP_STATE_FAILED"
	RolloutStepStatusStateRolloutStepStatePaused   RolloutStepStatusState = "ROLLOUT_STEP_STATE_PAUSED"
	RolloutStepStatusStateRolloutStepStateCanceled RolloutStepStatusState = "ROLLOUT_STEP_STATE_CANCELED"
	RolloutStepStatusStateRolloutStepStateSkipped  RolloutStepStatusState = "ROLLOUT_STEP_STATE_SKIPPED"
)

type RolloutStrategy added in v0.13.0

type RolloutStrategy string

Output only. Rollout strategy selected at creation.

const (
	RolloutStrategyRolloutStrategyTypeRolling   RolloutStrategy = "ROLLOUT_STRATEGY_TYPE_ROLLING"
	RolloutStrategyRolloutStrategyTypeCanary    RolloutStrategy = "ROLLOUT_STRATEGY_TYPE_CANARY"
	RolloutStrategyRolloutStrategyTypeBlueGreen RolloutStrategy = "ROLLOUT_STRATEGY_TYPE_BLUE_GREEN"
)

type RuntimeInfo added in v0.13.0

type RuntimeInfo struct {
	// Serving engine, such as `vllm`, `trtllm`, or `sglang`.
	EngineType string `json:"engineType"`
	// Version of the serving engine.
	EngineVersion string `json:"engineVersion"`
	// Whether the runtime accepts tool and function-calling requests.
	FunctionCallingSupported bool `json:"functionCallingSupported"`
	// Whether the runtime can constrain generation to a structured output schema.
	StructuredOutputSupported bool `json:"structuredOutputSupported"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EngineType                respjson.Field
		EngineVersion             respjson.Field
		FunctionCallingSupported  respjson.Field
		StructuredOutputSupported respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Runtime information derived from the deployment's configuration.

func (RuntimeInfo) RawJSON added in v0.13.0

func (r RuntimeInfo) RawJSON() string

Returns the unmodified JSON received from the API

func (*RuntimeInfo) UnmarshalJSON added in v0.13.0

func (r *RuntimeInfo) UnmarshalJSON(data []byte) error

type S3Origin added in v0.13.0

type S3Origin struct {
	// IAM role ARN Together assumes to read the S3 bucket or prefix.
	RoleArn string `json:"role_arn" api:"required"`
	// S3 bucket or prefix to copy into the volume.
	Uri string `json:"uri" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RoleArn     respjson.Field
		Uri         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

S3 source configuration for volume sync.

func (S3Origin) RawJSON added in v0.13.0

func (r S3Origin) RawJSON() string

Returns the unmodified JSON received from the API

func (S3Origin) ToParam added in v0.13.0

func (r S3Origin) ToParam() S3OriginParam

ToParam converts this S3Origin to a S3OriginParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with S3OriginParam.Overrides()

func (*S3Origin) UnmarshalJSON added in v0.13.0

func (r *S3Origin) UnmarshalJSON(data []byte) error

type S3OriginParam added in v0.13.0

type S3OriginParam struct {
	// IAM role ARN Together assumes to read the S3 bucket or prefix.
	RoleArn string `json:"role_arn" api:"required"`
	// S3 bucket or prefix to copy into the volume.
	Uri string `json:"uri" api:"required"`
	// contains filtered or unexported fields
}

S3 source configuration for volume sync.

The properties RoleArn, Uri are required.

func (S3OriginParam) MarshalJSON added in v0.13.0

func (r S3OriginParam) MarshalJSON() (data []byte, err error)

func (*S3OriginParam) UnmarshalJSON added in v0.13.0

func (r *S3OriginParam) UnmarshalJSON(data []byte) error

type ScalingMetric added in v0.13.0

type ScalingMetric struct {
	// Autoscaling metric name from the server allowlist.
	//
	// Any of "active_sessions", "cache_hit_rate", "decoding_speed", "e2e_latency",
	// "gpu_utilization", "inflight_requests", "throughput_per_replica",
	// "token_utilization", "ttft".
	Name ScalingMetricName `json:"name" api:"required"`
	// Target interpreted according to `type`. Utilization uses a percentage from 0 to
	// 100, value uses an absolute measurement, and average value uses a per-replica
	// measurement.
	Target float64 `json:"target" api:"required"`
	// Whether `target` is an absolute value, a utilization percentage, or a
	// per-replica average.
	//
	// Any of "METRIC_TARGET_TYPE_VALUE", "METRIC_TARGET_TYPE_UTILIZATION",
	// "METRIC_TARGET_TYPE_AVERAGE_VALUE".
	Type ScalingMetricType `json:"type" api:"required"`
	// Percentile to evaluate for latency-based metrics: `p50`, `p90`, `p95`, or `p99`.
	Percentile string `json:"percentile"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Target      respjson.Field
		Type        respjson.Field
		Percentile  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metric and target used by the autoscaler to recommend a replica count.

func (ScalingMetric) RawJSON added in v0.13.0

func (r ScalingMetric) RawJSON() string

Returns the unmodified JSON received from the API

func (ScalingMetric) ToParam added in v0.13.0

func (r ScalingMetric) ToParam() ScalingMetricParam

ToParam converts this ScalingMetric to a ScalingMetricParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ScalingMetricParam.Overrides()

func (*ScalingMetric) UnmarshalJSON added in v0.13.0

func (r *ScalingMetric) UnmarshalJSON(data []byte) error

type ScalingMetricName added in v0.13.0

type ScalingMetricName string

Autoscaling metric name from the server allowlist.

const (
	ScalingMetricNameActiveSessions       ScalingMetricName = "active_sessions"
	ScalingMetricNameCacheHitRate         ScalingMetricName = "cache_hit_rate"
	ScalingMetricNameDecodingSpeed        ScalingMetricName = "decoding_speed"
	ScalingMetricNameE2ELatency           ScalingMetricName = "e2e_latency"
	ScalingMetricNameGPUUtilization       ScalingMetricName = "gpu_utilization"
	ScalingMetricNameInflightRequests     ScalingMetricName = "inflight_requests"
	ScalingMetricNameThroughputPerReplica ScalingMetricName = "throughput_per_replica"
	ScalingMetricNameTokenUtilization     ScalingMetricName = "token_utilization"
	ScalingMetricNameTtft                 ScalingMetricName = "ttft"
)

type ScalingMetricParam added in v0.13.0

type ScalingMetricParam struct {
	// Autoscaling metric name from the server allowlist.
	//
	// Any of "active_sessions", "cache_hit_rate", "decoding_speed", "e2e_latency",
	// "gpu_utilization", "inflight_requests", "throughput_per_replica",
	// "token_utilization", "ttft".
	Name ScalingMetricName `json:"name,omitzero" api:"required"`
	// Target interpreted according to `type`. Utilization uses a percentage from 0 to
	// 100, value uses an absolute measurement, and average value uses a per-replica
	// measurement.
	Target float64 `json:"target" api:"required"`
	// Whether `target` is an absolute value, a utilization percentage, or a
	// per-replica average.
	//
	// Any of "METRIC_TARGET_TYPE_VALUE", "METRIC_TARGET_TYPE_UTILIZATION",
	// "METRIC_TARGET_TYPE_AVERAGE_VALUE".
	Type ScalingMetricType `json:"type,omitzero" api:"required"`
	// Percentile to evaluate for latency-based metrics: `p50`, `p90`, `p95`, or `p99`.
	Percentile param.Opt[string] `json:"percentile,omitzero"`
	// contains filtered or unexported fields
}

Metric and target used by the autoscaler to recommend a replica count.

The properties Name, Target, Type are required.

func (ScalingMetricParam) MarshalJSON added in v0.13.0

func (r ScalingMetricParam) MarshalJSON() (data []byte, err error)

func (*ScalingMetricParam) UnmarshalJSON added in v0.13.0

func (r *ScalingMetricParam) UnmarshalJSON(data []byte) error

type ScalingMetricType added in v0.13.0

type ScalingMetricType string

Whether `target` is an absolute value, a utilization percentage, or a per-replica average.

const (
	ScalingMetricTypeMetricTargetTypeValue        ScalingMetricType = "METRIC_TARGET_TYPE_VALUE"
	ScalingMetricTypeMetricTargetTypeUtilization  ScalingMetricType = "METRIC_TARGET_TYPE_UTILIZATION"
	ScalingMetricTypeMetricTargetTypeAverageValue ScalingMetricType = "METRIC_TARGET_TYPE_AVERAGE_VALUE"
)

type ScalingPolicy added in v0.13.0

type ScalingPolicy struct {
	// Trailing rate-limit window in seconds, from 1 to 1800.
	PeriodSeconds int64 `json:"periodSeconds" api:"required"`
	// Whether `value` is a replica count or a percentage of the replica count at the
	// start of the trailing period. Scaling events within that period count against
	// the allowance; percentages are rounded to whole replicas.
	//
	// Any of "SCALING_POLICY_TYPE_PODS", "SCALING_POLICY_TYPE_PERCENT".
	Type ScalingPolicyType `json:"type" api:"required"`
	// Positive replica count or percentage used as the rate-limit amount.
	Value int64 `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PeriodSeconds respjson.Field
		Type          respjson.Field
		Value         respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Replica rate-limit policy applied over a trailing window.

func (ScalingPolicy) RawJSON added in v0.13.0

func (r ScalingPolicy) RawJSON() string

Returns the unmodified JSON received from the API

func (ScalingPolicy) ToParam added in v0.13.0

func (r ScalingPolicy) ToParam() ScalingPolicyParam

ToParam converts this ScalingPolicy to a ScalingPolicyParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ScalingPolicyParam.Overrides()

func (*ScalingPolicy) UnmarshalJSON added in v0.13.0

func (r *ScalingPolicy) UnmarshalJSON(data []byte) error

type ScalingPolicyParam added in v0.13.0

type ScalingPolicyParam struct {
	// Trailing rate-limit window in seconds, from 1 to 1800.
	PeriodSeconds int64 `json:"periodSeconds" api:"required"`
	// Whether `value` is a replica count or a percentage of the replica count at the
	// start of the trailing period. Scaling events within that period count against
	// the allowance; percentages are rounded to whole replicas.
	//
	// Any of "SCALING_POLICY_TYPE_PODS", "SCALING_POLICY_TYPE_PERCENT".
	Type ScalingPolicyType `json:"type,omitzero" api:"required"`
	// Positive replica count or percentage used as the rate-limit amount.
	Value int64 `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Replica rate-limit policy applied over a trailing window.

The properties PeriodSeconds, Type, Value are required.

func (ScalingPolicyParam) MarshalJSON added in v0.13.0

func (r ScalingPolicyParam) MarshalJSON() (data []byte, err error)

func (*ScalingPolicyParam) UnmarshalJSON added in v0.13.0

func (r *ScalingPolicyParam) UnmarshalJSON(data []byte) error

type ScalingPolicyType added in v0.13.0

type ScalingPolicyType string

Whether `value` is a replica count or a percentage of the replica count at the start of the trailing period. Scaling events within that period count against the allowance; percentages are rounded to whole replicas.

const (
	ScalingPolicyTypeScalingPolicyTypePods    ScalingPolicyType = "SCALING_POLICY_TYPE_PODS"
	ScalingPolicyTypeScalingPolicyTypePercent ScalingPolicyType = "SCALING_POLICY_TYPE_PERCENT"
)

type ScalingRules added in v0.13.0

type ScalingRules struct {
	// Non-empty lists replace the existing policies. To clear policies, include
	// `autoscaling.scaleDown.policies` or `autoscaling.scaleUp.policies` in the update
	// mask and supply an empty scaling rules object or `policies: []`.
	Policies []ScalingPolicy `json:"policies"`
	// `SCALING_POLICY_SELECT_MIN` chooses the policy allowing the smallest replica
	// change; `SCALING_POLICY_SELECT_MAX` chooses the largest. These are caps, not
	// guaranteed changes. `SCALING_POLICY_SELECT_DISABLED` holds this direction steady
	// while replica bounds still apply. Omitted preserves the existing selector on
	// update. When no selector is configured, authored policies use MAX; with no
	// policies configured, the platform defaults apply. To reset the selector, include
	// `autoscaling.scaleDown.selectPolicy` or `autoscaling.scaleUp.selectPolicy` in
	// the update mask and omit `selectPolicy`. Clear both policies and `selectPolicy`
	// to restore inherited defaults.
	//
	// Any of "SCALING_POLICY_SELECT_MAX", "SCALING_POLICY_SELECT_MIN",
	// "SCALING_POLICY_SELECT_DISABLED".
	SelectPolicy ScalingRulesSelectPolicy `json:"selectPolicy"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Policies     respjson.Field
		SelectPolicy respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Rate limits applied after stabilization and before replica bounds.

func (ScalingRules) RawJSON added in v0.13.0

func (r ScalingRules) RawJSON() string

Returns the unmodified JSON received from the API

func (ScalingRules) ToParam added in v0.13.0

func (r ScalingRules) ToParam() ScalingRulesParam

ToParam converts this ScalingRules to a ScalingRulesParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ScalingRulesParam.Overrides()

func (*ScalingRules) UnmarshalJSON added in v0.13.0

func (r *ScalingRules) UnmarshalJSON(data []byte) error

type ScalingRulesParam added in v0.13.0

type ScalingRulesParam struct {
	// Non-empty lists replace the existing policies. To clear policies, include
	// `autoscaling.scaleDown.policies` or `autoscaling.scaleUp.policies` in the update
	// mask and supply an empty scaling rules object or `policies: []`.
	Policies []ScalingPolicyParam `json:"policies,omitzero"`
	// `SCALING_POLICY_SELECT_MIN` chooses the policy allowing the smallest replica
	// change; `SCALING_POLICY_SELECT_MAX` chooses the largest. These are caps, not
	// guaranteed changes. `SCALING_POLICY_SELECT_DISABLED` holds this direction steady
	// while replica bounds still apply. Omitted preserves the existing selector on
	// update. When no selector is configured, authored policies use MAX; with no
	// policies configured, the platform defaults apply. To reset the selector, include
	// `autoscaling.scaleDown.selectPolicy` or `autoscaling.scaleUp.selectPolicy` in
	// the update mask and omit `selectPolicy`. Clear both policies and `selectPolicy`
	// to restore inherited defaults.
	//
	// Any of "SCALING_POLICY_SELECT_MAX", "SCALING_POLICY_SELECT_MIN",
	// "SCALING_POLICY_SELECT_DISABLED".
	SelectPolicy ScalingRulesSelectPolicy `json:"selectPolicy,omitzero"`
	// contains filtered or unexported fields
}

Rate limits applied after stabilization and before replica bounds.

func (ScalingRulesParam) MarshalJSON added in v0.13.0

func (r ScalingRulesParam) MarshalJSON() (data []byte, err error)

func (*ScalingRulesParam) UnmarshalJSON added in v0.13.0

func (r *ScalingRulesParam) UnmarshalJSON(data []byte) error

type ScalingRulesSelectPolicy added in v0.13.0

type ScalingRulesSelectPolicy string

`SCALING_POLICY_SELECT_MIN` chooses the policy allowing the smallest replica change; `SCALING_POLICY_SELECT_MAX` chooses the largest. These are caps, not guaranteed changes. `SCALING_POLICY_SELECT_DISABLED` holds this direction steady while replica bounds still apply. Omitted preserves the existing selector on update. When no selector is configured, authored policies use MAX; with no policies configured, the platform defaults apply. To reset the selector, include `autoscaling.scaleDown.selectPolicy` or `autoscaling.scaleUp.selectPolicy` in the update mask and omit `selectPolicy`. Clear both policies and `selectPolicy` to restore inherited defaults.

const (
	ScalingRulesSelectPolicyScalingPolicySelectMax      ScalingRulesSelectPolicy = "SCALING_POLICY_SELECT_MAX"
	ScalingRulesSelectPolicyScalingPolicySelectMin      ScalingRulesSelectPolicy = "SCALING_POLICY_SELECT_MIN"
	ScalingRulesSelectPolicyScalingPolicySelectDisabled ScalingRulesSelectPolicy = "SCALING_POLICY_SELECT_DISABLED"
)

type Secret added in v0.6.0

type Secret struct {
	// ID is the unique identifier for this secret
	ID string `json:"id"`
	// CreatedAt is the ISO8601 timestamp when this secret was created
	CreatedAt string `json:"created_at"`
	// CreatedBy is the identifier of who created this secret.
	CreatedBy string `json:"created_by"`
	// Description is a human-readable description of the secret's purpose
	Description string `json:"description"`
	// LastUpdatedBy is the identifier of who last updated this secret.
	LastUpdatedBy string `json:"last_updated_by"`
	// Name is the name/key of the secret
	Name string `json:"name"`
	// The object type, which is always `secret`.
	//
	// Any of "secret".
	Object SecretObject `json:"object"`
	// UpdatedAt is the ISO8601 timestamp when this secret was last updated
	UpdatedAt string `json:"updated_at"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		CreatedBy     respjson.Field
		Description   respjson.Field
		LastUpdatedBy respjson.Field
		Name          respjson.Field
		Object        respjson.Field
		UpdatedAt     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Secret) RawJSON added in v0.6.0

func (r Secret) RawJSON() string

Returns the unmodified JSON received from the API

func (*Secret) UnmarshalJSON added in v0.6.0

func (r *Secret) UnmarshalJSON(data []byte) error

type SecretObject added in v0.7.0

type SecretObject string

The object type, which is always `secret`.

const (
	SecretObjectSecret SecretObject = "secret"
)

type Selector added in v0.13.0

type Selector struct {
	// Selector name, such as GPU type, GPU count, or optimization profile.
	Key string `json:"key" api:"required"`
	// Required value for the selector.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Key         respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Hardware or runtime requirement expressed as a key-value pair.

func (Selector) RawJSON added in v0.13.0

func (r Selector) RawJSON() string

Returns the unmodified JSON received from the API

func (*Selector) UnmarshalJSON added in v0.13.0

func (r *Selector) UnmarshalJSON(data []byte) error

type ShadowAdaptiveKeyBasedSamplingParam added in v0.11.0

type ShadowAdaptiveKeyBasedSamplingParam struct {
	// Required request-body field used as the sticky sampling key.
	Key string `json:"key" api:"required"`
	// Required per-gateway-replica target QPS for adaptive sampling.
	TargetQps float64 `json:"targetQps" api:"required"`
	// Optional sliding window for QPS observation. Defaults to 60s and must not be
	// negative.
	Window param.Opt[string] `json:"window,omitzero"`
	// contains filtered or unexported fields
}

Adaptive sticky-key sampling that throttles toward a target QPS.

The properties Key, TargetQps are required.

func (ShadowAdaptiveKeyBasedSamplingParam) MarshalJSON added in v0.11.0

func (r ShadowAdaptiveKeyBasedSamplingParam) MarshalJSON() (data []byte, err error)

func (*ShadowAdaptiveKeyBasedSamplingParam) UnmarshalJSON added in v0.11.0

func (r *ShadowAdaptiveKeyBasedSamplingParam) UnmarshalJSON(data []byte) error

type ShadowAdaptiveKeyBasedSamplingResponse added in v0.13.0

type ShadowAdaptiveKeyBasedSamplingResponse struct {
	// Request-body field used as the sticky sampling key.
	Key string `json:"key" api:"required"`
	// Per-gateway-replica target QPS.
	TargetQps float64 `json:"targetQps" api:"required"`
	// Sliding window for QPS observation when explicitly configured.
	Window string `json:"window"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Key         respjson.Field
		TargetQps   respjson.Field
		Window      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Adaptive sticky-key sampling returned by the API.

func (ShadowAdaptiveKeyBasedSamplingResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ShadowAdaptiveKeyBasedSamplingResponse) UnmarshalJSON added in v0.13.0

func (r *ShadowAdaptiveKeyBasedSamplingResponse) UnmarshalJSON(data []byte) error

type ShadowAdaptiveUniformSamplingParam added in v0.11.0

type ShadowAdaptiveUniformSamplingParam struct {
	// Required per-gateway-replica target QPS for adaptive sampling.
	TargetQps float64 `json:"targetQps" api:"required"`
	// Optional sliding window for QPS observation. Defaults to 60s and must not be
	// negative.
	Window param.Opt[string] `json:"window,omitzero"`
	// contains filtered or unexported fields
}

Adaptive random sampling that throttles toward a target QPS.

The property TargetQps is required.

func (ShadowAdaptiveUniformSamplingParam) MarshalJSON added in v0.11.0

func (r ShadowAdaptiveUniformSamplingParam) MarshalJSON() (data []byte, err error)

func (*ShadowAdaptiveUniformSamplingParam) UnmarshalJSON added in v0.11.0

func (r *ShadowAdaptiveUniformSamplingParam) UnmarshalJSON(data []byte) error

type ShadowAdaptiveUniformSamplingResponse added in v0.13.0

type ShadowAdaptiveUniformSamplingResponse struct {
	// Per-gateway-replica target QPS.
	TargetQps float64 `json:"targetQps" api:"required"`
	// Sliding window for QPS observation when explicitly configured.
	Window string `json:"window"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		TargetQps   respjson.Field
		Window      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Adaptive random sampling returned by the API.

func (ShadowAdaptiveUniformSamplingResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ShadowAdaptiveUniformSamplingResponse) UnmarshalJSON added in v0.13.0

func (r *ShadowAdaptiveUniformSamplingResponse) UnmarshalJSON(data []byte) error

type ShadowEndpointSourceParam added in v0.11.0

type ShadowEndpointSourceParam struct {
	// Sampling strategy for endpoint-level shadow traffic. Exactly one strategy must
	// be set.
	Sampling ShadowEndpointSourceSamplingUnionParam `json:"sampling,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Endpoint-level source that samples endpoint traffic at the API gateway.

The property Sampling is required.

func (ShadowEndpointSourceParam) MarshalJSON added in v0.11.0

func (r ShadowEndpointSourceParam) MarshalJSON() (data []byte, err error)

func (*ShadowEndpointSourceParam) UnmarshalJSON added in v0.11.0

func (r *ShadowEndpointSourceParam) UnmarshalJSON(data []byte) error

type ShadowEndpointSourceResponse added in v0.13.0

type ShadowEndpointSourceResponse struct {
	// Sampling strategy returned for endpoint-level shadow traffic.
	Sampling ShadowEndpointSourceResponseSamplingUnion `json:"sampling" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Sampling    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Endpoint-level source returned for a shadow experiment.

func (ShadowEndpointSourceResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ShadowEndpointSourceResponse) UnmarshalJSON added in v0.13.0

func (r *ShadowEndpointSourceResponse) UnmarshalJSON(data []byte) error

type ShadowEndpointSourceResponseSamplingAdaptiveKeyBased added in v0.13.0

type ShadowEndpointSourceResponseSamplingAdaptiveKeyBased struct {
	// Adaptive sticky-key sampling returned by the API.
	AdaptiveKeyBased ShadowAdaptiveKeyBasedSamplingResponse `json:"adaptiveKeyBased" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AdaptiveKeyBased respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ShadowEndpointSourceResponseSamplingAdaptiveKeyBased) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ShadowEndpointSourceResponseSamplingAdaptiveKeyBased) UnmarshalJSON added in v0.13.0

type ShadowEndpointSourceResponseSamplingAdaptiveUniform added in v0.13.0

type ShadowEndpointSourceResponseSamplingAdaptiveUniform struct {
	// Adaptive random sampling returned by the API.
	AdaptiveUniform ShadowAdaptiveUniformSamplingResponse `json:"adaptiveUniform" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AdaptiveUniform respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ShadowEndpointSourceResponseSamplingAdaptiveUniform) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ShadowEndpointSourceResponseSamplingAdaptiveUniform) UnmarshalJSON added in v0.13.0

type ShadowEndpointSourceResponseSamplingKeyBased added in v0.13.0

type ShadowEndpointSourceResponseSamplingKeyBased struct {
	// Fixed-rate sticky-key sampling returned by the API. A zero rate may be omitted
	// by JSON serialization.
	KeyBased ShadowKeyBasedSamplingResponse `json:"keyBased" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		KeyBased    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ShadowEndpointSourceResponseSamplingKeyBased) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ShadowEndpointSourceResponseSamplingKeyBased) UnmarshalJSON added in v0.13.0

func (r *ShadowEndpointSourceResponseSamplingKeyBased) UnmarshalJSON(data []byte) error

type ShadowEndpointSourceResponseSamplingUniform added in v0.13.0

type ShadowEndpointSourceResponseSamplingUniform struct {
	// Fixed-rate random sampling returned by the API. A zero rate may be omitted by
	// JSON serialization.
	Uniform ShadowUniformSamplingResponse `json:"uniform" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Uniform     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ShadowEndpointSourceResponseSamplingUniform) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ShadowEndpointSourceResponseSamplingUniform) UnmarshalJSON added in v0.13.0

func (r *ShadowEndpointSourceResponseSamplingUniform) UnmarshalJSON(data []byte) error

type ShadowEndpointSourceResponseSamplingUnion added in v0.13.0

type ShadowEndpointSourceResponseSamplingUnion struct {
	// This field is from variant [ShadowEndpointSourceResponseSamplingUniform].
	Uniform ShadowUniformSamplingResponse `json:"uniform"`
	// This field is from variant [ShadowEndpointSourceResponseSamplingKeyBased].
	KeyBased ShadowKeyBasedSamplingResponse `json:"keyBased"`
	// This field is from variant
	// [ShadowEndpointSourceResponseSamplingAdaptiveUniform].
	AdaptiveUniform ShadowAdaptiveUniformSamplingResponse `json:"adaptiveUniform"`
	// This field is from variant
	// [ShadowEndpointSourceResponseSamplingAdaptiveKeyBased].
	AdaptiveKeyBased ShadowAdaptiveKeyBasedSamplingResponse `json:"adaptiveKeyBased"`
	JSON             struct {
		Uniform          respjson.Field
		KeyBased         respjson.Field
		AdaptiveUniform  respjson.Field
		AdaptiveKeyBased respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ShadowEndpointSourceResponseSamplingUnion contains all possible properties and values from ShadowEndpointSourceResponseSamplingUniform, ShadowEndpointSourceResponseSamplingKeyBased, ShadowEndpointSourceResponseSamplingAdaptiveUniform, ShadowEndpointSourceResponseSamplingAdaptiveKeyBased.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ShadowEndpointSourceResponseSamplingUnion) AsAdaptiveKeyBased added in v0.13.0

func (ShadowEndpointSourceResponseSamplingUnion) AsAdaptiveUniform added in v0.13.0

func (ShadowEndpointSourceResponseSamplingUnion) AsKeyBased added in v0.13.0

func (ShadowEndpointSourceResponseSamplingUnion) AsUniform added in v0.13.0

func (ShadowEndpointSourceResponseSamplingUnion) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ShadowEndpointSourceResponseSamplingUnion) UnmarshalJSON added in v0.13.0

func (r *ShadowEndpointSourceResponseSamplingUnion) UnmarshalJSON(data []byte) error

type ShadowEndpointSourceSamplingAdaptiveKeyBasedParam added in v0.11.0

type ShadowEndpointSourceSamplingAdaptiveKeyBasedParam struct {
	// Adaptive sticky-key sampling that throttles toward a target QPS.
	AdaptiveKeyBased ShadowAdaptiveKeyBasedSamplingParam `json:"adaptiveKeyBased,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The property AdaptiveKeyBased is required.

func (ShadowEndpointSourceSamplingAdaptiveKeyBasedParam) MarshalJSON added in v0.11.0

func (r ShadowEndpointSourceSamplingAdaptiveKeyBasedParam) MarshalJSON() (data []byte, err error)

func (*ShadowEndpointSourceSamplingAdaptiveKeyBasedParam) UnmarshalJSON added in v0.11.0

type ShadowEndpointSourceSamplingAdaptiveUniformParam added in v0.11.0

type ShadowEndpointSourceSamplingAdaptiveUniformParam struct {
	// Adaptive random sampling that throttles toward a target QPS.
	AdaptiveUniform ShadowAdaptiveUniformSamplingParam `json:"adaptiveUniform,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The property AdaptiveUniform is required.

func (ShadowEndpointSourceSamplingAdaptiveUniformParam) MarshalJSON added in v0.11.0

func (r ShadowEndpointSourceSamplingAdaptiveUniformParam) MarshalJSON() (data []byte, err error)

func (*ShadowEndpointSourceSamplingAdaptiveUniformParam) UnmarshalJSON added in v0.11.0

type ShadowEndpointSourceSamplingKeyBasedParam added in v0.11.0

type ShadowEndpointSourceSamplingKeyBasedParam struct {
	// Fixed-rate sampling of distinct key values with sticky decisions.
	KeyBased ShadowKeyBasedSamplingParam `json:"keyBased,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The property KeyBased is required.

func (ShadowEndpointSourceSamplingKeyBasedParam) MarshalJSON added in v0.11.0

func (r ShadowEndpointSourceSamplingKeyBasedParam) MarshalJSON() (data []byte, err error)

func (*ShadowEndpointSourceSamplingKeyBasedParam) UnmarshalJSON added in v0.11.0

func (r *ShadowEndpointSourceSamplingKeyBasedParam) UnmarshalJSON(data []byte) error

type ShadowEndpointSourceSamplingUniformParam added in v0.11.0

type ShadowEndpointSourceSamplingUniformParam struct {
	// Fixed-rate random sampling of endpoint requests.
	Uniform ShadowUniformSamplingParam `json:"uniform,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The property Uniform is required.

func (ShadowEndpointSourceSamplingUniformParam) MarshalJSON added in v0.11.0

func (r ShadowEndpointSourceSamplingUniformParam) MarshalJSON() (data []byte, err error)

func (*ShadowEndpointSourceSamplingUniformParam) UnmarshalJSON added in v0.11.0

func (r *ShadowEndpointSourceSamplingUniformParam) UnmarshalJSON(data []byte) error

type ShadowEndpointSourceSamplingUnionParam added in v0.11.0

type ShadowEndpointSourceSamplingUnionParam struct {
	OfUniform          *ShadowEndpointSourceSamplingUniformParam          `json:",omitzero,inline"`
	OfKeyBased         *ShadowEndpointSourceSamplingKeyBasedParam         `json:",omitzero,inline"`
	OfAdaptiveUniform  *ShadowEndpointSourceSamplingAdaptiveUniformParam  `json:",omitzero,inline"`
	OfAdaptiveKeyBased *ShadowEndpointSourceSamplingAdaptiveKeyBasedParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ShadowEndpointSourceSamplingUnionParam) MarshalJSON added in v0.11.0

func (u ShadowEndpointSourceSamplingUnionParam) MarshalJSON() ([]byte, error)

func (*ShadowEndpointSourceSamplingUnionParam) UnmarshalJSON added in v0.11.0

func (u *ShadowEndpointSourceSamplingUnionParam) UnmarshalJSON(data []byte) error

type ShadowExperiment added in v0.11.0

type ShadowExperiment struct {
	// Output only. Unique shadow experiment identifier.
	ID string `json:"id" api:"required"`
	// Timestamp when the experiment was created.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// Identifier of the principal that created the experiment.
	CreatedBy string `json:"createdBy" api:"required"`
	// Output only. Endpoint whose traffic this experiment samples.
	EndpointID string `json:"endpointId" api:"required"`
	// Opaque version tag for optimistic concurrency control. Returned on read; set it
	// on update or delete requests for consistent read-modify-write.
	Etag string `json:"etag" api:"required"`
	// Human-readable shadow experiment name, unique within the endpoint. At most 256
	// characters.
	Name string `json:"name" api:"required"`
	// Output only. Project that owns the parent endpoint.
	ProjectID string `json:"projectId" api:"required"`
	// Endpoint traffic source returned for a shadow experiment.
	Source ShadowSourceResponse `json:"source" api:"required"`
	// Derived serving state, active when the experiment has at least one target.
	//
	// Any of "SHADOW_EXPERIMENT_STATE_ACTIVE", "SHADOW_EXPERIMENT_STATE_INACTIVE".
	State ShadowExperimentState `json:"state" api:"required"`
	// Target deployments that receive mirrored traffic.
	Targets []ShadowExperimentTarget `json:"targets" api:"required"`
	// Timestamp when the experiment was last updated.
	UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
	// User defined description.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		CreatedBy   respjson.Field
		EndpointID  respjson.Field
		Etag        respjson.Field
		Name        respjson.Field
		ProjectID   respjson.Field
		Source      respjson.Field
		State       respjson.Field
		Targets     respjson.Field
		UpdatedAt   respjson.Field
		Description respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Experiment that mirrors sampled endpoint requests to target deployments without changing client responses.

func (ShadowExperiment) RawJSON added in v0.11.0

func (r ShadowExperiment) RawJSON() string

Returns the unmodified JSON received from the API

func (*ShadowExperiment) UnmarshalJSON added in v0.11.0

func (r *ShadowExperiment) UnmarshalJSON(data []byte) error

type ShadowExperimentState added in v0.11.0

type ShadowExperimentState string

Derived serving state, active when the experiment has at least one target.

const (
	ShadowExperimentStateShadowExperimentStateActive   ShadowExperimentState = "SHADOW_EXPERIMENT_STATE_ACTIVE"
	ShadowExperimentStateShadowExperimentStateInactive ShadowExperimentState = "SHADOW_EXPERIMENT_STATE_INACTIVE"
)

type ShadowExperimentTarget added in v0.11.0

type ShadowExperimentTarget struct {
	// Output only. Unique shadow experiment target identifier.
	ID string `json:"id" api:"required"`
	// Output only. Timestamp when the target was created.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// Opaque version tag for optimistic concurrency control. Returned on read; set it
	// on update or delete requests for consistent read-modify-write.
	Etag string `json:"etag" api:"required"`
	// Output only. Shadow experiment this target belongs to.
	ExperimentID string `json:"experimentId" api:"required"`
	// Human-readable target name, unique within the shadow experiment. At most 256
	// characters.
	Name string `json:"name" api:"required"`
	// Deployment under the parent endpoint that receives mirrored traffic. It must not
	// be a live traffic-split member or the source or target of an active rollout;
	// traffic-split weight 0 warm-up targets are allowed.
	TargetDeploymentID string `json:"targetDeploymentId" api:"required"`
	// Output only. Timestamp when the target was last updated.
	UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
	// Optional free-form target description.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		CreatedAt          respjson.Field
		Etag               respjson.Field
		ExperimentID       respjson.Field
		Name               respjson.Field
		TargetDeploymentID respjson.Field
		UpdatedAt          respjson.Field
		Description        respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Deployment that receives mirrored traffic for a shadow experiment.

func (ShadowExperimentTarget) RawJSON added in v0.11.0

func (r ShadowExperimentTarget) RawJSON() string

Returns the unmodified JSON received from the API

func (*ShadowExperimentTarget) UnmarshalJSON added in v0.11.0

func (r *ShadowExperimentTarget) UnmarshalJSON(data []byte) error

type ShadowKeyBasedSamplingParam added in v0.11.0

type ShadowKeyBasedSamplingParam struct {
	// Required request-body field used as the sticky sampling key.
	Key string `json:"key" api:"required"`
	// Required fraction of distinct key values to sample, from 0.0 to 1.0.
	Rate float64 `json:"rate" api:"required"`
	// contains filtered or unexported fields
}

Fixed-rate sampling of distinct key values with sticky decisions.

The properties Key, Rate are required.

func (ShadowKeyBasedSamplingParam) MarshalJSON added in v0.11.0

func (r ShadowKeyBasedSamplingParam) MarshalJSON() (data []byte, err error)

func (*ShadowKeyBasedSamplingParam) UnmarshalJSON added in v0.11.0

func (r *ShadowKeyBasedSamplingParam) UnmarshalJSON(data []byte) error

type ShadowKeyBasedSamplingResponse added in v0.13.0

type ShadowKeyBasedSamplingResponse struct {
	// Request-body field used as the sticky sampling key.
	Key string `json:"key" api:"required"`
	// Fraction of distinct key values sampled, from 0.0 to 1.0.
	Rate float64 `json:"rate"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Key         respjson.Field
		Rate        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Fixed-rate sticky-key sampling returned by the API. A zero rate may be omitted by JSON serialization.

func (ShadowKeyBasedSamplingResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ShadowKeyBasedSamplingResponse) UnmarshalJSON added in v0.13.0

func (r *ShadowKeyBasedSamplingResponse) UnmarshalJSON(data []byte) error

type ShadowSourceParam added in v0.11.0

type ShadowSourceParam struct {
	// Endpoint-level source that samples endpoint traffic at the API gateway.
	Endpoint ShadowEndpointSourceParam `json:"endpoint,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Traffic source for a shadow experiment. The public API supports endpoint sources only.

The property Endpoint is required.

func (ShadowSourceParam) MarshalJSON added in v0.11.0

func (r ShadowSourceParam) MarshalJSON() (data []byte, err error)

func (*ShadowSourceParam) UnmarshalJSON added in v0.11.0

func (r *ShadowSourceParam) UnmarshalJSON(data []byte) error

type ShadowSourceResponse added in v0.13.0

type ShadowSourceResponse struct {
	// Endpoint-level source returned for a shadow experiment.
	Endpoint ShadowEndpointSourceResponse `json:"endpoint" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Endpoint    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Endpoint traffic source returned for a shadow experiment.

func (ShadowSourceResponse) RawJSON added in v0.13.0

func (r ShadowSourceResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ShadowSourceResponse) UnmarshalJSON added in v0.13.0

func (r *ShadowSourceResponse) UnmarshalJSON(data []byte) error

type ShadowUniformSamplingParam added in v0.11.0

type ShadowUniformSamplingParam struct {
	// Required fraction of requests to sample, from 0.0 to 1.0.
	Rate float64 `json:"rate" api:"required"`
	// contains filtered or unexported fields
}

Fixed-rate random sampling of endpoint requests.

The property Rate is required.

func (ShadowUniformSamplingParam) MarshalJSON added in v0.11.0

func (r ShadowUniformSamplingParam) MarshalJSON() (data []byte, err error)

func (*ShadowUniformSamplingParam) UnmarshalJSON added in v0.11.0

func (r *ShadowUniformSamplingParam) UnmarshalJSON(data []byte) error

type ShadowUniformSamplingResponse added in v0.13.0

type ShadowUniformSamplingResponse struct {
	// Fraction of requests sampled, from 0.0 to 1.0.
	Rate float64 `json:"rate"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Rate        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Fixed-rate random sampling returned by the API. A zero rate may be omitted by JSON serialization.

func (ShadowUniformSamplingResponse) RawJSON added in v0.13.0

Returns the unmodified JSON received from the API

func (*ShadowUniformSamplingResponse) UnmarshalJSON added in v0.13.0

func (r *ShadowUniformSamplingResponse) UnmarshalJSON(data []byte) error

type SupportedModel added in v0.11.0

type SupportedModel struct {
	// Unique ID of the deployable Together-hosted base model.
	ID string `json:"id" api:"required"`
	// Resource name for the base model as `projects/{projectId}/models/{modelId}`;
	// empty when unresolved.
	BaseModel string `json:"baseModel" api:"required"`
	// Bare model ID for the architecture's base model; empty when no base model is
	// linked.
	BaseModelID string `json:"baseModelId" api:"required"`
	// High-level tasks the model supports.
	//
	// Any of "CAPABILITY_CHAT", "CAPABILITY_EMBEDDING", "CAPABILITY_RERANKING",
	// "CAPABILITY_IMAGE_GENERATION", "CAPABILITY_VIDEO_GENERATION".
	Capabilities []string `json:"capabilities" api:"required"`
	// Timestamp when the catalog entry was created.
	CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
	// Certified deployment profiles available for the model.
	DeploymentProfiles []SupportedModelDeploymentProfile `json:"deploymentProfiles" api:"required"`
	// Catalog-controlled human-readable model name.
	DisplayName string `json:"displayName" api:"required"`
	// UI-facing model type badge, such as chat, language, code, image, embedding,
	// rerank, moderation, audio, video, or transcribe.
	DisplayType string `json:"displayType" api:"required"`
	// Input modalities supported by the model.
	//
	// Any of "MODALITY_TEXT", "MODALITY_IMAGE", "MODALITY_AUDIO", "MODALITY_VIDEO".
	InputModalities []string `json:"inputModalities" api:"required"`
	// Catalog-controlled HF model ID used for inference.
	Name string `json:"name" api:"required"`
	// Output modalities produced by the model.
	//
	// Any of "MODALITY_TEXT", "MODALITY_IMAGE", "MODALITY_AUDIO", "MODALITY_VIDEO".
	OutputModalities []string `json:"outputModalities" api:"required"`
	// Product surfaces where the model is offered.
	//
	// Any of "PRODUCT_SERVERLESS", "PRODUCT_DEDICATED", "PRODUCT_FINE_TUNING",
	// "PRODUCT_RESERVED".
	Products []string `json:"products" api:"required"`
	// Organization or publisher associated with the model.
	Publisher string `json:"publisher" api:"required"`
	// Catalog recommendation status for the model.
	//
	// Any of "SUPPORTED_MODEL_STATUS_RECOMMENDED", "SUPPORTED_MODEL_STATUS_SUPPORTED",
	// "SUPPORTED_MODEL_STATUS_DEPRECATED", "SUPPORTED_MODEL_STATUS_HIDDEN".
	Status SupportedModelStatus `json:"status" api:"required"`
	// Timestamp when the catalog entry was last updated.
	UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
	// Model architecture from the underlying weights metadata.
	Architecture string `json:"architecture"`
	// Maximum context length from the underlying weights metadata.
	ContextLength string `json:"contextLength"`
	// Human-readable model description.
	Description string `json:"description"`
	// Model family identifier for related catalog entries.
	FamilyID string `json:"familyId"`
	// Advanced features exposed by the model.
	//
	// Any of "FEATURE_TOOL_CALLING", "FEATURE_STRUCTURED_OUTPUT", "FEATURE_REASONING".
	Features []string `json:"features"`
	// Preferred input format for the model.
	InputFormat string `json:"inputFormat"`
	// Preferred output format for the model.
	OutputFormat string `json:"outputFormat"`
	// Serverless pricing in USD per one million tokens, if available.
	Pricing SupportedModelPricing `json:"pricing"`
	// Serverless endpoint name for inference, if available.
	ServerlessEndpoint string `json:"serverlessEndpoint"`
	// Searchable catalog tags for the model.
	Tags []string `json:"tags"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		BaseModel          respjson.Field
		BaseModelID        respjson.Field
		Capabilities       respjson.Field
		CreatedAt          respjson.Field
		DeploymentProfiles respjson.Field
		DisplayName        respjson.Field
		DisplayType        respjson.Field
		InputModalities    respjson.Field
		Name               respjson.Field
		OutputModalities   respjson.Field
		Products           respjson.Field
		Publisher          respjson.Field
		Status             respjson.Field
		UpdatedAt          respjson.Field
		Architecture       respjson.Field
		ContextLength      respjson.Field
		Description        respjson.Field
		FamilyID           respjson.Field
		Features           respjson.Field
		InputFormat        respjson.Field
		OutputFormat       respjson.Field
		Pricing            respjson.Field
		ServerlessEndpoint respjson.Field
		Tags               respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Curated catalog entry for a platform-supported model.

func (SupportedModel) RawJSON added in v0.11.0

func (r SupportedModel) RawJSON() string

Returns the unmodified JSON received from the API

func (*SupportedModel) UnmarshalJSON added in v0.11.0

func (r *SupportedModel) UnmarshalJSON(data []byte) error

type SupportedModelDeploymentProfile added in v0.11.0

type SupportedModelDeploymentProfile struct {
	// Certified configuration revision identifier.
	CertifiedConfigRevisionID string `json:"certifiedConfigRevisionId" api:"required"`
	// Certified model weight revision identifier, if available.
	CertifiedModelRevisionID string `json:"certifiedModelRevisionId" api:"required"`
	// Certified config revision in the form
	// `projects/{projectId}/configs/{configRevisionId}`. Omitted when the profile does
	// not pin a config.
	Config string `json:"config" api:"required"`
	// Number of GPUs required by the profile.
	GPUCount int64 `json:"gpuCount" api:"required"`
	// GPU instance type for the profile.
	GPUType string `json:"gpuType" api:"required"`
	// Deployable model resource in the form
	// `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omitted when
	// the profile does not pin model weights.
	Model string `json:"model" api:"required"`
	// Fully-qualified deploy model name in the form `{projectSlug}/{modelName}`, such
	// as `Qwen/Qwen3.5-9B-FP8`; empty when no public model is linked.
	ModelName string `json:"modelName" api:"required"`
	// Free-form parallelism spec for the profile, such as TP8, TP4, EP, or PD;
	// supersedes tensor_parallel_size.
	Parallelism string `json:"parallelism" api:"required"`
	// Performance benchmarks for the profile, if available.
	PerformanceBenchmarks SupportedModelPerformanceBenchmarks `json:"performanceBenchmarks" api:"required"`
	// Stable profile identifier, usually the certified config id.
	ProfileID string `json:"profileId" api:"required"`
	// Quantization method for the profile, if available.
	Quantization string `json:"quantization" api:"required"`
	// Adapter serving mode for deployments created from this profile; omitted when no
	// certified config is pinned.
	//
	// Any of "ADAPTER_MODE_FIXED", "ADAPTER_MODE_DYNAMIC", "ADAPTER_MODE_DISABLED".
	AdapterMode SupportedModelDeploymentProfileAdapterMode `json:"adapterMode"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CertifiedConfigRevisionID respjson.Field
		CertifiedModelRevisionID  respjson.Field
		Config                    respjson.Field
		GPUCount                  respjson.Field
		GPUType                   respjson.Field
		Model                     respjson.Field
		ModelName                 respjson.Field
		Parallelism               respjson.Field
		PerformanceBenchmarks     respjson.Field
		ProfileID                 respjson.Field
		Quantization              respjson.Field
		AdapterMode               respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Certified deployment profile for a supported model.

func (SupportedModelDeploymentProfile) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*SupportedModelDeploymentProfile) UnmarshalJSON added in v0.11.0

func (r *SupportedModelDeploymentProfile) UnmarshalJSON(data []byte) error

type SupportedModelDeploymentProfileAdapterMode added in v0.13.0

type SupportedModelDeploymentProfileAdapterMode string

Adapter serving mode for deployments created from this profile; omitted when no certified config is pinned.

const (
	SupportedModelDeploymentProfileAdapterModeAdapterModeFixed    SupportedModelDeploymentProfileAdapterMode = "ADAPTER_MODE_FIXED"
	SupportedModelDeploymentProfileAdapterModeAdapterModeDynamic  SupportedModelDeploymentProfileAdapterMode = "ADAPTER_MODE_DYNAMIC"
	SupportedModelDeploymentProfileAdapterModeAdapterModeDisabled SupportedModelDeploymentProfileAdapterMode = "ADAPTER_MODE_DISABLED"
)

type SupportedModelPerformanceBenchmarks added in v0.11.0

type SupportedModelPerformanceBenchmarks struct {
	// Decoding throughput in tokens per second.
	DecodingSpeedTps float64 `json:"decodingSpeedTps"`
	// Maximum context length supported by the profile.
	MaxContextLength string `json:"maxContextLength"`
	// Time to first token in milliseconds.
	TimeToFirstTokenMs int64 `json:"timeToFirstTokenMs"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DecodingSpeedTps   respjson.Field
		MaxContextLength   respjson.Field
		TimeToFirstTokenMs respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Performance benchmark metrics for a supported model profile.

func (SupportedModelPerformanceBenchmarks) RawJSON added in v0.11.0

Returns the unmodified JSON received from the API

func (*SupportedModelPerformanceBenchmarks) UnmarshalJSON added in v0.11.0

func (r *SupportedModelPerformanceBenchmarks) UnmarshalJSON(data []byte) error

type SupportedModelPricing added in v0.13.0

type SupportedModelPricing struct {
	// Price in USD per one million cached input tokens.
	CachedInput float64 `json:"cachedInput"`
	// Price in USD per one million input tokens.
	Input float64 `json:"input"`
	// Price in USD per one million output tokens.
	Output float64 `json:"output"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CachedInput respjson.Field
		Input       respjson.Field
		Output      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Serverless pricing in USD per one million tokens, if available.

func (SupportedModelPricing) RawJSON added in v0.13.0

func (r SupportedModelPricing) RawJSON() string

Returns the unmodified JSON received from the API

func (*SupportedModelPricing) UnmarshalJSON added in v0.13.0

func (r *SupportedModelPricing) UnmarshalJSON(data []byte) error

type SupportedModelStatus added in v0.11.0

type SupportedModelStatus string

Catalog recommendation status for the model.

const (
	SupportedModelStatusSupportedModelStatusRecommended SupportedModelStatus = "SUPPORTED_MODEL_STATUS_RECOMMENDED"
	SupportedModelStatusSupportedModelStatusSupported   SupportedModelStatus = "SUPPORTED_MODEL_STATUS_SUPPORTED"
	SupportedModelStatusSupportedModelStatusDeprecated  SupportedModelStatus = "SUPPORTED_MODEL_STATUS_DEPRECATED"
	SupportedModelStatusSupportedModelStatusHidden      SupportedModelStatus = "SUPPORTED_MODEL_STATUS_HIDDEN"
)

type ThresholdCheck added in v0.13.0

type ThresholdCheck struct {
	// Required comparison operator applied to the target metric value.
	//
	// Any of "THRESHOLD_OPERATOR_GT", "THRESHOLD_OPERATOR_GTE",
	// "THRESHOLD_OPERATOR_LT", "THRESHOLD_OPERATOR_LTE".
	Operator ThresholdCheckOperator `json:"operator" api:"required"`
	// Finite threshold value. Interpreted in the metric's unit: router_error_rate is a
	// ratio in [0, 1], router_latency is milliseconds, and inflight_requests is
	// in-flight requests per ready replica averaged over the rule window. Thresholds
	// that no achievable value could pass, or that every achievable value passes, are
	// rejected at create.
	//
	// Omitting this value is read as 0. Set 0 explicitly for the strictest threshold:
	// nothing at all is tolerated.
	Value float64 `json:"value"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Operator    respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Threshold criteria that fail when the target metric violates the configured bound.

func (ThresholdCheck) RawJSON added in v0.13.0

func (r ThresholdCheck) RawJSON() string

Returns the unmodified JSON received from the API

func (ThresholdCheck) ToParam added in v0.13.0

func (r ThresholdCheck) ToParam() ThresholdCheckParam

ToParam converts this ThresholdCheck to a ThresholdCheckParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ThresholdCheckParam.Overrides()

func (*ThresholdCheck) UnmarshalJSON added in v0.13.0

func (r *ThresholdCheck) UnmarshalJSON(data []byte) error

type ThresholdCheckOperator added in v0.13.0

type ThresholdCheckOperator string

Required comparison operator applied to the target metric value.

const (
	ThresholdCheckOperatorThresholdOperatorGt  ThresholdCheckOperator = "THRESHOLD_OPERATOR_GT"
	ThresholdCheckOperatorThresholdOperatorGte ThresholdCheckOperator = "THRESHOLD_OPERATOR_GTE"
	ThresholdCheckOperatorThresholdOperatorLt  ThresholdCheckOperator = "THRESHOLD_OPERATOR_LT"
	ThresholdCheckOperatorThresholdOperatorLte ThresholdCheckOperator = "THRESHOLD_OPERATOR_LTE"
)

type ThresholdCheckParam added in v0.13.0

type ThresholdCheckParam struct {
	// Required comparison operator applied to the target metric value.
	//
	// Any of "THRESHOLD_OPERATOR_GT", "THRESHOLD_OPERATOR_GTE",
	// "THRESHOLD_OPERATOR_LT", "THRESHOLD_OPERATOR_LTE".
	Operator ThresholdCheckOperator `json:"operator,omitzero" api:"required"`
	// Finite threshold value. Interpreted in the metric's unit: router_error_rate is a
	// ratio in [0, 1], router_latency is milliseconds, and inflight_requests is
	// in-flight requests per ready replica averaged over the rule window. Thresholds
	// that no achievable value could pass, or that every achievable value passes, are
	// rejected at create.
	//
	// Omitting this value is read as 0. Set 0 explicitly for the strictest threshold:
	// nothing at all is tolerated.
	Value param.Opt[float64] `json:"value,omitzero"`
	// contains filtered or unexported fields
}

Threshold criteria that fail when the target metric violates the configured bound.

The property Operator is required.

func (ThresholdCheckParam) MarshalJSON added in v0.13.0

func (r ThresholdCheckParam) MarshalJSON() (data []byte, err error)

func (*ThresholdCheckParam) UnmarshalJSON added in v0.13.0

func (r *ThresholdCheckParam) UnmarshalJSON(data []byte) error

type ThroughputMetrics added in v0.13.0

type ThroughputMetrics struct {
	// Average number of batches queued or in flight in the serving engine.
	AvgBatchDepth float64 `json:"avgBatchDepth"`
	// Average number of requests processed in each runtime batch.
	AvgBatchSize float64 `json:"avgBatchSize"`
	// Average completed requests per second.
	RequestsPerSecond float64 `json:"requestsPerSecond"`
	// Average generated tokens per second.
	TokensPerSecond float64 `json:"tokensPerSecond"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AvgBatchDepth     respjson.Field
		AvgBatchSize      respjson.Field
		RequestsPerSecond respjson.Field
		TokensPerSecond   respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Token, request, and batching throughput over a time range.

func (ThroughputMetrics) RawJSON added in v0.13.0

func (r ThroughputMetrics) RawJSON() string

Returns the unmodified JSON received from the API

func (*ThroughputMetrics) UnmarshalJSON added in v0.13.0

func (r *ThroughputMetrics) UnmarshalJSON(data []byte) error

type TimeSeriesDataPoint added in v0.13.0

type TimeSeriesDataPoint struct {
	// Start time of the metric bucket.
	Timestamp time.Time `json:"timestamp" format:"date-time"`
	// Metric names mapped to their numeric values for this bucket.
	Values map[string]float64 `json:"values"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Timestamp   respjson.Field
		Values      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Timestamped bucket containing one or more named metric values.

func (TimeSeriesDataPoint) RawJSON added in v0.13.0

func (r TimeSeriesDataPoint) RawJSON() string

Returns the unmodified JSON received from the API

func (*TimeSeriesDataPoint) UnmarshalJSON added in v0.13.0

func (r *TimeSeriesDataPoint) UnmarshalJSON(data []byte) error

type TokenMetrics added in v0.13.0

type TokenMetrics struct {
	// Average input tokens per request.
	AvgInputTokens float64 `json:"avgInputTokens"`
	// Average output tokens per request.
	AvgOutputTokens float64 `json:"avgOutputTokens"`
	// Total input tokens processed during the time range.
	TotalInputTokens string `json:"totalInputTokens"`
	// Total output tokens generated during the time range.
	TotalOutputTokens string `json:"totalOutputTokens"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AvgInputTokens    respjson.Field
		AvgOutputTokens   respjson.Field
		TotalInputTokens  respjson.Field
		TotalOutputTokens respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Aggregate and per-request token usage over a time range.

func (TokenMetrics) RawJSON added in v0.13.0

func (r TokenMetrics) RawJSON() string

Returns the unmodified JSON received from the API

func (*TokenMetrics) UnmarshalJSON added in v0.13.0

func (r *TokenMetrics) UnmarshalJSON(data []byte) error

type ToolChoice

type ToolChoice struct {
	ID       string             `json:"id" api:"required"`
	Function ToolChoiceFunction `json:"function" api:"required"`
	Index    float64            `json:"index" api:"required"`
	// Any of "function".
	Type ToolChoiceType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Function    respjson.Field
		Index       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ToolChoice) RawJSON

func (r ToolChoice) RawJSON() string

Returns the unmodified JSON received from the API

func (ToolChoice) ToParam

func (r ToolChoice) ToParam() ToolChoiceParam

ToParam converts this ToolChoice to a ToolChoiceParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ToolChoiceParam.Overrides()

func (*ToolChoice) UnmarshalJSON

func (r *ToolChoice) UnmarshalJSON(data []byte) error

type ToolChoiceFunction

type ToolChoiceFunction struct {
	Arguments string `json:"arguments" api:"required"`
	Name      string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Arguments   respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ToolChoiceFunction) RawJSON

func (r ToolChoiceFunction) RawJSON() string

Returns the unmodified JSON received from the API

func (*ToolChoiceFunction) UnmarshalJSON

func (r *ToolChoiceFunction) UnmarshalJSON(data []byte) error

type ToolChoiceFunctionParam

type ToolChoiceFunctionParam struct {
	Arguments string `json:"arguments" api:"required"`
	Name      string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

The properties Arguments, Name are required.

func (ToolChoiceFunctionParam) MarshalJSON

func (r ToolChoiceFunctionParam) MarshalJSON() (data []byte, err error)

func (*ToolChoiceFunctionParam) UnmarshalJSON

func (r *ToolChoiceFunctionParam) UnmarshalJSON(data []byte) error

type ToolChoiceParam

type ToolChoiceParam struct {
	ID       string                  `json:"id" api:"required"`
	Function ToolChoiceFunctionParam `json:"function,omitzero" api:"required"`
	Index    float64                 `json:"index" api:"required"`
	// Any of "function".
	Type ToolChoiceType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties ID, Function, Index, Type are required.

func (ToolChoiceParam) MarshalJSON

func (r ToolChoiceParam) MarshalJSON() (data []byte, err error)

func (*ToolChoiceParam) UnmarshalJSON

func (r *ToolChoiceParam) UnmarshalJSON(data []byte) error

type ToolChoiceType

type ToolChoiceType string
const (
	ToolChoiceTypeFunction ToolChoiceType = "function"
)

type ToolsFunctionParam

type ToolsFunctionParam struct {
	Description param.Opt[string] `json:"description,omitzero"`
	Name        param.Opt[string] `json:"name,omitzero"`
	// A map of parameter names to their values.
	Parameters map[string]any `json:"parameters,omitzero"`
	// contains filtered or unexported fields
}

func (ToolsFunctionParam) MarshalJSON

func (r ToolsFunctionParam) MarshalJSON() (data []byte, err error)

func (*ToolsFunctionParam) UnmarshalJSON

func (r *ToolsFunctionParam) UnmarshalJSON(data []byte) error

type ToolsParam

type ToolsParam struct {
	Type     param.Opt[string]  `json:"type,omitzero"`
	Function ToolsFunctionParam `json:"function,omitzero"`
	// contains filtered or unexported fields
}

func (ToolsParam) MarshalJSON

func (r ToolsParam) MarshalJSON() (data []byte, err error)

func (*ToolsParam) UnmarshalJSON

func (r *ToolsParam) UnmarshalJSON(data []byte) error

type VideoJob

type VideoJob struct {
	// Unique identifier for the video job.
	ID string `json:"id" api:"required"`
	// Unix timestamp (seconds) for when the job was created.
	CreatedAt float64 `json:"created_at" api:"required"`
	// The video generation model that produced the job.
	Model string `json:"model" api:"required"`
	// Duration of the generated clip in seconds.
	Seconds string `json:"seconds" api:"required"`
	// The resolution of the generated video.
	Size string `json:"size" api:"required"`
	// Current lifecycle status of the video job.
	//
	// Any of "in_progress", "completed", "failed".
	Status VideoJobStatus `json:"status" api:"required"`
	// Unix timestamp (seconds) for when the job completed, if finished.
	CompletedAt float64 `json:"completed_at"`
	// Error payload that explains why generation failed, if applicable.
	Error VideoJobError `json:"error"`
	// The object type, which is always video.
	//
	// Any of "video".
	Object VideoJobObject `json:"object"`
	// Available upon completion, the outputs provides the cost charged and the hosted
	// url to access the video
	Outputs VideoJobOutputs `json:"outputs"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Model       respjson.Field
		Seconds     respjson.Field
		Size        respjson.Field
		Status      respjson.Field
		CompletedAt respjson.Field
		Error       respjson.Field
		Object      respjson.Field
		Outputs     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Structured information describing a generated video job.

func (VideoJob) RawJSON

func (r VideoJob) RawJSON() string

Returns the unmodified JSON received from the API

func (*VideoJob) UnmarshalJSON

func (r *VideoJob) UnmarshalJSON(data []byte) error

type VideoJobError

type VideoJobError struct {
	Message string `json:"message" api:"required"`
	Code    string `json:"code"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Code        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error payload that explains why generation failed, if applicable.

func (VideoJobError) RawJSON

func (r VideoJobError) RawJSON() string

Returns the unmodified JSON received from the API

func (*VideoJobError) UnmarshalJSON

func (r *VideoJobError) UnmarshalJSON(data []byte) error

type VideoJobObject

type VideoJobObject string

The object type, which is always video.

const (
	VideoJobObjectVideo VideoJobObject = "video"
)

type VideoJobOutputs

type VideoJobOutputs struct {
	// The cost of generated video charged to the owners account.
	Cost int64 `json:"cost" api:"required"`
	// URL hosting the generated video
	VideoURL string `json:"video_url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cost        respjson.Field
		VideoURL    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Available upon completion, the outputs provides the cost charged and the hosted url to access the video

func (VideoJobOutputs) RawJSON

func (r VideoJobOutputs) RawJSON() string

Returns the unmodified JSON received from the API

func (*VideoJobOutputs) UnmarshalJSON

func (r *VideoJobOutputs) UnmarshalJSON(data []byte) error

type VideoJobStatus

type VideoJobStatus string

Current lifecycle status of the video job.

const (
	VideoJobStatusInProgress VideoJobStatus = "in_progress"
	VideoJobStatusCompleted  VideoJobStatus = "completed"
	VideoJobStatusFailed     VideoJobStatus = "failed"
)

type VideoNewParams

type VideoNewParams struct {
	// The model to be used for the video creation request.
	Model string `json:"model" api:"required"`
	// Frames per second. Defaults to 24.
	Fps param.Opt[int64] `json:"fps,omitzero"`
	// Whether to generate audio for the video.
	GenerateAudio param.Opt[bool] `json:"generate_audio,omitzero"`
	// Controls how closely the video generation follows your prompt. Higher values
	// make the model adhere more strictly to your text description, while lower values
	// allow more creative freedom. guidence_scale affects both visual content and
	// temporal consistency.Recommended range is 6.0-10.0 for most video models. Values
	// above 12 may cause over-guidance artifacts or unnatural motion patterns.
	GuidanceScale param.Opt[int64] `json:"guidance_scale,omitzero"`
	Height        param.Opt[int64] `json:"height,omitzero"`
	// Similar to prompt, but specifies what to avoid instead of what to include
	NegativePrompt param.Opt[string] `json:"negative_prompt,omitzero"`
	// Compression quality. Defaults to 20.
	OutputQuality param.Opt[int64] `json:"output_quality,omitzero"`
	// Text prompt that describes the video to generate.
	Prompt param.Opt[string] `json:"prompt,omitzero"`
	// Aspect ratio of the video.
	Ratio param.Opt[string] `json:"ratio,omitzero"`
	// Video resolution.
	Resolution param.Opt[string] `json:"resolution,omitzero"`
	// Clip duration in seconds.
	Seconds param.Opt[string] `json:"seconds,omitzero"`
	// Seed to use in initializing the video generation. Using the same seed allows
	// deterministic video generation. If not provided a random seed is generated for
	// each request.
	Seed param.Opt[int64] `json:"seed,omitzero"`
	// The number of denoising steps the model performs during video generation. More
	// steps typically result in higher quality output but require longer processing
	// time.
	Steps param.Opt[int64] `json:"steps,omitzero"`
	Width param.Opt[int64] `json:"width,omitzero"`
	// Media inputs for video generation. The accepted fields depend on the model type
	// (e.g. i2v, r2v, t2v, videoedit).
	Media VideoNewParamsMedia `json:"media,omitzero"`
	// Specifies the format of the output video. Defaults to MP4.
	//
	// Any of "MP4", "WEBM".
	OutputFormat VideoNewParamsOutputFormat `json:"output_format,omitzero"`
	// contains filtered or unexported fields
}

func (VideoNewParams) MarshalJSON

func (r VideoNewParams) MarshalJSON() (data []byte, err error)

func (*VideoNewParams) UnmarshalJSON

func (r *VideoNewParams) UnmarshalJSON(data []byte) error

type VideoNewParamsMedia added in v0.9.0

type VideoNewParamsMedia struct {
	// Array of audio inputs. Each element accepts a URL string or an object with an
	// "audio" key.
	AudioInputs []VideoNewParamsMediaAudioInputUnion `json:"audio_inputs,omitzero"`
	// Array of images to guide video generation at specific timeline positions.
	FrameImages []VideoNewParamsMediaFrameImage `json:"frame_images,omitzero"`
	// Array of video clips to use as starting clips.
	FrameVideos []VideoNewParamsMediaFrameVideo `json:"frame_videos,omitzero"`
	// Array of image URLs that guide the general appearance across the video.
	ReferenceImages []string `json:"reference_images,omitzero"`
	// Array of reference videos.
	ReferenceVideos []VideoNewParamsMediaReferenceVideo `json:"reference_videos,omitzero"`
	// Source video to edit. Accepts a URL string or an object with a "video" key.
	SourceVideo VideoNewParamsMediaSourceVideoUnion `json:"source_video,omitzero"`
	// contains filtered or unexported fields
}

Media inputs for video generation. The accepted fields depend on the model type (e.g. i2v, r2v, t2v, videoedit).

func (VideoNewParamsMedia) MarshalJSON added in v0.9.0

func (r VideoNewParamsMedia) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsMedia) UnmarshalJSON added in v0.9.0

func (r *VideoNewParamsMedia) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaAudioInputAudioRef added in v0.10.0

type VideoNewParamsMediaAudioInputAudioRef struct {
	// URL of the audio.
	Audio string `json:"audio" api:"required"`
	// contains filtered or unexported fields
}

The property Audio is required.

func (VideoNewParamsMediaAudioInputAudioRef) MarshalJSON added in v0.10.0

func (r VideoNewParamsMediaAudioInputAudioRef) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsMediaAudioInputAudioRef) UnmarshalJSON added in v0.10.0

func (r *VideoNewParamsMediaAudioInputAudioRef) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaAudioInputUnion added in v0.10.0

type VideoNewParamsMediaAudioInputUnion struct {
	OfString                           param.Opt[string]                      `json:",omitzero,inline"`
	OfVideoNewsMediaAudioInputAudioRef *VideoNewParamsMediaAudioInputAudioRef `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (VideoNewParamsMediaAudioInputUnion) MarshalJSON added in v0.10.0

func (u VideoNewParamsMediaAudioInputUnion) MarshalJSON() ([]byte, error)

func (*VideoNewParamsMediaAudioInputUnion) UnmarshalJSON added in v0.10.0

func (u *VideoNewParamsMediaAudioInputUnion) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaFrameImage added in v0.9.0

type VideoNewParamsMediaFrameImage struct {
	// URL path to hosted image that is used for a frame
	InputImage string `json:"input_image" api:"required"`
	// Optional param to specify where to insert the frame. If this is omitted, the
	// following heuristics are applied:
	//
	// - frame_images size is one, frame is first.
	// - If size is two, frames are first and last.
	// - If size is larger, frames are first, last and evenly spaced between.
	Frame VideoNewParamsMediaFrameImageFrameUnion `json:"frame,omitzero"`
	// contains filtered or unexported fields
}

The property InputImage is required.

func (VideoNewParamsMediaFrameImage) MarshalJSON added in v0.9.0

func (r VideoNewParamsMediaFrameImage) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsMediaFrameImage) UnmarshalJSON added in v0.9.0

func (r *VideoNewParamsMediaFrameImage) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaFrameImageFrameString added in v0.9.0

type VideoNewParamsMediaFrameImageFrameString string
const (
	VideoNewParamsMediaFrameImageFrameStringFirst VideoNewParamsMediaFrameImageFrameString = "first"
	VideoNewParamsMediaFrameImageFrameStringLast  VideoNewParamsMediaFrameImageFrameString = "last"
)

type VideoNewParamsMediaFrameImageFrameUnion added in v0.9.0

type VideoNewParamsMediaFrameImageFrameUnion struct {
	OfFloat param.Opt[float64] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfVideoNewsMediaFrameImageFrameString)
	OfVideoNewsMediaFrameImageFrameString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (VideoNewParamsMediaFrameImageFrameUnion) MarshalJSON added in v0.9.0

func (u VideoNewParamsMediaFrameImageFrameUnion) MarshalJSON() ([]byte, error)

func (*VideoNewParamsMediaFrameImageFrameUnion) UnmarshalJSON added in v0.9.0

func (u *VideoNewParamsMediaFrameImageFrameUnion) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaFrameVideo added in v0.9.0

type VideoNewParamsMediaFrameVideo struct {
	// URL of the video.
	Video string `json:"video" api:"required"`
	// contains filtered or unexported fields
}

The property Video is required.

func (VideoNewParamsMediaFrameVideo) MarshalJSON added in v0.9.0

func (r VideoNewParamsMediaFrameVideo) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsMediaFrameVideo) UnmarshalJSON added in v0.9.0

func (r *VideoNewParamsMediaFrameVideo) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaReferenceVideo added in v0.9.0

type VideoNewParamsMediaReferenceVideo struct {
	// URL of the video.
	Video string `json:"video" api:"required"`
	// contains filtered or unexported fields
}

The property Video is required.

func (VideoNewParamsMediaReferenceVideo) MarshalJSON added in v0.9.0

func (r VideoNewParamsMediaReferenceVideo) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsMediaReferenceVideo) UnmarshalJSON added in v0.9.0

func (r *VideoNewParamsMediaReferenceVideo) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaSourceVideoUnion added in v0.10.0

type VideoNewParamsMediaSourceVideoUnion struct {
	OfString                            param.Opt[string]                       `json:",omitzero,inline"`
	OfVideoNewsMediaSourceVideoVideoRef *VideoNewParamsMediaSourceVideoVideoRef `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (VideoNewParamsMediaSourceVideoUnion) MarshalJSON added in v0.10.0

func (u VideoNewParamsMediaSourceVideoUnion) MarshalJSON() ([]byte, error)

func (*VideoNewParamsMediaSourceVideoUnion) UnmarshalJSON added in v0.10.0

func (u *VideoNewParamsMediaSourceVideoUnion) UnmarshalJSON(data []byte) error

type VideoNewParamsMediaSourceVideoVideoRef added in v0.10.0

type VideoNewParamsMediaSourceVideoVideoRef struct {
	// URL of the video.
	Video string `json:"video" api:"required"`
	// contains filtered or unexported fields
}

The property Video is required.

func (VideoNewParamsMediaSourceVideoVideoRef) MarshalJSON added in v0.10.0

func (r VideoNewParamsMediaSourceVideoVideoRef) MarshalJSON() (data []byte, err error)

func (*VideoNewParamsMediaSourceVideoVideoRef) UnmarshalJSON added in v0.10.0

func (r *VideoNewParamsMediaSourceVideoVideoRef) UnmarshalJSON(data []byte) error

type VideoNewParamsOutputFormat

type VideoNewParamsOutputFormat string

Specifies the format of the output video. Defaults to MP4.

const (
	VideoNewParamsOutputFormatMP4  VideoNewParamsOutputFormat = "MP4"
	VideoNewParamsOutputFormatWebm VideoNewParamsOutputFormat = "WEBM"
)

type VideoService

type VideoService struct {
	Options []option.RequestOption
}

VideoService contains methods and other services that help with interacting with the together API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVideoService method instead.

func NewVideoService

func NewVideoService(opts ...option.RequestOption) (r VideoService)

NewVideoService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*VideoService) Get

func (r *VideoService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *VideoJob, err error)

Fetch video metadata

func (*VideoService) New

func (r *VideoService) New(ctx context.Context, body VideoNewParams, opts ...option.RequestOption) (res *VideoJob, err error)

Create a video

type Volume added in v0.6.0

type Volume struct {
	// ID is the unique identifier for this volume
	ID string `json:"id"`
	// Content currently available on a volume version.
	Content VolumeContent `json:"content"`
	// CreatedAt is the ISO8601 timestamp when this volume was created
	CreatedAt string `json:"created_at"`
	// CurrentVersion is the current version number of this volume
	CurrentVersion int64 `json:"current_version"`
	// MountedBy is the list of deployment IDs currently mounting current volume
	// version
	MountedBy []string `json:"mounted_by"`
	// Name is the name of the volume
	Name string `json:"name"`
	// Object is the type identifier for this response (always "volume")
	Object string `json:"object"`
	// Status of the current volume version.
	//
	// Any of "ready", "pending", "syncing", "failed".
	Status VolumeStatus `json:"status"`
	// Message explaining why the current volume version failed, when applicable.
	StatusMessage string `json:"status_message"`
	// Any of "readOnly".
	Type VolumeType `json:"type"`
	// UpdatedAt is the ISO8601 timestamp when this volume was last updated
	UpdatedAt string `json:"updated_at"`
	// VersionHistory contains previous versions of this volume, keyed by version
	// number
	VersionHistory map[string]VolumeVersionHistory `json:"version_history"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Content        respjson.Field
		CreatedAt      respjson.Field
		CurrentVersion respjson.Field
		MountedBy      respjson.Field
		Name           respjson.Field
		Object         respjson.Field
		Status         respjson.Field
		StatusMessage  respjson.Field
		Type           respjson.Field
		UpdatedAt      respjson.Field
		VersionHistory respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Volume) RawJSON added in v0.6.0

func (r Volume) RawJSON() string

Returns the unmodified JSON received from the API

func (*Volume) UnmarshalJSON added in v0.6.0

func (r *Volume) UnmarshalJSON(data []byte) error

type VolumeContent added in v0.6.0

type VolumeContent struct {
	// Files is the list of files to preload into the volume, if the volume content
	// type is "files".
	Files []VolumeContentFile `json:"files"`
	// External source Together copied into this volume version.
	Origin VolumeOrigin `json:"origin"`
	// SourcePrefix is the file path prefix for the content to be preloaded into the
	// volume
	SourcePrefix string `json:"source_prefix"`
	// Type is the content type (currently only "files" is supported which allows
	// preloading files uploaded via Files API into the volume)
	//
	// Any of "files".
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Files        respjson.Field
		Origin       respjson.Field
		SourcePrefix respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Content currently available on a volume version.

func (VolumeContent) RawJSON added in v0.6.0

func (r VolumeContent) RawJSON() string

Returns the unmodified JSON received from the API

func (*VolumeContent) UnmarshalJSON added in v0.6.0

func (r *VolumeContent) UnmarshalJSON(data []byte) error

type VolumeContentFile added in v0.7.0

type VolumeContentFile struct {
	// LastModified is the timestamp when the file was last modified
	LastModified string `json:"last_modified"`
	// Name is the filename including extension (e.g., "model_weights.bin")
	Name string `json:"name"`
	// Size is the file size in bytes
	Size int64 `json:"size"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LastModified respjson.Field
		Name         respjson.Field
		Size         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (VolumeContentFile) RawJSON added in v0.7.0

func (r VolumeContentFile) RawJSON() string

Returns the unmodified JSON received from the API

func (*VolumeContentFile) UnmarshalJSON added in v0.7.0

func (r *VolumeContentFile) UnmarshalJSON(data []byte) error

type VolumeOrigin added in v0.13.0

type VolumeOrigin struct {
	// S3 bucket or prefix source for the volume sync.
	S3 S3Origin `json:"s3" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		S3          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

External source Together copies into a new volume version.

func (VolumeOrigin) RawJSON added in v0.13.0

func (r VolumeOrigin) RawJSON() string

Returns the unmodified JSON received from the API

func (VolumeOrigin) ToParam added in v0.13.0

func (r VolumeOrigin) ToParam() VolumeOriginParam

ToParam converts this VolumeOrigin to a VolumeOriginParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with VolumeOriginParam.Overrides()

func (*VolumeOrigin) UnmarshalJSON added in v0.13.0

func (r *VolumeOrigin) UnmarshalJSON(data []byte) error

type VolumeOriginParam added in v0.13.0

type VolumeOriginParam struct {
	// S3 bucket or prefix source for the volume sync.
	S3 S3OriginParam `json:"s3,omitzero" api:"required"`
	// contains filtered or unexported fields
}

External source Together copies into a new volume version.

The property S3 is required.

func (VolumeOriginParam) MarshalJSON added in v0.13.0

func (r VolumeOriginParam) MarshalJSON() (data []byte, err error)

func (*VolumeOriginParam) UnmarshalJSON added in v0.13.0

func (r *VolumeOriginParam) UnmarshalJSON(data []byte) error

type VolumeStatus added in v0.13.0

type VolumeStatus string

Status of a volume version. Only ready versions can be mounted.

const (
	VolumeStatusReady   VolumeStatus = "ready"
	VolumeStatusPending VolumeStatus = "pending"
	VolumeStatusSyncing VolumeStatus = "syncing"
	VolumeStatusFailed  VolumeStatus = "failed"
)

type VolumeType added in v0.6.0

type VolumeType string
const (
	VolumeTypeReadOnly VolumeType = "readOnly"
)

type VolumeVersionHistory added in v0.7.0

type VolumeVersionHistory struct {
	// Content configuration used to create this version.
	Content VolumeVersionHistoryContent `json:"content"`
	// Deployment IDs currently mounting this version.
	MountedBy []string `json:"mounted_by"`
	// Status of this volume version.
	//
	// Any of "ready", "pending", "syncing", "failed".
	Status VolumeStatus `json:"status"`
	// Message explaining why this volume version failed, when applicable.
	StatusMessage string `json:"status_message"`
	// Numeric version identifier for this volume content.
	Version int64 `json:"version"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content       respjson.Field
		MountedBy     respjson.Field
		Status        respjson.Field
		StatusMessage respjson.Field
		Version       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata for a previous volume version.

func (VolumeVersionHistory) RawJSON added in v0.7.0

func (r VolumeVersionHistory) RawJSON() string

Returns the unmodified JSON received from the API

func (*VolumeVersionHistory) UnmarshalJSON added in v0.7.0

func (r *VolumeVersionHistory) UnmarshalJSON(data []byte) error

type VolumeVersionHistoryContent added in v0.7.0

type VolumeVersionHistoryContent struct {
	// External source Together copies into a new volume version; mutually exclusive
	// with source_prefix.
	Origin VolumeOrigin `json:"origin"`
	// SourcePrefix is the file path prefix for the content to be preloaded into the
	// volume. Mutually exclusive with Origin
	SourcePrefix string `json:"source_prefix"`
	// Type is the content type (currently only "files" is supported which allows
	// preloading files uploaded via Files API into the volume)
	//
	// Any of "files".
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Origin       respjson.Field
		SourcePrefix respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Content configuration used to create this version.

func (VolumeVersionHistoryContent) RawJSON added in v0.7.0

func (r VolumeVersionHistoryContent) RawJSON() string

Returns the unmodified JSON received from the API

func (*VolumeVersionHistoryContent) UnmarshalJSON added in v0.7.0

func (r *VolumeVersionHistoryContent) UnmarshalJSON(data []byte) error

type WhoamiAPIKey added in v0.13.0

type WhoamiAPIKey struct {
	// The authenticated API key identifier.
	ID string `json:"id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WhoamiAPIKey) RawJSON added in v0.13.0

func (r WhoamiAPIKey) RawJSON() string

Returns the unmodified JSON received from the API

func (*WhoamiAPIKey) UnmarshalJSON added in v0.13.0

func (r *WhoamiAPIKey) UnmarshalJSON(data []byte) error

type WhoamiOrgAPIKey added in v0.13.0

type WhoamiOrgAPIKey struct {
	APIKey       WhoamiAPIKey       `json:"api_key" api:"required"`
	Organization WhoamiOrganization `json:"organization" api:"required"`
	// Always `org_api_key`.
	Type constant.OrgAPIKey `json:"type" default:"org_api_key"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		APIKey       respjson.Field
		Organization respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WhoamiOrgAPIKey) RawJSON added in v0.13.0

func (r WhoamiOrgAPIKey) RawJSON() string

Returns the unmodified JSON received from the API

func (*WhoamiOrgAPIKey) UnmarshalJSON added in v0.13.0

func (r *WhoamiOrgAPIKey) UnmarshalJSON(data []byte) error

type WhoamiOrganization added in v0.13.0

type WhoamiOrganization struct {
	// Organization identifier.
	ID string `json:"id" api:"required"`
	// Organization display name.
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WhoamiOrganization) RawJSON added in v0.13.0

func (r WhoamiOrganization) RawJSON() string

Returns the unmodified JSON received from the API

func (*WhoamiOrganization) UnmarshalJSON added in v0.13.0

func (r *WhoamiOrganization) UnmarshalJSON(data []byte) error

type WhoamiProject added in v0.13.0

type WhoamiProject struct {
	// Project identifier.
	ID string `json:"id" api:"required"`
	// Project display name.
	Name string `json:"name" api:"required"`
	// DNS-friendly project identifier. Used with an endpoint slug as
	// `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint
	// inference calls.
	Slug string `json:"slug" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		Slug        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WhoamiProject) RawJSON added in v0.13.0

func (r WhoamiProject) RawJSON() string

Returns the unmodified JSON received from the API

func (*WhoamiProject) UnmarshalJSON added in v0.13.0

func (r *WhoamiProject) UnmarshalJSON(data []byte) error

type WhoamiProjectAPIKey added in v0.13.0

type WhoamiProjectAPIKey struct {
	APIKey       WhoamiAPIKey       `json:"api_key" api:"required"`
	Organization WhoamiOrganization `json:"organization" api:"required"`
	Project      WhoamiProject      `json:"project" api:"required"`
	// Always `project_api_key`.
	Type constant.ProjectAPIKey `json:"type" default:"project_api_key"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		APIKey       respjson.Field
		Organization respjson.Field
		Project      respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WhoamiProjectAPIKey) RawJSON added in v0.13.0

func (r WhoamiProjectAPIKey) RawJSON() string

Returns the unmodified JSON received from the API

func (*WhoamiProjectAPIKey) UnmarshalJSON added in v0.13.0

func (r *WhoamiProjectAPIKey) UnmarshalJSON(data []byte) error

type WhoamiResponseUnion added in v0.13.0

type WhoamiResponseUnion struct {
	// This field is from variant [WhoamiProjectAPIKey].
	APIKey WhoamiAPIKey `json:"api_key"`
	// This field is from variant [WhoamiProjectAPIKey].
	Organization WhoamiOrganization `json:"organization"`
	// This field is from variant [WhoamiProjectAPIKey].
	Project WhoamiProject `json:"project"`
	// Any of "project_api_key", "org_api_key", "user_jwt", "user_org_jwt",
	// "user_org_project_jwt".
	Type string `json:"type"`
	// This field is from variant [WhoamiUserJwt].
	User WhoamiUser `json:"user"`
	JSON struct {
		APIKey       respjson.Field
		Organization respjson.Field
		Project      respjson.Field
		Type         respjson.Field
		User         respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WhoamiResponseUnion contains all possible properties and values from WhoamiProjectAPIKey, WhoamiOrgAPIKey, WhoamiUserJwt, WhoamiUserOrgJwt, WhoamiUserOrgProjectJwt.

Use the WhoamiResponseUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (WhoamiResponseUnion) AsAny added in v0.13.0

func (u WhoamiResponseUnion) AsAny() anyWhoamiResponse

Use the following switch statement to find the correct variant

switch variant := WhoamiResponseUnion.AsAny().(type) {
case together.WhoamiProjectAPIKey:
case together.WhoamiOrgAPIKey:
case together.WhoamiUserJwt:
case together.WhoamiUserOrgJwt:
case together.WhoamiUserOrgProjectJwt:
default:
  fmt.Errorf("no variant present")
}

func (WhoamiResponseUnion) AsOrgAPIKey added in v0.13.0

func (u WhoamiResponseUnion) AsOrgAPIKey() (v WhoamiOrgAPIKey)

func (WhoamiResponseUnion) AsProjectAPIKey added in v0.13.0

func (u WhoamiResponseUnion) AsProjectAPIKey() (v WhoamiProjectAPIKey)

func (WhoamiResponseUnion) AsUserJwt added in v0.13.0

func (u WhoamiResponseUnion) AsUserJwt() (v WhoamiUserJwt)

func (WhoamiResponseUnion) AsUserOrgJwt added in v0.13.0

func (u WhoamiResponseUnion) AsUserOrgJwt() (v WhoamiUserOrgJwt)

func (WhoamiResponseUnion) AsUserOrgProjectJwt added in v0.13.0

func (u WhoamiResponseUnion) AsUserOrgProjectJwt() (v WhoamiUserOrgProjectJwt)

func (WhoamiResponseUnion) RawJSON added in v0.13.0

func (u WhoamiResponseUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*WhoamiResponseUnion) UnmarshalJSON added in v0.13.0

func (r *WhoamiResponseUnion) UnmarshalJSON(data []byte) error

type WhoamiUser added in v0.13.0

type WhoamiUser struct {
	// Authenticated user identifier.
	ID string `json:"id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WhoamiUser) RawJSON added in v0.13.0

func (r WhoamiUser) RawJSON() string

Returns the unmodified JSON received from the API

func (*WhoamiUser) UnmarshalJSON added in v0.13.0

func (r *WhoamiUser) UnmarshalJSON(data []byte) error

type WhoamiUserJwt added in v0.13.0

type WhoamiUserJwt struct {
	// Always `user_jwt`.
	Type constant.UserJwt `json:"type" default:"user_jwt"`
	User WhoamiUser       `json:"user" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		User        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WhoamiUserJwt) RawJSON added in v0.13.0

func (r WhoamiUserJwt) RawJSON() string

Returns the unmodified JSON received from the API

func (*WhoamiUserJwt) UnmarshalJSON added in v0.13.0

func (r *WhoamiUserJwt) UnmarshalJSON(data []byte) error

type WhoamiUserOrgJwt added in v0.13.0

type WhoamiUserOrgJwt struct {
	Organization WhoamiOrganization `json:"organization" api:"required"`
	// Always `user_org_jwt`.
	Type constant.UserOrgJwt `json:"type" default:"user_org_jwt"`
	User WhoamiUser          `json:"user" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Organization respjson.Field
		Type         respjson.Field
		User         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WhoamiUserOrgJwt) RawJSON added in v0.13.0

func (r WhoamiUserOrgJwt) RawJSON() string

Returns the unmodified JSON received from the API

func (*WhoamiUserOrgJwt) UnmarshalJSON added in v0.13.0

func (r *WhoamiUserOrgJwt) UnmarshalJSON(data []byte) error

type WhoamiUserOrgProjectJwt added in v0.13.0

type WhoamiUserOrgProjectJwt struct {
	Organization WhoamiOrganization `json:"organization" api:"required"`
	Project      WhoamiProject      `json:"project" api:"required"`
	// Always `user_org_project_jwt`.
	Type constant.UserOrgProjectJwt `json:"type" default:"user_org_project_jwt"`
	User WhoamiUser                 `json:"user" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Organization respjson.Field
		Project      respjson.Field
		Type         respjson.Field
		User         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WhoamiUserOrgProjectJwt) RawJSON added in v0.13.0

func (r WhoamiUserOrgProjectJwt) RawJSON() string

Returns the unmodified JSON received from the API

func (*WhoamiUserOrgProjectJwt) UnmarshalJSON added in v0.13.0

func (r *WhoamiUserOrgProjectJwt) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages
shared

Jump to

Keyboard shortcuts

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