add support for Upstage (#1902)
Browse files### What problem does this PR solve?
#1853 add support for Upstage
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
Co-authored-by: Zhedong Cen <[email protected]>
conf/llm_factories.json
CHANGED
@@ -2601,6 +2601,38 @@
|
|
2601 |
"model_type": "embedding"
|
2602 |
}
|
2603 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2604 |
}
|
2605 |
]
|
2606 |
}
|
|
|
2601 |
"model_type": "embedding"
|
2602 |
}
|
2603 |
]
|
2604 |
+
},
|
2605 |
+
{
|
2606 |
+
"name": "Upstage",
|
2607 |
+
"logo": "",
|
2608 |
+
"tags": "LLM,TEXT EMBEDDING",
|
2609 |
+
"status": "1",
|
2610 |
+
"llm": [
|
2611 |
+
{
|
2612 |
+
"llm_name": "solar-1-mini-chat",
|
2613 |
+
"tags": "LLM,CHAT,32k",
|
2614 |
+
"max_tokens": 32768,
|
2615 |
+
"model_type": "chat"
|
2616 |
+
},
|
2617 |
+
{
|
2618 |
+
"llm_name": "solar-1-mini-chat-ja",
|
2619 |
+
"tags": "LLM,CHAT,32k",
|
2620 |
+
"max_tokens": 32768,
|
2621 |
+
"model_type": "chat"
|
2622 |
+
},
|
2623 |
+
{
|
2624 |
+
"llm_name": "solar-embedding-1-large-query",
|
2625 |
+
"tags": "TEXT EMBEDDING",
|
2626 |
+
"max_tokens": 4000,
|
2627 |
+
"model_type": "embedding"
|
2628 |
+
},
|
2629 |
+
{
|
2630 |
+
"llm_name": "solar-embedding-1-large-passage",
|
2631 |
+
"tags": "TEXT EMBEDDING",
|
2632 |
+
"max_tokens": 4000,
|
2633 |
+
"model_type": "embedding"
|
2634 |
+
}
|
2635 |
+
]
|
2636 |
}
|
2637 |
]
|
2638 |
}
|
rag/llm/__init__.py
CHANGED
@@ -41,6 +41,7 @@ EmbeddingModel = {
|
|
41 |
"cohere": CoHereEmbed,
|
42 |
"TogetherAI": TogetherAIEmbed,
|
43 |
"PerfXCloud": PerfXCloudEmbed,
|
|
|
44 |
}
|
45 |
|
46 |
|
@@ -89,7 +90,8 @@ ChatModel = {
|
|
89 |
"cohere": CoHereChat,
|
90 |
"LeptonAI": LeptonAIChat,
|
91 |
"TogetherAI": TogetherAIChat,
|
92 |
-
"PerfXCloud": PerfXCloudChat
|
|
|
93 |
}
|
94 |
|
95 |
|
|
|
41 |
"cohere": CoHereEmbed,
|
42 |
"TogetherAI": TogetherAIEmbed,
|
43 |
"PerfXCloud": PerfXCloudEmbed,
|
44 |
+
"Upstage": UpstageEmbed
|
45 |
}
|
46 |
|
47 |
|
|
|
90 |
"cohere": CoHereChat,
|
91 |
"LeptonAI": LeptonAIChat,
|
92 |
"TogetherAI": TogetherAIChat,
|
93 |
+
"PerfXCloud": PerfXCloudChat,
|
94 |
+
"Upstage":UpstageChat
|
95 |
}
|
96 |
|
97 |
|
rag/llm/chat_model.py
CHANGED
@@ -1002,3 +1002,10 @@ class PerfXCloudChat(Base):
|
|
1002 |
if not base_url:
|
1003 |
base_url = "https://cloud.perfxlab.cn/v1"
|
1004 |
super().__init__(key, model_name, base_url)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1002 |
if not base_url:
|
1003 |
base_url = "https://cloud.perfxlab.cn/v1"
|
1004 |
super().__init__(key, model_name, base_url)
|
1005 |
+
|
1006 |
+
|
1007 |
+
class UpstageChat(Base):
|
1008 |
+
def __init__(self, key, model_name, base_url="https://api.upstage.ai/v1/solar"):
|
1009 |
+
if not base_url:
|
1010 |
+
base_url = "https://api.upstage.ai/v1/solar"
|
1011 |
+
super().__init__(key, model_name, base_url)
|
rag/llm/embedding_model.py
CHANGED
@@ -567,4 +567,10 @@ class PerfXCloudEmbed(OpenAIEmbed):
|
|
567 |
if not base_url:
|
568 |
base_url = "https://cloud.perfxlab.cn/v1"
|
569 |
super().__init__(key, model_name, base_url)
|
570 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
567 |
if not base_url:
|
568 |
base_url = "https://cloud.perfxlab.cn/v1"
|
569 |
super().__init__(key, model_name, base_url)
|
570 |
+
|
571 |
+
|
572 |
+
class UpstageEmbed(OpenAIEmbed):
|
573 |
+
def __init__(self, key, model_name, base_url="https://api.upstage.ai/v1/solar"):
|
574 |
+
if not base_url:
|
575 |
+
base_url = "https://api.upstage.ai/v1/solar"
|
576 |
+
super().__init__(key, model_name, base_url)
|
web/src/assets/svg/llm/upstage.svg
ADDED
|
web/src/pages/user-setting/setting-model/constant.ts
CHANGED
@@ -26,7 +26,8 @@ export const IconMap = {
|
|
26 |
cohere: 'cohere',
|
27 |
Lepton: 'lepton',
|
28 |
TogetherAI:'together-ai',
|
29 |
-
PerfXCould: 'perfx-could'
|
|
|
30 |
};
|
31 |
|
32 |
export const BedrockRegionList = [
|
|
|
26 |
cohere: 'cohere',
|
27 |
Lepton: 'lepton',
|
28 |
TogetherAI:'together-ai',
|
29 |
+
PerfXCould: 'perfx-could',
|
30 |
+
Upstage: 'upstage'
|
31 |
};
|
32 |
|
33 |
export const BedrockRegionList = [
|