黄腾 aopstudio commited on
Commit
d7e5a50
·
1 Parent(s): f28c040

add support for novita.ai (#1910)

Browse files

### What problem does this PR solve?

#1853 add support for novita.ai

### Type of change


- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: Zhedong Cen <[email protected]>

api/db/db_models.py CHANGED
@@ -532,8 +532,7 @@ class LLM(DataBaseModel):
532
  max_length=128,
533
  null=False,
534
  help_text="LLM name",
535
- index=True,
536
- primary_key=True)
537
  model_type = CharField(
538
  max_length=128,
539
  null=False,
@@ -558,6 +557,7 @@ class LLM(DataBaseModel):
558
  return self.llm_name
559
 
560
  class Meta:
 
561
  db_table = "llm"
562
 
563
 
@@ -965,3 +965,8 @@ def migrate_db():
965
  )
966
  except Exception as e:
967
  pass
 
 
 
 
 
 
532
  max_length=128,
533
  null=False,
534
  help_text="LLM name",
535
+ index=True)
 
536
  model_type = CharField(
537
  max_length=128,
538
  null=False,
 
557
  return self.llm_name
558
 
559
  class Meta:
560
+ primary_key = CompositeKey('fid', 'llm_name')
561
  db_table = "llm"
562
 
563
 
 
965
  )
966
  except Exception as e:
967
  pass
968
+ try:
969
+ DB.execute_sql('ALTER TABLE llm DROP PRIMARY KEY;')
970
+ DB.execute_sql('ALTER TABLE llm ADD PRIMARY KEY (llm_name,fid);')
971
+ except Exception as e:
972
+ pass
conf/llm_factories.json CHANGED
@@ -2633,6 +2633,140 @@
2633
  "model_type": "embedding"
2634
  }
2635
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2636
  }
2637
  ]
2638
  }
 
2633
  "model_type": "embedding"
2634
  }
2635
  ]
2636
+ },
2637
+ {
2638
+ "name": "novita.ai",
2639
+ "logo": "",
2640
+ "tags": "LLM",
2641
+ "status": "1",
2642
+ "llm": [
2643
+ {
2644
+ "llm_name": "meta-llama/llama-3-8b-instruct",
2645
+ "tags": "LLM,CHAT,8k",
2646
+ "max_tokens": 8192,
2647
+ "model_type": "chat"
2648
+ },
2649
+ {
2650
+ "llm_name": "meta-llama/llama-3-70b-instruct",
2651
+ "tags": "LLM,CHAT,8k",
2652
+ "max_tokens": 8192,
2653
+ "model_type": "chat"
2654
+ },
2655
+ {
2656
+ "llm_name": "mistralai/mistral-nemo",
2657
+ "tags": "LLM,CHAT,32k",
2658
+ "max_tokens": 32768,
2659
+ "model_type": "chat"
2660
+ },
2661
+ {
2662
+ "llm_name": "microsoft/wizardlm-2-7b",
2663
+ "tags": "LLM,CHAT,32k",
2664
+ "max_tokens": 32768,
2665
+ "model_type": "chat"
2666
+ },
2667
+ {
2668
+ "llm_name": "openchat/openchat-7b",
2669
+ "tags": "LLM,CHAT,4k",
2670
+ "max_tokens": 4096,
2671
+ "model_type": "chat"
2672
+ },
2673
+ {
2674
+ "llm_name": "meta-llama/llama-3.1-8b-instruct",
2675
+ "tags": "LLM,CHAT,8k",
2676
+ "max_tokens": 8192,
2677
+ "model_type": "chat"
2678
+ },
2679
+ {
2680
+ "llm_name": "meta-llama/llama-3.1-70b-instruct",
2681
+ "tags": "LLM,CHAT,8k",
2682
+ "max_tokens": 8192,
2683
+ "model_type": "chat"
2684
+ },
2685
+ {
2686
+ "llm_name": "meta-llama/llama-3.1-405b-instruct",
2687
+ "tags": "LLM,CHAT,32k",
2688
+ "max_tokens": 32768,
2689
+ "model_type": "chat"
2690
+ },
2691
+ {
2692
+ "llm_name": "google/gemma-2-9b-it",
2693
+ "tags": "LLM,CHAT,8k",
2694
+ "max_tokens": 8192,
2695
+ "model_type": "chat"
2696
+ },
2697
+ {
2698
+ "llm_name": "jondurbin/airoboros-l2-70b",
2699
+ "tags": "LLM,CHAT,4k",
2700
+ "max_tokens": 4096,
2701
+ "model_type": "chat"
2702
+ },
2703
+ {
2704
+ "llm_name": "nousresearch/hermes-2-pro-llama-3-8b",
2705
+ "tags": "LLM,CHAT,8k",
2706
+ "max_tokens": 8192,
2707
+ "model_type": "chat"
2708
+ },
2709
+ {
2710
+ "llm_name": "mistralai/mistral-7b-instruct",
2711
+ "tags": "LLM,CHAT,32k",
2712
+ "max_tokens": 32768,
2713
+ "model_type": "chat"
2714
+ },
2715
+ {
2716
+ "llm_name": "cognitivecomputations/dolphin-mixtral-8x22b",
2717
+ "tags": "LLM,CHAT,15k",
2718
+ "max_tokens": 16000,
2719
+ "model_type": "chat"
2720
+ },
2721
+ {
2722
+ "llm_name": "sao10k/l3-70b-euryale-v2.1",
2723
+ "tags": "LLM,CHAT,15k",
2724
+ "max_tokens": 16000,
2725
+ "model_type": "chat"
2726
+ },
2727
+ {
2728
+ "llm_name": "sophosympatheia/midnight-rose-70b",
2729
+ "tags": "LLM,CHAT,4k",
2730
+ "max_tokens": 4096,
2731
+ "model_type": "chat"
2732
+ },
2733
+ {
2734
+ "llm_name": "gryphe/mythomax-l2-13b",
2735
+ "tags": "LLM,CHAT,4k",
2736
+ "max_tokens": 4096,
2737
+ "model_type": "chat"
2738
+ },
2739
+ {
2740
+ "llm_name": "nousresearch/nous-hermes-llama2-13b",
2741
+ "tags": "LLM,CHAT,4k",
2742
+ "max_tokens": 4096,
2743
+ "model_type": "chat"
2744
+ },
2745
+ {
2746
+ "llm_name": "Nous-Hermes-2-Mixtral-8x7B-DPO",
2747
+ "tags": "LLM,CHAT,32k",
2748
+ "max_tokens": 32768,
2749
+ "model_type": "chat"
2750
+ },
2751
+ {
2752
+ "llm_name": "lzlv_70b",
2753
+ "tags": "LLM,CHAT,4k",
2754
+ "max_tokens": 4096,
2755
+ "model_type": "chat"
2756
+ },
2757
+ {
2758
+ "llm_name": "teknium/openhermes-2.5-mistral-7b",
2759
+ "tags": "LLM,CHAT,4k",
2760
+ "max_tokens": 4096,
2761
+ "model_type": "chat"
2762
+ },
2763
+ {
2764
+ "llm_name": "microsoft/wizardlm-2-8x22b",
2765
+ "tags": "LLM,CHAT,64k",
2766
+ "max_tokens": 65535,
2767
+ "model_type": "chat"
2768
+ }
2769
+ ]
2770
  }
2771
  ]
2772
  }
rag/llm/__init__.py CHANGED
@@ -91,7 +91,8 @@ ChatModel = {
91
  "LeptonAI": LeptonAIChat,
92
  "TogetherAI": TogetherAIChat,
93
  "PerfXCloud": PerfXCloudChat,
94
- "Upstage":UpstageChat
 
95
  }
96
 
97
 
 
91
  "LeptonAI": LeptonAIChat,
92
  "TogetherAI": TogetherAIChat,
93
  "PerfXCloud": PerfXCloudChat,
94
+ "Upstage":UpstageChat,
95
+ "novita.ai": NovitaAIChat
96
  }
97
 
98
 
rag/llm/chat_model.py CHANGED
@@ -1009,3 +1009,11 @@ class UpstageChat(Base):
1009
  if not base_url:
1010
  base_url = "https://api.upstage.ai/v1/solar"
1011
  super().__init__(key, model_name, base_url)
 
 
 
 
 
 
 
 
 
1009
  if not base_url:
1010
  base_url = "https://api.upstage.ai/v1/solar"
1011
  super().__init__(key, model_name, base_url)
1012
+
1013
+
1014
+ class NovitaAIChat(Base):
1015
+ def __init__(self, key, model_name, base_url="https://api.novita.ai/v3/openai"):
1016
+ if not base_url:
1017
+ base_url = "https://api.novita.ai/v3/openai"
1018
+ super().__init__(key, model_name, base_url)
1019
+
web/src/assets/svg/llm/novita-ai.svg ADDED
web/src/pages/user-setting/setting-model/constant.ts CHANGED
@@ -27,7 +27,8 @@ export const IconMap = {
27
  Lepton: 'lepton',
28
  TogetherAI:'together-ai',
29
  PerfXCould: 'perfx-could',
30
- Upstage: 'upstage'
 
31
  };
32
 
33
  export const BedrockRegionList = [
 
27
  Lepton: 'lepton',
28
  TogetherAI:'together-ai',
29
  PerfXCould: 'perfx-could',
30
+ Upstage: 'upstage',
31
+ "novita.ai": 'novita-ai'
32
  };
33
 
34
  export const BedrockRegionList = [