From e0e3f7f32cddf1999b154782b76429d950da7318 Mon Sep 17 00:00:00 2001 From: zaidmukaddam Date: Wed, 18 Sep 2024 22:54:50 +0530 Subject: [PATCH] add pixtral 12b --- app/api/chat/route.ts | 4 +++- app/search/page.tsx | 8 +++++++- package.json | 1 + pnpm-lock.yaml | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index dde9752..7b2feed 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -1,5 +1,6 @@ import { z } from "zod"; import { createAzure } from '@ai-sdk/azure'; +import { mistral } from '@ai-sdk/mistral'; import { convertToCoreMessages, streamText, @@ -49,6 +50,7 @@ const anthropicVertex = createAnthropicVertex({ const registry = experimental_createProviderRegistry({ anthropicVertex, azure, + mistral, }); function sanitizeUrl(url: string): string { @@ -72,7 +74,7 @@ export async function POST(req: Request) { model: registry.languageModel(model), messages: convertToCoreMessages(messages), temperature: provider === "azure" ? 0.72 : 0, - topP: 0, + topP: provider === "mistral" ? 1 : 0, frequencyPenalty: 0, presencePenalty: 0, system: ` diff --git a/app/search/page.tsx b/app/search/page.tsx index bd6d2c6..1e5b28e 100644 --- a/app/search/page.tsx +++ b/app/search/page.tsx @@ -71,7 +71,8 @@ import { Clock, Cpu, Network, - ExternalLink + ExternalLink, + Camera } from 'lucide-react'; import { HoverCard, @@ -2370,6 +2371,7 @@ The o1-mini is a new OpenAI model that is optimized for reasoning tasks. Current const models = [ { value: "azure:gpt4o-mini", label: "OpenAI", icon: Zap, description: "High speed, lower quality", color: "emerald" }, + { value: "mistral:pixtral-12b-2409", label: "Mistral", icon: Camera, description: "Pixtral 12B", color: "blue" }, { value: "anthropicVertex:claude-3-5-sonnet@20240620", label: "Claude", icon: Sparkles, description: "High quality, lower speed", color: "indigo" }, { value: "openai/o1-mini", label: "Reasoning", icon: Flame, description: "Experimental model", color: "orange" }, ] @@ -2398,6 +2400,10 @@ The o1-mini is a new OpenAI model that is optimized for reasoning tasks. Current return isSelected ? '!bg-orange-500 !text-white hover:!bg-orange-600' : '!text-orange-700 hover:!bg-orange-100'; + case 'blue': + return isSelected + ? '!bg-blue-500 !text-white hover:!bg-blue-600' + : '!text-blue-700 hover:!bg-blue-100'; default: return isSelected ? 'bg-gray-500 text-white hover:bg-gray-600' diff --git a/package.json b/package.json index 8a13168..a8b3c90 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@ai-sdk/azure": "^0.0.31", "@ai-sdk/cohere": "latest", "@ai-sdk/google": "^0.0.46", + "@ai-sdk/mistral": "^0.0.41", "@ai-sdk/openai": "^0.0.58", "@e2b/code-interpreter": "^0.0.8", "@foobar404/wave": "^2.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 41f5425..ef8995c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ dependencies: '@ai-sdk/google': specifier: ^0.0.46 version: 0.0.46(zod@3.23.8) + '@ai-sdk/mistral': + specifier: ^0.0.41 + version: 0.0.41(zod@3.23.8) '@ai-sdk/openai': specifier: ^0.0.58 version: 0.0.58(zod@3.23.8) @@ -252,6 +255,17 @@ packages: zod: 3.23.8 dev: false + /@ai-sdk/mistral@0.0.41(zod@3.23.8): + resolution: {integrity: sha512-UTVtdC61AF4KQWnM3VAoo6/gi7G1frL3qVlKyW5toiRAUjCdeqLJUF2ho2iO8yqf+qIT6j57jWT3o6pqREy3Wg==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.0.0 + dependencies: + '@ai-sdk/provider': 0.0.23 + '@ai-sdk/provider-utils': 1.0.19(zod@3.23.8) + zod: 3.23.8 + dev: false + /@ai-sdk/openai@0.0.53(zod@3.23.8): resolution: {integrity: sha512-Wm4+EYG2Zl5WmhvZJrLhrBY+C46FEQmDjQ9ZB5h2DvRoJZNKtNiVNFMEQuyBK7QwivvlCSMJkPRBfFcbJgNLMQ==} engines: {node: '>=18'}