adds mistral-large model family, untested
This commit is contained in:
@@ -296,6 +296,7 @@ export const config: Config = {
|
||||
"mistral-tiny",
|
||||
"mistral-small",
|
||||
"mistral-medium",
|
||||
"mistral-large",
|
||||
"aws-claude",
|
||||
"azure-turbo",
|
||||
"azure-gpt4",
|
||||
|
||||
+3
-2
@@ -20,8 +20,9 @@ const MODEL_FAMILY_FRIENDLY_NAME: { [f in ModelFamily]: string } = {
|
||||
"claude": "Claude",
|
||||
"gemini-pro": "Gemini Pro",
|
||||
"mistral-tiny": "Mistral 7B",
|
||||
"mistral-small": "Mixtral 8x7B",
|
||||
"mistral-medium": "Mistral Medium (prototype)",
|
||||
"mistral-small": "Mixtral Small", // Originally 8x7B, but that now refers to the older open-weight version. Mixtral Small is a newer closed-weight update to the 8x7B model.
|
||||
"mistral-medium": "Mistral Medium",
|
||||
"mistral-large": "Mistral Large",
|
||||
"aws-claude": "AWS Claude",
|
||||
"azure-turbo": "Azure GPT-3.5 Turbo",
|
||||
"azure-gpt4": "Azure GPT-4",
|
||||
|
||||
@@ -27,6 +27,7 @@ export const KNOWN_MISTRAL_AI_MODELS = [
|
||||
"mistral-tiny",
|
||||
"mistral-small",
|
||||
"mistral-medium",
|
||||
"mistral-large",
|
||||
];
|
||||
|
||||
let modelsCache: any = null;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import axios, { AxiosError } from "axios";
|
||||
import type { MistralAIModelFamily, OpenAIModelFamily } from "../../models";
|
||||
import type { MistralAIModelFamily } from "../../models";
|
||||
import { KeyCheckerBase } from "../key-checker-base";
|
||||
import type { MistralAIKey, MistralAIKeyProvider } from "./provider";
|
||||
import { getMistralAIModelFamily, getOpenAIModelFamily } from "../../models";
|
||||
import { getMistralAIModelFamily } from "../../models";
|
||||
|
||||
const MIN_CHECK_INTERVAL = 3 * 1000; // 3 seconds
|
||||
const KEY_CHECK_PERIOD = 60 * 60 * 1000; // 1 hour
|
||||
|
||||
@@ -5,21 +5,6 @@ import { logger } from "../../../logger";
|
||||
import { MistralAIModelFamily, getMistralAIModelFamily } from "../../models";
|
||||
import { MistralAIKeyChecker } from "./checker";
|
||||
|
||||
export type MistralAIModel =
|
||||
| "mistral-tiny"
|
||||
| "mistral-small"
|
||||
| "mistral-medium";
|
||||
|
||||
export type MistralAIKeyUpdate = Omit<
|
||||
Partial<MistralAIKey>,
|
||||
| "key"
|
||||
| "hash"
|
||||
| "lastUsed"
|
||||
| "promptCount"
|
||||
| "rateLimitedAt"
|
||||
| "rateLimitedUntil"
|
||||
>;
|
||||
|
||||
type MistralAIKeyUsage = {
|
||||
[K in MistralAIModelFamily as `${K}Tokens`]: number;
|
||||
};
|
||||
@@ -66,7 +51,12 @@ export class MistralAIKeyProvider implements KeyProvider<MistralAIKey> {
|
||||
const newKey: MistralAIKey = {
|
||||
key,
|
||||
service: this.service,
|
||||
modelFamilies: ["mistral-tiny", "mistral-small", "mistral-medium"],
|
||||
modelFamilies: [
|
||||
"mistral-tiny",
|
||||
"mistral-small",
|
||||
"mistral-medium",
|
||||
"mistral-large",
|
||||
],
|
||||
isDisabled: false,
|
||||
isRevoked: false,
|
||||
promptCount: 0,
|
||||
@@ -82,6 +72,7 @@ export class MistralAIKeyProvider implements KeyProvider<MistralAIKey> {
|
||||
"mistral-tinyTokens": 0,
|
||||
"mistral-smallTokens": 0,
|
||||
"mistral-mediumTokens": 0,
|
||||
"mistral-largeTokens": 0,
|
||||
};
|
||||
this.keys.push(newKey);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@ export type GoogleAIModelFamily = "gemini-pro";
|
||||
export type MistralAIModelFamily =
|
||||
| "mistral-tiny"
|
||||
| "mistral-small"
|
||||
| "mistral-medium";
|
||||
| "mistral-medium"
|
||||
| "mistral-large";
|
||||
export type AwsBedrockModelFamily = "aws-claude";
|
||||
export type AzureOpenAIModelFamily = `azure-${Exclude<
|
||||
OpenAIModelFamily,
|
||||
@@ -54,6 +55,7 @@ export const MODEL_FAMILIES = (<A extends readonly ModelFamily[]>(
|
||||
"mistral-tiny",
|
||||
"mistral-small",
|
||||
"mistral-medium",
|
||||
"mistral-large",
|
||||
"aws-claude",
|
||||
"azure-turbo",
|
||||
"azure-gpt4",
|
||||
@@ -103,6 +105,7 @@ export const MODEL_FAMILY_SERVICE: {
|
||||
"mistral-tiny": "mistral-ai",
|
||||
"mistral-small": "mistral-ai",
|
||||
"mistral-medium": "mistral-ai",
|
||||
"mistral-large": "mistral-ai",
|
||||
};
|
||||
|
||||
pino({ level: "debug" }).child({ module: "startup" });
|
||||
@@ -127,11 +130,13 @@ export function getGoogleAIModelFamily(_model: string): ModelFamily {
|
||||
}
|
||||
|
||||
export function getMistralAIModelFamily(model: string): MistralAIModelFamily {
|
||||
switch (model) {
|
||||
const prunedModel = model.replace(/-latest$/, "");
|
||||
switch (prunedModel) {
|
||||
case "mistral-tiny":
|
||||
case "mistral-small":
|
||||
case "mistral-medium":
|
||||
return model;
|
||||
case "mistral-large":
|
||||
return model as MistralAIModelFamily;
|
||||
default:
|
||||
return "mistral-tiny";
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ const INITIAL_TOKENS: Required<UserTokenCounts> = {
|
||||
"mistral-tiny": 0,
|
||||
"mistral-small": 0,
|
||||
"mistral-medium": 0,
|
||||
"mistral-large": 0,
|
||||
"aws-claude": 0,
|
||||
"azure-turbo": 0,
|
||||
"azure-gpt4": 0,
|
||||
|
||||
Reference in New Issue
Block a user