2023-10-01 02:27:21 +00:00
|
|
|
from __future__ import annotations
|
2024-02-21 23:16:58 +00:00
|
|
|
|
2023-09-17 21:23:54 +00:00
|
|
|
from dataclasses import dataclass
|
2024-02-21 23:16:58 +00:00
|
|
|
|
2024-05-19 03:09:55 +00:00
|
|
|
from .Provider import IterListProvider, ProviderType
|
2024-04-12 16:06:54 +00:00
|
|
|
from .Provider import (
|
2024-07-09 08:18:26 +00:00
|
|
|
AI365VIP,
|
2024-07-25 06:21:55 +00:00
|
|
|
Allyfy,
|
2024-07-28 22:37:16 +00:00
|
|
|
Bing,
|
|
|
|
Blackbox,
|
|
|
|
ChatGot,
|
|
|
|
Chatgpt4o,
|
|
|
|
Chatgpt4Online,
|
|
|
|
ChatgptFree,
|
|
|
|
DDG,
|
|
|
|
DeepInfra,
|
|
|
|
DeepInfraImage,
|
|
|
|
FreeChatgpt,
|
|
|
|
FreeGpt,
|
|
|
|
Gemini,
|
|
|
|
GeminiPro,
|
|
|
|
GeminiProChat,
|
|
|
|
GigaChat,
|
|
|
|
HuggingChat,
|
|
|
|
HuggingFace,
|
|
|
|
Koala,
|
|
|
|
Liaobots,
|
|
|
|
Marsyoo,
|
|
|
|
MetaAI,
|
|
|
|
OpenaiChat,
|
|
|
|
PerplexityLabs,
|
|
|
|
Pi,
|
|
|
|
Pizzagpt,
|
|
|
|
Reka,
|
|
|
|
Replicate,
|
|
|
|
ReplicateHome,
|
|
|
|
You,
|
2023-09-17 21:37:14 +00:00
|
|
|
)
|
2023-09-17 21:23:54 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
|
2023-09-20 04:12:34 +00:00
|
|
|
@dataclass(unsafe_hash=True)
|
2023-09-17 21:23:54 +00:00
|
|
|
class Model:
|
2024-01-14 06:45:41 +00:00
|
|
|
"""
|
|
|
|
Represents a machine learning model configuration.
|
|
|
|
|
|
|
|
Attributes:
|
|
|
|
name (str): Name of the model.
|
|
|
|
base_provider (str): Default provider for the model.
|
|
|
|
best_provider (ProviderType): The preferred provider for the model, typically with retry logic.
|
|
|
|
"""
|
2023-09-17 21:23:54 +00:00
|
|
|
name: str
|
|
|
|
base_provider: str
|
2024-01-01 16:48:57 +00:00
|
|
|
best_provider: ProviderType = None
|
2024-04-05 19:00:35 +00:00
|
|
|
|
2023-10-19 14:14:48 +00:00
|
|
|
@staticmethod
|
|
|
|
def __all__() -> list[str]:
|
2024-01-14 06:45:41 +00:00
|
|
|
"""Returns a list of all model names."""
|
2023-10-19 14:14:48 +00:00
|
|
|
return _all_models
|
2023-09-17 21:23:54 +00:00
|
|
|
|
|
|
|
default = Model(
|
2023-10-01 02:27:21 +00:00
|
|
|
name = "",
|
|
|
|
base_provider = "",
|
2024-05-19 03:09:55 +00:00
|
|
|
best_provider = IterListProvider([
|
2023-11-16 15:56:23 +00:00
|
|
|
Bing,
|
|
|
|
You,
|
2024-05-19 03:09:55 +00:00
|
|
|
OpenaiChat,
|
2024-07-08 20:41:19 +00:00
|
|
|
FreeChatgpt,
|
|
|
|
AI365VIP,
|
|
|
|
Chatgpt4o,
|
|
|
|
DDG,
|
|
|
|
ChatgptFree,
|
|
|
|
Koala,
|
|
|
|
Pizzagpt,
|
2023-10-05 03:13:37 +00:00
|
|
|
])
|
|
|
|
)
|
|
|
|
|
2023-11-16 15:56:23 +00:00
|
|
|
# GPT-3.5 too, but all providers supports long requests and responses
|
2023-10-05 03:13:37 +00:00
|
|
|
gpt_35_long = Model(
|
|
|
|
name = 'gpt-3.5-turbo',
|
|
|
|
base_provider = 'openai',
|
2024-05-19 03:09:55 +00:00
|
|
|
best_provider = IterListProvider([
|
2024-04-05 19:00:35 +00:00
|
|
|
FreeGpt,
|
|
|
|
You,
|
2024-05-19 03:09:55 +00:00
|
|
|
Koala,
|
2024-07-08 20:41:19 +00:00
|
|
|
ChatgptFree,
|
|
|
|
FreeChatgpt,
|
|
|
|
DDG,
|
|
|
|
AI365VIP,
|
|
|
|
Pizzagpt,
|
2024-07-25 06:21:55 +00:00
|
|
|
Allyfy,
|
2023-09-21 18:10:59 +00:00
|
|
|
])
|
|
|
|
)
|
2023-09-17 21:23:54 +00:00
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
############
|
|
|
|
### Text ###
|
|
|
|
############
|
|
|
|
|
|
|
|
### OpenAI ###
|
|
|
|
### GPT-3.5 / GPT-4 ###
|
|
|
|
# gpt-3.5
|
2023-09-17 21:23:54 +00:00
|
|
|
gpt_35_turbo = Model(
|
2023-10-01 02:27:21 +00:00
|
|
|
name = 'gpt-3.5-turbo',
|
|
|
|
base_provider = 'openai',
|
2024-05-19 03:09:55 +00:00
|
|
|
best_provider = IterListProvider([
|
2024-04-12 16:06:54 +00:00
|
|
|
FreeGpt,
|
|
|
|
You,
|
|
|
|
Koala,
|
2024-07-08 20:41:19 +00:00
|
|
|
ChatgptFree,
|
|
|
|
FreeChatgpt,
|
|
|
|
DDG,
|
|
|
|
AI365VIP,
|
|
|
|
Pizzagpt,
|
2024-07-25 06:21:55 +00:00
|
|
|
Allyfy,
|
2024-04-12 16:06:54 +00:00
|
|
|
])
|
2023-09-17 21:23:54 +00:00
|
|
|
)
|
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
gpt_35_turbo_16k = Model(
|
|
|
|
name = 'gpt-3.5-turbo-16k',
|
|
|
|
base_provider = 'openai',
|
|
|
|
best_provider = gpt_35_long.best_provider
|
|
|
|
)
|
|
|
|
|
|
|
|
gpt_35_turbo_16k_0613 = Model(
|
|
|
|
name = 'gpt-3.5-turbo-16k-0613',
|
|
|
|
base_provider = 'openai',
|
|
|
|
best_provider = gpt_35_long.best_provider
|
|
|
|
)
|
|
|
|
|
|
|
|
gpt_35_turbo_0613 = Model(
|
|
|
|
name = 'gpt-3.5-turbo-0613',
|
|
|
|
base_provider = 'openai',
|
|
|
|
best_provider = gpt_35_turbo.best_provider
|
|
|
|
)
|
|
|
|
|
|
|
|
# gpt-4
|
2023-09-17 21:23:54 +00:00
|
|
|
gpt_4 = Model(
|
2023-10-01 02:27:21 +00:00
|
|
|
name = 'gpt-4',
|
|
|
|
base_provider = 'openai',
|
2024-05-19 03:09:55 +00:00
|
|
|
best_provider = IterListProvider([
|
2024-07-27 13:20:20 +00:00
|
|
|
Bing, Chatgpt4Online
|
2023-10-10 13:11:17 +00:00
|
|
|
])
|
2023-09-22 23:44:09 +00:00
|
|
|
)
|
2023-09-17 21:23:54 +00:00
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
gpt_4_0613 = Model(
|
|
|
|
name = 'gpt-4-0613',
|
2024-05-14 22:45:13 +00:00
|
|
|
base_provider = 'openai',
|
2024-07-08 20:41:19 +00:00
|
|
|
best_provider = gpt_4.best_provider
|
|
|
|
)
|
|
|
|
|
|
|
|
gpt_4_32k = Model(
|
|
|
|
name = 'gpt-4-32k',
|
|
|
|
base_provider = 'openai',
|
|
|
|
best_provider = gpt_4.best_provider
|
|
|
|
)
|
|
|
|
|
|
|
|
gpt_4_32k_0613 = Model(
|
|
|
|
name = 'gpt-4-32k-0613',
|
|
|
|
base_provider = 'openai',
|
|
|
|
best_provider = gpt_4.best_provider
|
2024-05-14 22:45:13 +00:00
|
|
|
)
|
|
|
|
|
2023-12-21 00:03:28 +00:00
|
|
|
gpt_4_turbo = Model(
|
|
|
|
name = 'gpt-4-turbo',
|
|
|
|
base_provider = 'openai',
|
2024-07-28 10:34:28 +00:00
|
|
|
best_provider = IterListProvider([
|
|
|
|
Bing, Liaobots
|
|
|
|
])
|
2023-12-21 00:03:28 +00:00
|
|
|
)
|
2024-07-08 20:41:19 +00:00
|
|
|
gpt_4o = Model(
|
|
|
|
name = 'gpt-4o',
|
|
|
|
base_provider = 'openai',
|
|
|
|
best_provider = IterListProvider([
|
2024-07-28 16:24:48 +00:00
|
|
|
You, Liaobots, Chatgpt4o, AI365VIP, OpenaiChat, Marsyoo
|
2024-07-25 06:21:55 +00:00
|
|
|
])
|
|
|
|
)
|
|
|
|
|
|
|
|
gpt_4o_mini = Model(
|
|
|
|
name = 'gpt-4o-mini',
|
|
|
|
base_provider = 'openai',
|
|
|
|
best_provider = IterListProvider([
|
|
|
|
Liaobots, OpenaiChat, You,
|
2024-07-08 20:41:19 +00:00
|
|
|
])
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
### GigaChat ###
|
2024-03-13 22:29:49 +00:00
|
|
|
gigachat = Model(
|
|
|
|
name = 'GigaChat:latest',
|
|
|
|
base_provider = 'gigachat',
|
|
|
|
best_provider = GigaChat
|
|
|
|
)
|
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
|
|
|
|
### Meta ###
|
2024-05-19 03:09:55 +00:00
|
|
|
meta = Model(
|
|
|
|
name = "meta",
|
2024-02-23 16:21:10 +00:00
|
|
|
base_provider = "meta",
|
2024-05-19 03:09:55 +00:00
|
|
|
best_provider = MetaAI
|
2024-04-19 07:27:33 +00:00
|
|
|
)
|
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
llama_3_8b_instruct = Model(
|
2024-04-22 18:02:17 +00:00
|
|
|
name = "meta-llama/Meta-Llama-3-8B-Instruct",
|
2024-04-19 07:27:33 +00:00
|
|
|
base_provider = "meta",
|
2024-05-19 03:09:55 +00:00
|
|
|
best_provider = IterListProvider([DeepInfra, PerplexityLabs, Replicate])
|
2024-04-19 07:27:33 +00:00
|
|
|
)
|
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
llama_3_70b_instruct = Model(
|
2024-04-22 18:02:17 +00:00
|
|
|
name = "meta-llama/Meta-Llama-3-70B-Instruct",
|
2024-04-19 07:27:33 +00:00
|
|
|
base_provider = "meta",
|
2024-07-28 22:37:16 +00:00
|
|
|
best_provider = IterListProvider([DeepInfra, PerplexityLabs, Replicate])
|
2024-07-25 06:21:55 +00:00
|
|
|
)
|
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
llama3_70b_instruct = Model(
|
|
|
|
name = "meta/meta-llama-3-70b-instruct",
|
2024-07-25 06:21:55 +00:00
|
|
|
base_provider = "meta",
|
2024-07-28 22:37:16 +00:00
|
|
|
best_provider = IterListProvider([ReplicateHome])
|
2024-07-25 06:21:55 +00:00
|
|
|
)
|
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
llama_3_70b_chat_hf = Model(
|
|
|
|
name = "meta-llama/Llama-3-70b-chat-hf",
|
2024-07-25 06:21:55 +00:00
|
|
|
base_provider = "meta",
|
2024-07-28 22:37:16 +00:00
|
|
|
best_provider = IterListProvider([DDG])
|
2024-01-23 04:02:14 +00:00
|
|
|
)
|
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
llama_3_1_70b_Instruct = Model(
|
|
|
|
name = "meta-llama/Meta-Llama-3.1-70B-Instruct",
|
2024-02-23 16:21:10 +00:00
|
|
|
base_provider = "meta",
|
2024-07-28 22:37:16 +00:00
|
|
|
best_provider = IterListProvider([HuggingChat, HuggingFace])
|
2024-01-01 16:48:57 +00:00
|
|
|
)
|
2023-10-26 19:32:49 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
llama_3_1_405b_Instruct_FP8 = Model(
|
|
|
|
name = "meta-llama/Meta-Llama-3.1-405B-Instruct-FP8",
|
2024-02-23 16:21:10 +00:00
|
|
|
base_provider = "meta",
|
2024-07-28 22:37:16 +00:00
|
|
|
best_provider = IterListProvider([HuggingChat, HuggingFace])
|
2024-02-04 18:50:32 +00:00
|
|
|
)
|
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
|
|
|
|
### Mistral ###
|
2023-12-13 12:15:27 +00:00
|
|
|
mixtral_8x7b = Model(
|
|
|
|
name = "mistralai/Mixtral-8x7B-Instruct-v0.1",
|
|
|
|
base_provider = "huggingface",
|
2024-07-25 06:21:55 +00:00
|
|
|
best_provider = IterListProvider([DeepInfra, HuggingFace, PerplexityLabs, HuggingChat, DDG, ReplicateHome])
|
2024-04-12 03:18:08 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
mistral_7b_v02 = Model(
|
|
|
|
name = "mistralai/Mistral-7B-Instruct-v0.2",
|
|
|
|
base_provider = "huggingface",
|
2024-07-25 06:21:55 +00:00
|
|
|
best_provider = IterListProvider([DeepInfra, HuggingFace, HuggingChat])
|
2024-07-08 20:41:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
### NousResearch ###
|
|
|
|
Nous_Hermes_2_Mixtral_8x7B_DPO = Model(
|
|
|
|
name = "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
|
|
|
|
base_provider = "NousResearch",
|
|
|
|
best_provider = IterListProvider([HuggingFace, HuggingChat])
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
### 01-ai ###
|
|
|
|
Yi_1_5_34B_Chat = Model(
|
|
|
|
name = "01-ai/Yi-1.5-34B-Chat",
|
|
|
|
base_provider = "01-ai",
|
|
|
|
best_provider = IterListProvider([HuggingFace, HuggingChat])
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
### Microsoft ###
|
|
|
|
Phi_3_mini_4k_instruct = Model(
|
|
|
|
name = "microsoft/Phi-3-mini-4k-instruct",
|
|
|
|
base_provider = "Microsoft",
|
|
|
|
best_provider = IterListProvider([HuggingFace, HuggingChat])
|
2024-01-01 16:48:57 +00:00
|
|
|
)
|
2023-12-13 12:15:27 +00:00
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
|
|
|
|
### Google ###
|
|
|
|
# gemini
|
2024-05-19 03:09:55 +00:00
|
|
|
gemini = Model(
|
2024-02-09 13:24:15 +00:00
|
|
|
name = 'gemini',
|
2024-07-08 20:41:19 +00:00
|
|
|
base_provider = 'Google',
|
2024-02-09 13:24:15 +00:00
|
|
|
best_provider = Gemini
|
2024-01-23 04:02:14 +00:00
|
|
|
)
|
2023-09-17 21:23:54 +00:00
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
gemini_pro = Model(
|
|
|
|
name = 'gemini-pro',
|
|
|
|
base_provider = 'Google',
|
2024-07-25 06:21:55 +00:00
|
|
|
best_provider = IterListProvider([GeminiPro, You, ChatGot, GeminiProChat, Liaobots])
|
|
|
|
)
|
|
|
|
|
|
|
|
gemini_flash = Model(
|
|
|
|
name = 'gemini-flash',
|
|
|
|
base_provider = 'Google',
|
|
|
|
best_provider = IterListProvider([Liaobots])
|
2024-07-08 20:41:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# gemma
|
2024-07-25 06:21:55 +00:00
|
|
|
gemma_2b_it = Model(
|
|
|
|
name = 'gemma-2b-it',
|
|
|
|
base_provider = 'Google',
|
|
|
|
best_provider = IterListProvider([ReplicateHome])
|
|
|
|
)
|
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
gemma_2_9b_it = Model(
|
|
|
|
name = 'gemma-2-9b-it',
|
|
|
|
base_provider = 'Google',
|
|
|
|
best_provider = IterListProvider([PerplexityLabs])
|
|
|
|
)
|
|
|
|
|
|
|
|
gemma_2_27b_it = Model(
|
|
|
|
name = 'gemma-2-27b-it',
|
|
|
|
base_provider = 'Google',
|
|
|
|
best_provider = IterListProvider([PerplexityLabs])
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
### Anthropic ###
|
2024-07-25 06:21:55 +00:00
|
|
|
claude_2 = Model(
|
|
|
|
name = 'claude-2',
|
|
|
|
base_provider = 'Anthropic',
|
|
|
|
best_provider = IterListProvider([You])
|
|
|
|
)
|
|
|
|
|
|
|
|
claude_2_0 = Model(
|
|
|
|
name = 'claude-2.0',
|
|
|
|
base_provider = 'Anthropic',
|
|
|
|
best_provider = IterListProvider([Liaobots])
|
|
|
|
)
|
|
|
|
|
|
|
|
claude_2_1 = Model(
|
|
|
|
name = 'claude-2.1',
|
|
|
|
base_provider = 'Anthropic',
|
|
|
|
best_provider = IterListProvider([Liaobots])
|
2024-01-23 04:02:14 +00:00
|
|
|
)
|
2023-09-17 21:23:54 +00:00
|
|
|
|
2024-03-11 01:41:59 +00:00
|
|
|
claude_3_opus = Model(
|
|
|
|
name = 'claude-3-opus',
|
2024-07-25 06:21:55 +00:00
|
|
|
base_provider = 'Anthropic',
|
|
|
|
best_provider = IterListProvider([You, Liaobots])
|
2024-03-11 01:41:59 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
claude_3_sonnet = Model(
|
|
|
|
name = 'claude-3-sonnet',
|
2024-07-25 06:21:55 +00:00
|
|
|
base_provider = 'Anthropic',
|
|
|
|
best_provider = IterListProvider([You, Liaobots])
|
|
|
|
)
|
|
|
|
|
|
|
|
claude_3_5_sonnet = Model(
|
|
|
|
name = 'claude-3-5-sonnet',
|
|
|
|
base_provider = 'Anthropic',
|
|
|
|
best_provider = IterListProvider([Liaobots])
|
2024-03-11 01:41:59 +00:00
|
|
|
)
|
|
|
|
|
2024-05-19 03:09:55 +00:00
|
|
|
claude_3_haiku = Model(
|
|
|
|
name = 'claude-3-haiku',
|
2024-07-25 06:21:55 +00:00
|
|
|
base_provider = 'Anthropic',
|
|
|
|
best_provider = IterListProvider([DDG, AI365VIP, Liaobots])
|
2024-05-19 03:09:55 +00:00
|
|
|
)
|
|
|
|
|
2023-09-20 03:00:19 +00:00
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
### Reka AI ###
|
|
|
|
reka_core = Model(
|
|
|
|
name = 'reka-core',
|
|
|
|
base_provider = 'Reka AI',
|
|
|
|
best_provider = Reka
|
2023-10-10 13:11:17 +00:00
|
|
|
)
|
2023-09-22 19:36:44 +00:00
|
|
|
|
2023-09-17 21:23:54 +00:00
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
### NVIDIA ###
|
|
|
|
nemotron_4_340b_instruct = Model(
|
|
|
|
name = 'nemotron-4-340b-instruct',
|
|
|
|
base_provider = 'NVIDIA',
|
|
|
|
best_provider = IterListProvider([PerplexityLabs])
|
2023-10-07 17:10:26 +00:00
|
|
|
)
|
2023-09-29 14:21:18 +00:00
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
|
|
|
|
### Blackbox ###
|
|
|
|
blackbox = Model(
|
|
|
|
name = 'blackbox',
|
|
|
|
base_provider = 'Blackbox',
|
|
|
|
best_provider = Blackbox
|
2023-10-07 17:10:26 +00:00
|
|
|
)
|
2023-09-29 14:21:18 +00:00
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
|
|
|
|
### Databricks ###
|
|
|
|
dbrx_instruct = Model(
|
|
|
|
name = 'databricks/dbrx-instruct',
|
|
|
|
base_provider = 'Databricks',
|
|
|
|
best_provider = IterListProvider([DeepInfra])
|
2023-10-07 17:10:26 +00:00
|
|
|
)
|
2023-09-17 21:23:54 +00:00
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
|
|
|
|
### CohereForAI ###
|
|
|
|
command_r_plus = Model(
|
|
|
|
name = 'CohereForAI/c4ai-command-r-plus',
|
|
|
|
base_provider = 'CohereForAI',
|
|
|
|
best_provider = IterListProvider([HuggingChat])
|
2024-01-13 14:58:12 +00:00
|
|
|
)
|
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
|
2024-07-25 06:21:55 +00:00
|
|
|
### iFlytek ###
|
|
|
|
SparkDesk_v1_1 = Model(
|
|
|
|
name = 'SparkDesk-v1.1',
|
|
|
|
base_provider = 'iFlytek',
|
|
|
|
best_provider = IterListProvider([FreeChatgpt])
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
### DeepSeek ###
|
|
|
|
deepseek_coder = Model(
|
|
|
|
name = 'deepseek-coder',
|
|
|
|
base_provider = 'DeepSeek',
|
|
|
|
best_provider = IterListProvider([FreeChatgpt])
|
|
|
|
)
|
|
|
|
|
|
|
|
deepseek_chat = Model(
|
|
|
|
name = 'deepseek-chat',
|
|
|
|
base_provider = 'DeepSeek',
|
|
|
|
best_provider = IterListProvider([FreeChatgpt])
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
### Qwen ###
|
|
|
|
Qwen2_7B_Instruct = Model(
|
|
|
|
name = 'Qwen2-7B-Instruct',
|
|
|
|
base_provider = 'Qwen',
|
|
|
|
best_provider = IterListProvider([FreeChatgpt])
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
### Zhipu AI ###
|
|
|
|
glm4_9B_chat = Model(
|
|
|
|
name = 'glm4-9B-chat',
|
|
|
|
base_provider = 'Zhipu AI',
|
|
|
|
best_provider = IterListProvider([FreeChatgpt])
|
|
|
|
)
|
|
|
|
|
|
|
|
chatglm3_6B = Model(
|
|
|
|
name = 'chatglm3-6B',
|
|
|
|
base_provider = 'Zhipu AI',
|
|
|
|
best_provider = IterListProvider([FreeChatgpt])
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
### 01-ai ###
|
|
|
|
Yi_1_5_9B_Chat = Model(
|
|
|
|
name = 'Yi-1.5-9B-Chat',
|
|
|
|
base_provider = '01-ai',
|
|
|
|
best_provider = IterListProvider([FreeChatgpt])
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
### Other ###
|
2023-12-01 22:11:52 +00:00
|
|
|
pi = Model(
|
|
|
|
name = 'pi',
|
|
|
|
base_provider = 'inflection',
|
2024-01-23 00:47:55 +00:00
|
|
|
best_provider = Pi
|
2023-12-01 22:11:52 +00:00
|
|
|
)
|
2023-09-17 21:23:54 +00:00
|
|
|
|
2024-04-13 02:09:11 +00:00
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
#############
|
|
|
|
### Image ###
|
|
|
|
#############
|
2024-04-13 01:46:20 +00:00
|
|
|
|
2024-07-08 20:41:19 +00:00
|
|
|
### Stability AI ###
|
|
|
|
sdxl = Model(
|
|
|
|
name = 'stability-ai/sdxl',
|
|
|
|
base_provider = 'Stability AI',
|
2024-07-25 06:21:55 +00:00
|
|
|
best_provider = IterListProvider([DeepInfraImage])
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
stable_diffusion_3 = Model(
|
|
|
|
name = 'stability-ai/stable-diffusion-3',
|
|
|
|
base_provider = 'Stability AI',
|
|
|
|
best_provider = IterListProvider([ReplicateHome])
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
sdxl_lightning_4step = Model(
|
|
|
|
name = 'bytedance/sdxl-lightning-4step',
|
|
|
|
base_provider = 'Stability AI',
|
|
|
|
best_provider = IterListProvider([ReplicateHome])
|
2024-07-08 20:41:19 +00:00
|
|
|
|
2024-04-19 12:10:56 +00:00
|
|
|
)
|
|
|
|
|
2024-07-25 06:21:55 +00:00
|
|
|
playground_v2_5_1024px_aesthetic = Model(
|
|
|
|
name = 'playgroundai/playground-v2.5-1024px-aesthetic',
|
|
|
|
base_provider = 'Stability AI',
|
2024-07-08 20:41:19 +00:00
|
|
|
best_provider = IterListProvider([ReplicateHome])
|
|
|
|
|
2024-04-24 23:06:11 +00:00
|
|
|
)
|
|
|
|
|
2023-09-17 21:23:54 +00:00
|
|
|
class ModelUtils:
|
2024-01-14 06:45:41 +00:00
|
|
|
"""
|
|
|
|
Utility class for mapping string identifiers to Model instances.
|
|
|
|
|
|
|
|
Attributes:
|
|
|
|
convert (dict[str, Model]): Dictionary mapping model string identifiers to Model instances.
|
|
|
|
"""
|
2023-09-17 21:23:54 +00:00
|
|
|
convert: dict[str, Model] = {
|
2024-07-08 20:41:19 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
############
|
|
|
|
### Text ###
|
|
|
|
############
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### OpenAI ###
|
|
|
|
### GPT-3.5 / GPT-4 ###
|
|
|
|
# gpt-3.5
|
|
|
|
'gpt-3.5-turbo': gpt_35_turbo,
|
|
|
|
'gpt-3.5-long': gpt_35_long,
|
|
|
|
|
|
|
|
# gpt-4
|
|
|
|
'gpt-4o' : gpt_4o,
|
|
|
|
'gpt-4o-mini' : gpt_4o_mini,
|
|
|
|
'gpt-4' : gpt_4,
|
|
|
|
'gpt-4-turbo' : gpt_4_turbo,
|
2024-07-08 20:41:19 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### Meta ###
|
|
|
|
"meta-ai": meta,
|
2024-07-08 20:41:19 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
'llama-3-8b': llama_3_8b_instruct,
|
|
|
|
'llama-3-70b': llama_3_70b_instruct,
|
|
|
|
'llama-3-70b-chat': llama_3_70b_chat_hf,
|
|
|
|
'llama-3-70b-instruct': llama3_70b_instruct,
|
|
|
|
'llama-3.1-70b': llama_3_1_70b_Instruct,
|
|
|
|
'llama-3.1-405b': llama_3_1_405b_Instruct_FP8,
|
2024-07-08 20:41:19 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### Mistral (Opensource) ###
|
|
|
|
'mixtral-8x7b': mixtral_8x7b,
|
|
|
|
'mistral-7b-v02': mistral_7b_v02,
|
2024-07-08 20:41:19 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### NousResearch ###
|
|
|
|
'Nous-Hermes-2-Mixtral-8x7B-DPO': Nous_Hermes_2_Mixtral_8x7B_DPO,
|
2024-07-08 20:41:19 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### 01-ai ###
|
|
|
|
'Yi-1.5-34b': Yi_1_5_34B_Chat,
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### Microsoft ###
|
|
|
|
'Phi-3-mini-4k': Phi_3_mini_4k_instruct,
|
|
|
|
|
|
|
|
### Google ###
|
|
|
|
# gemini
|
|
|
|
'gemini': gemini,
|
|
|
|
'gemini-pro': gemini_pro,
|
|
|
|
'gemini-flash': gemini_flash,
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
# gemma
|
|
|
|
'gemma-2b': gemma_2b_it,
|
|
|
|
'gemma-2-9b': gemma_2_9b_it,
|
|
|
|
'gemma-2-27b': gemma_2_27b_it,
|
|
|
|
|
|
|
|
### Anthropic ###
|
|
|
|
'claude-2': claude_2,
|
|
|
|
'claude-2.0': claude_2_0,
|
|
|
|
'claude-2.1': claude_2_1,
|
|
|
|
'claude-3-opus': claude_3_opus,
|
|
|
|
'claude-3-sonnet': claude_3_sonnet,
|
|
|
|
'claude-3-5-sonnet': claude_3_5_sonnet,
|
|
|
|
'claude-3-haiku': claude_3_haiku,
|
|
|
|
|
|
|
|
### Reka AI ###
|
|
|
|
'reka': reka_core,
|
|
|
|
|
|
|
|
### NVIDIA ###
|
|
|
|
'nemotron-4-340b': nemotron_4_340b_instruct,
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### Blackbox ###
|
|
|
|
'blackbox': blackbox,
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### CohereForAI ###
|
|
|
|
'command-r+': command_r_plus,
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### Databricks ###
|
|
|
|
'dbrx-instruct': dbrx_instruct,
|
|
|
|
|
|
|
|
### GigaChat ###
|
|
|
|
'gigachat': gigachat,
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### iFlytek ###
|
|
|
|
'SparkDesk-v1.1': SparkDesk_v1_1,
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### DeepSeek ###
|
|
|
|
'deepseek-coder': deepseek_coder,
|
|
|
|
'deepseek-chat': deepseek_chat,
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### Qwen ###
|
|
|
|
'Qwen2-7b': Qwen2_7B_Instruct,
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### Zhipu AI ###
|
|
|
|
'glm4-9b': glm4_9B_chat,
|
|
|
|
'chatglm3-6b': chatglm3_6B,
|
2024-07-08 20:41:19 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### 01-ai ###
|
|
|
|
'Yi-1.5-9b': Yi_1_5_9B_Chat,
|
2024-07-08 20:41:19 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
# Other
|
|
|
|
'pi': pi,
|
2024-07-08 20:41:19 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
#############
|
|
|
|
### Image ###
|
|
|
|
#############
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### Stability AI ###
|
|
|
|
'sdxl': sdxl,
|
|
|
|
'stable-diffusion-3': stable_diffusion_3,
|
2024-07-08 20:41:19 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### ByteDance ###
|
|
|
|
'sdxl-lightning': sdxl_lightning_4step,
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2024-07-28 22:37:16 +00:00
|
|
|
### Playground ###
|
|
|
|
'playground-v2.5': playground_v2_5_1024px_aesthetic,
|
2024-07-25 06:21:55 +00:00
|
|
|
|
2023-10-01 02:27:21 +00:00
|
|
|
}
|
2023-10-19 14:14:48 +00:00
|
|
|
|
2024-02-04 18:50:32 +00:00
|
|
|
_all_models = list(ModelUtils.convert.keys())
|