Class: Telnyx::Models::ModelMetadata

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/telnyx/models/model_metadata.rb,
sig/telnyx/models/model_metadata.rbs

Defined Under Namespace

Modules: Tier

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, context_length:, created:, languages:, license:, organization:, owned_by:, parameters:, tier:, base_model: nil, description: nil, is_fine_tunable: nil, is_vision_supported: nil, max_completion_tokens: nil, object: nil, parameters_str: nil, pricing: nil, recommended_for_assistants: nil, regions: nil, task: nil) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::ModelMetadata for more details.

Metadata for a model available on Telnyx Inference. Returned by GET /v2/ai/openai/models (and the deprecated GET /v2/ai/models). Open-source models live under their Hugging Face organization (e.g. moonshotai/Kimi-K2.6, zai-org/GLM-5.1-FP8, MiniMaxAI/MiniMax-M2.7); fine-tuned models are owned by the Telnyx organization that trained them.

Parameters:

  • id (String)

    Model identifier. For open-source models, follows the `#organization/{model_nam

  • context_length (Integer)

    Maximum total tokens (prompt + completion) supported by the model in a single re

  • created (Time)

    Timestamp at which the model was registered on Telnyx Inference (ISO 8601).

  • languages (Array<String>)

    ISO language codes the model supports (e.g. en, es).

  • license (String)

    License the model is distributed under, e.g. Apache 2.0, MIT, `Llama 3 Commu

  • organization (String)

    Organization that originally published the model, matching the prefix of id fo

  • owned_by (String)

    Owner of the model. Telnyx for Telnyx-hosted open-source models, the upstream

  • parameters (Integer)

    Total parameter count of the model.

  • tier (Symbol, Telnyx::Models::ModelMetadata::Tier)

    Billing tier the model belongs to. Used together with pricing to determine cos

  • base_model (String, nil) (defaults to: nil)

    Base model the fine-tuned model was trained from. Only set for fine-tuned models

  • description (String, nil) (defaults to: nil)

    Short, human-readable summary of what the model is best suited for.

  • is_fine_tunable (Boolean) (defaults to: nil)

    Whether the model can be used as a base for a fine-tuning job via `POST /v2/ai/f

  • is_vision_supported (Boolean) (defaults to: nil)

    Whether the model accepts image inputs in chat completions (multimodal vision su

  • max_completion_tokens (Integer, nil) (defaults to: nil)

    Maximum number of completion (output) tokens the model will generate per request

  • object (String) (defaults to: nil)

    Object type. Always model.

  • parameters_str (String, nil) (defaults to: nil)

    Human-readable parameter count, e.g. 1.0T, 753.9B, 8B.

  • pricing (Hash{Symbol=>String}) (defaults to: nil)

    Mapping of token kind to price, as strings to preserve precision. Typical keys a

  • recommended_for_assistants (Boolean) (defaults to: nil)

    Whether Telnyx currently recommends this model as the LLM powering a Telnyx AI A

  • regions (Array<String>) (defaults to: nil)

    Public region names where the model is currently deployed (e.g. us-central-1,

  • task (String) (defaults to: nil)

    Primary task the model is intended for, e.g. text-generation, `audio-text-to-t



# File 'lib/telnyx/models/model_metadata.rb', line 145

Instance Attribute Details

#base_modelString?

Base model the fine-tuned model was trained from. Only set for fine-tuned models.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


73
# File 'lib/telnyx/models/model_metadata.rb', line 73

optional :base_model, String, nil?: true

#context_lengthInteger

Maximum total tokens (prompt + completion) supported by the model in a single request.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


19
# File 'lib/telnyx/models/model_metadata.rb', line 19

required :context_length, Integer

#createdTime

Timestamp at which the model was registered on Telnyx Inference (ISO 8601).

Parameters:

  • value (Time)

Returns:

  • (Time)


25
# File 'lib/telnyx/models/model_metadata.rb', line 25

required :created, Time

#descriptionString?

Short, human-readable summary of what the model is best suited for.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


79
# File 'lib/telnyx/models/model_metadata.rb', line 79

optional :description, String, nil?: true

#idString

Model identifier. For open-source models, follows the {organization}/{model_name} convention from Hugging Face (e.g. moonshotai/Kimi-K2.6).

Parameters:

  • value (String)

Returns:

  • (String)


12
# File 'lib/telnyx/models/model_metadata.rb', line 12

required :id, String

#is_fine_tunableBoolean?

Whether the model can be used as a base for a fine-tuning job via POST /v2/ai/fine_tuning/jobs.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


86
# File 'lib/telnyx/models/model_metadata.rb', line 86

optional :is_fine_tunable, Telnyx::Internal::Type::Boolean

#is_vision_supportedBoolean?

Whether the model accepts image inputs in chat completions (multimodal vision support).

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


93
# File 'lib/telnyx/models/model_metadata.rb', line 93

optional :is_vision_supported, Telnyx::Internal::Type::Boolean

#languagesArray<String>

ISO language codes the model supports (e.g. en, es).

Parameters:

  • value (::Array[String])

Returns:

  • (Array<String>)


31
# File 'lib/telnyx/models/model_metadata.rb', line 31

required :languages, Telnyx::Internal::Type::ArrayOf[String]

#licenseString

License the model is distributed under, e.g. Apache 2.0, MIT, Llama 3 Community License.

Parameters:

  • value (String)

Returns:

  • (String)


38
# File 'lib/telnyx/models/model_metadata.rb', line 38

required :license, String

#max_completion_tokensInteger?

Maximum number of completion (output) tokens the model will generate per request. null if unconstrained beyond context_length.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


100
# File 'lib/telnyx/models/model_metadata.rb', line 100

optional :max_completion_tokens, Integer, nil?: true

#objectString?

Object type. Always model.

Parameters:

  • (String)

Returns:

  • (String, nil)


106
# File 'lib/telnyx/models/model_metadata.rb', line 106

optional :object, String

#organizationString

Organization that originally published the model, matching the prefix of id for open-source models.

Parameters:

  • value (String)

Returns:

  • (String)


45
# File 'lib/telnyx/models/model_metadata.rb', line 45

required :organization, String

#owned_byString

Owner of the model. Telnyx for Telnyx-hosted open-source models, the upstream provider name for proxied models, or the Telnyx organization id for fine-tuned models.

Parameters:

  • value (String)

Returns:

  • (String)


53
# File 'lib/telnyx/models/model_metadata.rb', line 53

required :owned_by, String

#parametersInteger

Total parameter count of the model.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


59
# File 'lib/telnyx/models/model_metadata.rb', line 59

required :parameters, Integer

#parameters_strString?

Human-readable parameter count, e.g. 1.0T, 753.9B, 8B.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


112
# File 'lib/telnyx/models/model_metadata.rb', line 112

optional :parameters_str, String, nil?: true

#pricingHash{Symbol=>String}?

Mapping of token kind to price, as strings to preserve precision. Typical keys are prompt, cached_prompt, and completion. When pricing is available the block also includes currency (ISO 4217 code matching the account's configured billing currency) and unit (the denomination the prices are quoted in, currently always 1M_tokens for token-priced models).

Parameters:

  • (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String}, nil)


122
# File 'lib/telnyx/models/model_metadata.rb', line 122

optional :pricing, Telnyx::Internal::Type::HashOf[String]

Whether Telnyx currently recommends this model as the LLM powering a Telnyx AI Assistant.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


129
# File 'lib/telnyx/models/model_metadata.rb', line 129

optional :recommended_for_assistants, Telnyx::Internal::Type::Boolean

#regionsArray<String>?

Public region names where the model is currently deployed (e.g. us-central-1, eu-central-1).

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


136
# File 'lib/telnyx/models/model_metadata.rb', line 136

optional :regions, Telnyx::Internal::Type::ArrayOf[String]

#taskString?

Primary task the model is intended for, e.g. text-generation, audio-text-to-text, feature-extraction (embeddings).

Parameters:

  • (String)

Returns:

  • (String, nil)


143
# File 'lib/telnyx/models/model_metadata.rb', line 143

optional :task, String

#tierSymbol, Telnyx::Models::ModelMetadata::Tier

Billing tier the model belongs to. Used together with pricing to determine cost per 1M tokens.

Parameters:

  • value (Telnyx::Models::ModelMetadata::tier)

Returns:



66
# File 'lib/telnyx/models/model_metadata.rb', line 66

required :tier, enum: -> { Telnyx::ModelMetadata::Tier }

Instance Method Details

#to_hash{

Returns:

  • ({)


105
# File 'sig/telnyx/models/model_metadata.rbs', line 105

def to_hash: -> {