diff --git a/api/db/db_models.py b/api/db/db_models.py index 9df1580d3..bb6c395ef 100644 --- a/api/db/db_models.py +++ b/api/db/db_models.py @@ -532,8 +532,7 @@ class LLM(DataBaseModel): max_length=128, null=False, help_text="LLM name", - index=True, - primary_key=True) + index=True) model_type = CharField( max_length=128, null=False, @@ -558,6 +557,7 @@ class LLM(DataBaseModel): return self.llm_name class Meta: + primary_key = CompositeKey('fid', 'llm_name') db_table = "llm" @@ -965,3 +965,8 @@ def migrate_db(): ) except Exception as e: pass + try: + DB.execute_sql('ALTER TABLE llm DROP PRIMARY KEY;') + DB.execute_sql('ALTER TABLE llm ADD PRIMARY KEY (llm_name,fid);') + except Exception as e: + pass diff --git a/conf/llm_factories.json b/conf/llm_factories.json index 64982895f..2b90ca076 100644 --- a/conf/llm_factories.json +++ b/conf/llm_factories.json @@ -2633,6 +2633,140 @@ "model_type": "embedding" } ] + }, + { + "name": "novita.ai", + "logo": "", + "tags": "LLM", + "status": "1", + "llm": [ + { + "llm_name": "meta-llama/llama-3-8b-instruct", + "tags": "LLM,CHAT,8k", + "max_tokens": 8192, + "model_type": "chat" + }, + { + "llm_name": "meta-llama/llama-3-70b-instruct", + "tags": "LLM,CHAT,8k", + "max_tokens": 8192, + "model_type": "chat" + }, + { + "llm_name": "mistralai/mistral-nemo", + "tags": "LLM,CHAT,32k", + "max_tokens": 32768, + "model_type": "chat" + }, + { + "llm_name": "microsoft/wizardlm-2-7b", + "tags": "LLM,CHAT,32k", + "max_tokens": 32768, + "model_type": "chat" + }, + { + "llm_name": "openchat/openchat-7b", + "tags": "LLM,CHAT,4k", + "max_tokens": 4096, + "model_type": "chat" + }, + { + "llm_name": "meta-llama/llama-3.1-8b-instruct", + "tags": "LLM,CHAT,8k", + "max_tokens": 8192, + "model_type": "chat" + }, + { + "llm_name": "meta-llama/llama-3.1-70b-instruct", + "tags": "LLM,CHAT,8k", + "max_tokens": 8192, + "model_type": "chat" + }, + { + "llm_name": "meta-llama/llama-3.1-405b-instruct", + "tags": "LLM,CHAT,32k", + "max_tokens": 32768, + "model_type": "chat" + }, + { + "llm_name": "google/gemma-2-9b-it", + "tags": "LLM,CHAT,8k", + "max_tokens": 8192, + "model_type": "chat" + }, + { + "llm_name": "jondurbin/airoboros-l2-70b", + "tags": "LLM,CHAT,4k", + "max_tokens": 4096, + "model_type": "chat" + }, + { + "llm_name": "nousresearch/hermes-2-pro-llama-3-8b", + "tags": "LLM,CHAT,8k", + "max_tokens": 8192, + "model_type": "chat" + }, + { + "llm_name": "mistralai/mistral-7b-instruct", + "tags": "LLM,CHAT,32k", + "max_tokens": 32768, + "model_type": "chat" + }, + { + "llm_name": "cognitivecomputations/dolphin-mixtral-8x22b", + "tags": "LLM,CHAT,15k", + "max_tokens": 16000, + "model_type": "chat" + }, + { + "llm_name": "sao10k/l3-70b-euryale-v2.1", + "tags": "LLM,CHAT,15k", + "max_tokens": 16000, + "model_type": "chat" + }, + { + "llm_name": "sophosympatheia/midnight-rose-70b", + "tags": "LLM,CHAT,4k", + "max_tokens": 4096, + "model_type": "chat" + }, + { + "llm_name": "gryphe/mythomax-l2-13b", + "tags": "LLM,CHAT,4k", + "max_tokens": 4096, + "model_type": "chat" + }, + { + "llm_name": "nousresearch/nous-hermes-llama2-13b", + "tags": "LLM,CHAT,4k", + "max_tokens": 4096, + "model_type": "chat" + }, + { + "llm_name": "Nous-Hermes-2-Mixtral-8x7B-DPO", + "tags": "LLM,CHAT,32k", + "max_tokens": 32768, + "model_type": "chat" + }, + { + "llm_name": "lzlv_70b", + "tags": "LLM,CHAT,4k", + "max_tokens": 4096, + "model_type": "chat" + }, + { + "llm_name": "teknium/openhermes-2.5-mistral-7b", + "tags": "LLM,CHAT,4k", + "max_tokens": 4096, + "model_type": "chat" + }, + { + "llm_name": "microsoft/wizardlm-2-8x22b", + "tags": "LLM,CHAT,64k", + "max_tokens": 65535, + "model_type": "chat" + } + ] } ] } diff --git a/rag/llm/__init__.py b/rag/llm/__init__.py index 7d1d1731c..49a22aa15 100644 --- a/rag/llm/__init__.py +++ b/rag/llm/__init__.py @@ -91,7 +91,8 @@ ChatModel = { "LeptonAI": LeptonAIChat, "TogetherAI": TogetherAIChat, "PerfXCloud": PerfXCloudChat, - "Upstage":UpstageChat + "Upstage":UpstageChat, + "novita.ai": NovitaAIChat } diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index 89dbfc304..64fc13426 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -1009,3 +1009,11 @@ class UpstageChat(Base): if not base_url: base_url = "https://api.upstage.ai/v1/solar" super().__init__(key, model_name, base_url) + + +class NovitaAIChat(Base): + def __init__(self, key, model_name, base_url="https://api.novita.ai/v3/openai"): + if not base_url: + base_url = "https://api.novita.ai/v3/openai" + super().__init__(key, model_name, base_url) + \ No newline at end of file diff --git a/web/src/assets/svg/llm/novita-ai.svg b/web/src/assets/svg/llm/novita-ai.svg new file mode 100644 index 000000000..bd3598130 --- /dev/null +++ b/web/src/assets/svg/llm/novita-ai.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/web/src/pages/user-setting/setting-model/constant.ts b/web/src/pages/user-setting/setting-model/constant.ts index ab4863954..b2a79ee09 100644 --- a/web/src/pages/user-setting/setting-model/constant.ts +++ b/web/src/pages/user-setting/setting-model/constant.ts @@ -27,7 +27,8 @@ export const IconMap = { Lepton: 'lepton', TogetherAI:'together-ai', PerfXCould: 'perfx-could', - Upstage: 'upstage' + Upstage: 'upstage', + "novita.ai": 'novita-ai' }; export const BedrockRegionList = [