UnifiedModelType

class UnifiedModelType(str):

Class used for support both :obj:ModelType and :obj:str to be used to represent a model type in a unified way. This class is a subclass of :obj:str so that it can be used as string seamlessly.

Parameters:

  • value (Union[ModelType, str]): The value of the model type.

new

def __new__(cls, value: Union['ModelType', str]):

init

def __init__(self, value: Union['ModelType', str]):

value_for_tiktoken

def value_for_tiktoken(self):

Returns the model name for TikToken.

token_limit

def token_limit(self):

Returns the token limit for the model. Here we set the default value as 999_999_999 if it’s not provided from model_config_dict

is_openai

def is_openai(self):

Returns whether the model is an OpenAI model.

is_aws_bedrock

def is_aws_bedrock(self):

Returns whether the model is an AWS Bedrock model.

is_anthropic

def is_anthropic(self):

Returns whether the model is an Anthropic model.

is_azure_openai

def is_azure_openai(self):

Returns whether the model is an Azure OpenAI model.

is_groq

def is_groq(self):

Returns whether the model is a Groq served model.

is_openrouter

def is_openrouter(self):

Returns whether the model is a OpenRouter served model.

is_lmstudio

def is_lmstudio(self):

Returns whether the model is a LMStudio served model.

is_ppio

def is_ppio(self):

Returns whether the model is a PPIO served model.

is_zhipuai

def is_zhipuai(self):

Returns whether the model is a Zhipuai model.

is_gemini

def is_gemini(self):

Returns whether the model is a Gemini model.

is_mistral

def is_mistral(self):

Returns whether the model is a Mistral model.

is_netmind

def is_netmind(self):

Returns whether the model is a Netmind model.

is_reka

def is_reka(self):

Returns whether the model is a Reka model.

is_cohere

def is_cohere(self):

Returns whether the model is a Cohere model.

is_yi

def is_yi(self):

Returns whether the model is a Yi model.

is_qwen

def is_qwen(self):

Returns whether the model is a Qwen model.

is_internlm

def is_internlm(self):

Returns whether the model is a InternLM model.

is_modelscope

def is_modelscope(self):

Returns whether the model is a ModelScope serverd model.

is_moonshot

def is_moonshot(self):

Returns whether this platform is Moonshot model.

is_novita

def is_novita(self):

Returns whether the model is a Novita served model.

is_watsonx

def is_watsonx(self):

Returns whether the model is a WatsonX served model.

support_native_structured_output

def support_native_structured_output(self):

Returns whether the model supports native structured output.

support_native_tool_calling

def support_native_tool_calling(self):

Returns whether the model supports native tool calling.