diff --git a/src/commands/chat/providers.tsx b/src/commands/chat/providers.tsx index 1ebd11f..a01ff99 100644 --- a/src/commands/chat/providers.tsx +++ b/src/commands/chat/providers.tsx @@ -1,4 +1,4 @@ -import openAi from '../../engine/providers/openAi.js'; +import openAi from '../../engine/providers/open-ai.js'; import anthropic from '../../engine/providers/anthropic.js'; import perplexity from '../../engine/providers/perplexity.js'; import mistral from '../../engine/providers/mistral.js'; diff --git a/src/commands/chat/state/init.ts b/src/commands/chat/state/init.ts index 5a66ca4..c793838 100644 --- a/src/commands/chat/state/init.ts +++ b/src/commands/chat/state/init.ts @@ -26,9 +26,7 @@ export function initChatState( ? provider.modelAliases[modelOrAlias] ?? modelOrAlias : provider.defaultModel; - const systemPrompt = !provider.skipSystemPrompt?.includes(model) - ? providerFileConfig.systemPrompt ?? DEFAULT_SYSTEM_PROMPT - : undefined; + const systemPrompt = providerFileConfig.systemPrompt ?? DEFAULT_SYSTEM_PROMPT; const providerConfig = { apiKey: providerFileConfig.apiKey, diff --git a/src/engine/providers/mistral.ts b/src/engine/providers/mistral.ts index eacb5df..969d80c 100644 --- a/src/engine/providers/mistral.ts +++ b/src/engine/providers/mistral.ts @@ -26,14 +26,15 @@ const Mistral: Provider = { modelPricing: { 'open-mistral-7b': { inputTokensCost: 0.25, outputTokensCost: 0.25 }, 'open-mixtral-8x7b': { inputTokensCost: 0.7, outputTokensCost: 0.7 }, - 'mistral-small-latest': { inputTokensCost: 2, outputTokensCost: 6 }, + 'open-mixtral-8x22b': { inputTokensCost: 2, outputTokensCost: 6 }, + 'mistral-small-latest': { inputTokensCost: 1, outputTokensCost: 3 }, 'mistral-medium-latest': { inputTokensCost: 2.7, outputTokensCost: 8.1 }, - 'mistral-large-latest': { inputTokensCost: 8, outputTokensCost: 24 }, + 'mistral-large-latest': { inputTokensCost: 4, outputTokensCost: 12 }, }, modelAliases: { mistral: 'open-mistral-7b', - mixtral: 'open-mixtral-8x7b', + mixtral: 'open-mixtral-8x22b', small: 'mistral-small-latest', medium: 'mistral-medium-latest', large: 'mistral-large-latest', diff --git a/src/engine/providers/openAi.ts b/src/engine/providers/open-ai.ts similarity index 100% rename from src/engine/providers/openAi.ts rename to src/engine/providers/open-ai.ts diff --git a/src/engine/providers/perplexity.ts b/src/engine/providers/perplexity.ts index bc407ee..bc71b5b 100644 --- a/src/engine/providers/perplexity.ts +++ b/src/engine/providers/perplexity.ts @@ -10,38 +10,37 @@ const Perplexity: Provider = { apiKeyUrl: 'https://perplexity.ai/settings/api', // Perplexity models: https://docs.perplexity.ai/docs/model-cards - defaultModel: 'sonar-medium-chat', + defaultModel: 'llama-3-sonar-large-32k-chat', // Price per 1M tokens [input, output], per 1k requests. // Source: https://docs.perplexity.ai/docs/model-cards // Source: https://docs.perplexity.ai/docs/pricing modelPricing: { - 'sonar-small-chat': { inputTokensCost: 0.2, outputTokensCost: 0.2 }, - 'sonar-medium-chat': { inputTokensCost: 0.6, outputTokensCost: 0.6 }, - 'sonar-small-online': { + 'llama-3-sonar-small-32k-chat': { inputTokensCost: 0.2, outputTokensCost: 0.2 }, + 'llama-3-sonar-small-32k-online': { inputTokensCost: 0.2, outputTokensCost: 0.2, requestsCost: 5, }, - 'sonar-medium-online': { + 'llama-3-sonar-large-32k-chat': { inputTokensCost: 0.6, outputTokensCost: 0.6 }, + 'llama-3-sonar-large-32k-online': { inputTokensCost: 0.6, outputTokensCost: 0.6, requestsCost: 5, }, - 'codellama-70b-instruct': { inputTokensCost: 1, outputTokensCost: 1 }, - 'mistral-7b-instruct': { inputTokensCost: 0.2, outputTokensCost: 0.2 }, + 'llama-3-8b-instruct': { inputTokensCost: 0.2, outputTokensCost: 0.2 }, + 'llama-3-70b-instruct': { inputTokensCost: 1, outputTokensCost: 1 }, 'mixtral-8x7b-instruct': { inputTokensCost: 0.6, outputTokensCost: 0.6 }, }, modelAliases: { - online: 'sonar-medium-online', - codellama: 'codellama-70b-instruct', - mistral: 'mistral-7b-instruct', - mixtral: 'mixtral-8x7b-instruct', + 'small': 'llama-3-sonar-small-32k-chat', + 'large': 'llama-3-sonar-large-32k-chat', + 'online': 'llama-3-sonar-large-32k-online', + 'llama-3': 'llama-3-70b-instruct', + 'mixtral': 'mixtral-8x7b-instruct', }, - skipSystemPrompt: ['sonar-small-online', 'sonar-medium-online'], - getChatCompletion: async (config: ProviderConfig, messages: Message[]) => { const api = new OpenAI({ apiKey: config.apiKey, diff --git a/src/engine/providers/provider.ts b/src/engine/providers/provider.ts index 98bc360..7a586c6 100644 --- a/src/engine/providers/provider.ts +++ b/src/engine/providers/provider.ts @@ -1,6 +1,6 @@ import type { Message, ModelResponse, ModelResponseUpdate } from '../inference.js'; import type { ProviderConfig } from './config.js'; -import openAi from './openAi.js'; +import openAi from './open-ai.js'; import perplexity from './perplexity.js'; import anthropic from './anthropic.js'; import mistral from './mistral.js'; @@ -17,8 +17,6 @@ export interface Provider { modelPricing: Record; modelAliases: Record; - skipSystemPrompt?: string[]; - getChatCompletion: (config: ProviderConfig, messages: Message[]) => Promise; getChatCompletionStream?: ( config: ProviderConfig,