Skip to content

Commit

Permalink
💄 style: update Novita AI model info & add NOVITA_MODEL_LIST support (
Browse files Browse the repository at this point in the history
  • Loading branch information
hezhijie0327 authored Sep 1, 2024
1 parent cdfcbfb commit 4ab33f6
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ ENV \
# Moonshot
MOONSHOT_API_KEY="" MOONSHOT_PROXY_URL="" \
# Novita
NOVITA_API_KEY="" \
NOVITA_API_KEY="" NOVITA_MODEL_LIST="" \
# Ollama
OLLAMA_MODEL_LIST="" OLLAMA_PROXY_URL="" \
# OpenAI
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.database
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ ENV \
# Moonshot
MOONSHOT_API_KEY="" MOONSHOT_PROXY_URL="" \
# Novita
NOVITA_API_KEY="" \
NOVITA_API_KEY="" NOVITA_MODEL_LIST="" \
# Ollama
OLLAMA_MODEL_LIST="" OLLAMA_PROXY_URL="" \
# OpenAI
Expand Down
2 changes: 2 additions & 0 deletions src/config/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const getLLMConfig = () => {

ENABLED_NOVITA: z.boolean(),
NOVITA_API_KEY: z.string().optional(),
NOVITA_MODEL_LIST: z.string().optional(),

ENABLED_BAICHUAN: z.boolean(),
BAICHUAN_API_KEY: z.string().optional(),
Expand Down Expand Up @@ -176,6 +177,7 @@ export const getLLMConfig = () => {

ENABLED_NOVITA: !!process.env.NOVITA_API_KEY,
NOVITA_API_KEY: process.env.NOVITA_API_KEY,
NOVITA_MODEL_LIST: process.env.NOVITA_MODEL_LIST,

ENABLED_BAICHUAN: !!process.env.BAICHUAN_API_KEY,
BAICHUAN_API_KEY: process.env.BAICHUAN_API_KEY,
Expand Down
78 changes: 42 additions & 36 deletions src/config/modelProviders/novita.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,47 @@
import { ModelProviderCard } from '@/types/llm';

// ref: https://novita.ai/model-api/product/llm-api
const Novita: ModelProviderCard = {
chatModels: [
{
displayName: 'Llama3 8B Instruct',
displayName: 'Llama3.1 8B Instruct',
enabled: true,
id: 'meta-llama/llama-3.1-8b-instruct',
tokens: 8192,
},
{
displayName: 'Llama3.1 70B Instruct',
enabled: true,
id: 'meta-llama/llama-3.1-70b-instruct',
tokens: 131_072,
},
{
displayName: 'Llama3.1 405B Instruct',
enabled: true,
id: 'meta-llama/llama-3.1-405b-instruct',
tokens: 32768,
},
{
displayName: 'Llama3 8B Instruct',
id: 'meta-llama/llama-3-8b-instruct',
tokens: 8192,
},
{
displayName: 'Llama3 70B Instruct',
enabled: true,
id: 'meta-llama/llama-3-70b-instruct',
tokens: 8192,
},
{
displayName: 'Nous Hermes 2 Pro - Llama3 8B',
displayName: 'Gemma 2 9B',
enabled: true,
id: 'nousresearch/hermes-2-pro-llama-3-8b',
id: 'google/gemma-2-9b-it',
tokens: 8192,
},
{
displayName: 'Nous Hermes - Llama2 8B',
displayName: 'Mistral Nemo',
enabled: true,
id: 'nousresearch/nous-hermes-llama2-13b',
tokens: 4096,
id: 'mistralai/mistral-nemo',
tokens: 32_768,
},
{
displayName: 'Mistral 7B Instruct',
Expand All @@ -33,55 +50,44 @@ const Novita: ModelProviderCard = {
tokens: 32_768,
},
{
displayName: 'Dolphin Mixtral 8x22B',
displayName: 'WizardLM 2 7B',
enabled: true,
id: 'cognitivecomputations/dolphin-mixtral-8x22b',
tokens: 16_000,
id: 'microsoft/wizardlm 2-7b',
tokens: 32_768,
},
{
displayName: 'L3-70b-Euryale-v2.1',
displayName: 'WizardLM-2 8x22B',
enabled: true,
id: 'sao10k/l3-70b-euryale-v2.1',
tokens: 16_000,
id: 'microsoft/wizardlm-2-8x22b',
tokens: 65_535,
},
{
displayName: 'Midnight Rose 70B',
enabled: true,
id: 'sophosympatheia/midnight-rose-70b',
tokens: 4096,
displayName: 'Dolphin Mixtral 8x22B',
id: 'cognitivecomputations/dolphin-mixtral-8x22b',
tokens: 16_000,
},
{
displayName: 'Mythomax L2 13b',
enabled: true,
id: 'gryphe/mythomax-l2-13b',
tokens: 4096,
displayName: 'Hermes 2 Pro Llama 3 8B',
id: 'nousresearch/hermes-2-pro-llama-3-8b',
tokens: 8192,
},
{
displayName: 'Nous Hermes 2 - Mixtral 8x7B-DPO',
enabled: true,
displayName: 'Hermes 2 Mixtral 8x7B DPO',
id: 'Nous-Hermes-2-Mixtral-8x7B-DPO',
tokens: 32_768,
},
{
displayName: 'Lzlv 70b',
enabled: true,
id: 'lzlv_70b',
displayName: 'MythoMax l2 13B',
id: 'gryphe/mythomax-l2-13b',
tokens: 4096,
},
{
displayName: 'Open Hermes 2.5 Mistral 7B',
enabled: true,
id: 'teknium/openhermes-2.5-mistral-7b',
displayName: 'OpenChat 7B',
id: 'openchat/openchat-7b',
tokens: 4096,
},
{
displayName: 'Wizardlm2 8x22B',
enabled: true,
id: 'microsoft/wizardlm-2-8x22b',
tokens: 65_535,
},
],
checkModel: 'meta-llama/llama-3-70b-instruct',
checkModel: 'meta-llama/llama-3.1-8b-instruct',
disableBrowserRequest: true,
id: 'novita',
modelList: { showModelFetcher: true },
Expand Down
12 changes: 11 additions & 1 deletion src/server/globalConfig/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { fileEnv } from '@/config/file';
import { langfuseEnv } from '@/config/langfuse';
import { getLLMConfig } from '@/config/llm';
import {
NovitaProviderCard,
OllamaProviderCard,
OpenAIProviderCard,
OpenRouterProviderCard,
Expand Down Expand Up @@ -39,7 +40,9 @@ export const getServerGlobalConfig = () => {
ENABLED_ANTHROPIC,
ENABLED_MINIMAX,
ENABLED_MISTRAL,

ENABLED_NOVITA,
NOVITA_MODEL_LIST,

ENABLED_QWEN,
QWEN_MODEL_LIST,
Expand Down Expand Up @@ -100,7 +103,14 @@ export const getServerGlobalConfig = () => {
minimax: { enabled: ENABLED_MINIMAX },
mistral: { enabled: ENABLED_MISTRAL },
moonshot: { enabled: ENABLED_MOONSHOT },
novita: { enabled: ENABLED_NOVITA },
novita: {
enabled: ENABLED_NOVITA,
enabledModels: extractEnabledModels(NOVITA_MODEL_LIST),
serverModelCards: transformToChatModelCards({
defaultChatModels: NovitaProviderCard.chatModels,
modelString: NOVITA_MODEL_LIST,
}),
},
ollama: {
enabled: ENABLED_OLLAMA,
fetchOnClient: !OLLAMA_PROXY_URL,
Expand Down

0 comments on commit 4ab33f6

Please sign in to comment.