Skip to content

Commit

Permalink
Remove mistral-next model from supported models. (#4052)
Browse files Browse the repository at this point in the history
* Remove mistral-next model from supported models.

* 👕

* 📝
  • Loading branch information
flvndvd authored Feb 29, 2024
1 parent b831ee1 commit b89f4b9
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 75 deletions.
7 changes: 0 additions & 7 deletions front/components/assistant_builder/InstructionScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
GPT_4_TURBO_MODEL_CONFIG,
MISTRAL_LARGE_MODEL_CONFIG,
MISTRAL_MEDIUM_MODEL_CONFIG,
MISTRAL_NEXT_MODEL_CONFIG,
MISTRAL_SMALL_MODEL_CONFIG,
Ok,
} from "@dust-tt/types";
Expand Down Expand Up @@ -97,7 +96,6 @@ export function InstructionScreen({
<div className="flex-grow" />
<div className="self-end">
<AdvancedSettings
owner={owner}
plan={plan}
generationSettings={builderState.generationSettings}
setGenerationSettings={(generationSettings) => {
Expand Down Expand Up @@ -134,12 +132,10 @@ export function InstructionScreen({
}

function AdvancedSettings({
owner,
plan,
generationSettings,
setGenerationSettings,
}: {
owner: WorkspaceType;
plan: PlanType;
generationSettings: AssistantBuilderState["generationSettings"];
setGenerationSettings: (
Expand All @@ -156,9 +152,6 @@ function AdvancedSettings({
MISTRAL_LARGE_MODEL_CONFIG,
GEMINI_PRO_DEFAULT_MODEL_CONFIG,
];
if (owner.flags.includes("mistral_next")) {
usedModelConfigs.push(MISTRAL_NEXT_MODEL_CONFIG);
}

const supportedModelConfig = getSupportedModelConfig(
generationSettings.modelSettings
Expand Down
50 changes: 1 addition & 49 deletions front/lib/api/assistant/global_agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
GPT_3_5_TURBO_MODEL_CONFIG,
MISTRAL_LARGE_MODEL_CONFIG,
MISTRAL_MEDIUM_MODEL_CONFIG,
MISTRAL_NEXT_MODEL_CONFIG,
MISTRAL_SMALL_MODEL_CONFIG,
} from "@dust-tt/types";
import { DustAPI } from "@dust-tt/types";
Expand Down Expand Up @@ -283,40 +282,6 @@ async function _getMistralLargeGlobalAgent({
};
}

async function _getMistralNextGlobalAgent({
auth,
settings,
}: {
auth: Authenticator;
settings: GlobalAgentSettings | null;
}): Promise<AgentConfigurationType> {
const status = !auth.isUpgraded() ? "disabled_free_workspace" : "active";

return {
id: -1,
sId: GLOBAL_AGENTS_SID.MISTRAL_NEXT,
version: 0,
versionCreatedAt: null,
versionAuthorId: null,
name: "mistral-next",
description: MISTRAL_NEXT_MODEL_CONFIG.description,
pictureUrl: "https://dust.tt/static/systemavatar/mistral_avatar_full.png",
status: settings ? settings.status : status,
scope: "global",
userListStatus: status === "active" ? "in-list" : "not-in-list",
generation: {
id: -1,
prompt: "",
model: {
providerId: MISTRAL_NEXT_MODEL_CONFIG.providerId,
modelId: MISTRAL_NEXT_MODEL_CONFIG.modelId,
},
temperature: 0.7,
},
action: null,
};
}

async function _getMistralMediumGlobalAgent({
auth,
settings,
Expand Down Expand Up @@ -809,12 +774,6 @@ export async function getGlobalAgent(
auth,
});
break;
case GLOBAL_AGENTS_SID.MISTRAL_NEXT:
agentConfiguration = await _getMistralNextGlobalAgent({
settings,
auth,
});
break;
case GLOBAL_AGENTS_SID.MISTRAL_MEDIUM:
agentConfiguration = await _getMistralMediumGlobalAgent({
settings,
Expand Down Expand Up @@ -898,14 +857,7 @@ export async function getGlobalAgents(
}
const preFetchedDataSources = dsRes.value;

let agentsIdsToFetch = Object.values(agentIds ?? GLOBAL_AGENTS_SID);

// Mistral-next flag.
if (!owner.flags.includes("mistral_next")) {
agentsIdsToFetch = agentsIdsToFetch.filter(
(agentId) => agentId !== GLOBAL_AGENTS_SID.MISTRAL_NEXT
);
}
const agentsIdsToFetch = Object.values(agentIds ?? GLOBAL_AGENTS_SID);

// For now we retrieve them all
// We will store them in the database later to allow admin enable them or not
Expand Down
2 changes: 0 additions & 2 deletions front/lib/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export enum GLOBAL_AGENTS_SID {
CLAUDE_INSTANT = "claude-instant-1",
MISTRAL_LARGE = "mistral-large",
MISTRAL_MEDIUM = "mistral-medium",
MISTRAL_NEXT = "mistral-next",
//!\ TEMPORARY WORKAROUND: Renaming 'mistral' to 'mistral-small' is not feasible since
// it interferes with the retrieval of ongoing conversations involving this agent.
// Needed to preserve ongoing chat integrity due to 'sId=mistral' references in legacy messages.
Expand All @@ -69,7 +68,6 @@ const CUSTOM_ORDER: string[] = [
GLOBAL_AGENTS_SID.CLAUDE_INSTANT,
GLOBAL_AGENTS_SID.MISTRAL_LARGE,
GLOBAL_AGENTS_SID.MISTRAL_MEDIUM,
GLOBAL_AGENTS_SID.MISTRAL_NEXT,
GLOBAL_AGENTS_SID.MISTRAL_SMALL,
GLOBAL_AGENTS_SID.GEMINI_PRO,
GLOBAL_AGENTS_SID.HELPER,
Expand Down
1 change: 0 additions & 1 deletion types/src/front/feature_flags.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export const WHITELISTABLE_FEATURES = [
"auto_pre_ingest_all_databases",
"mistral_next",
"structured_data",
"workspace_analytics",
"usage_data_api",
Expand Down
19 changes: 3 additions & 16 deletions types/src/front/lib/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export const CLAUDE_INSTANT_DEFAULT_MODEL_CONFIG = {

export const MISTRAL_LARGE_MODEL_ID = "mistral-large-latest" as const;
export const MISTRAL_MEDIUM_MODEL_ID = "mistral-medium" as const;
export const MISTRAL_NEXT_MODEL_ID = "mistral-next" as const;
export const MISTRAL_SMALL_MODEL_ID = "mistral-small" as const;

export const MISTRAL_LARGE_MODEL_CONFIG = {
Expand All @@ -85,29 +84,18 @@ export const MISTRAL_LARGE_MODEL_CONFIG = {
contextSize: 31500,
recommendedTopK: 16,
largeModel: true,
description: "Mistral latest `large` model (32k context).",
description: "Mistral's latest `large` model (32k context).",
shortDescription: "Mistral's large model.",
} as const;

export const MISTRAL_NEXT_MODEL_CONFIG = {
providerId: "mistral" as const,
modelId: MISTRAL_NEXT_MODEL_ID,
displayName: "Mistral (next)",
contextSize: 31500,
recommendedTopK: 16,
largeModel: true,
description: "Mistral's next generation model (32k context).",
shortDescription: "Mistral's next model.",
} as const;

export const MISTRAL_MEDIUM_MODEL_CONFIG = {
providerId: "mistral" as const,
modelId: MISTRAL_MEDIUM_MODEL_ID,
displayName: "Mistral Medium",
contextSize: 31500,
recommendedTopK: 16,
largeModel: true,
description: "Mistral latest `medium` model (32k context).",
description: "Mistral's latest `medium` model (32k context).",
shortDescription: "Mistral's smartest model.",
} as const;

Expand All @@ -118,7 +106,7 @@ export const MISTRAL_SMALL_MODEL_CONFIG = {
contextSize: 31500,
recommendedTopK: 16,
largeModel: false,
description: "Mistral latest model (8x7B Instruct, 32k context).",
description: "Mistral's latest model (8x7B Instruct, 32k context).",
shortDescription: "Mistral's fast model.",
} as const;

Expand All @@ -142,7 +130,6 @@ export const SUPPORTED_MODEL_CONFIGS = [
CLAUDE_INSTANT_DEFAULT_MODEL_CONFIG,
MISTRAL_LARGE_MODEL_CONFIG,
MISTRAL_MEDIUM_MODEL_CONFIG,
MISTRAL_NEXT_MODEL_CONFIG,
MISTRAL_SMALL_MODEL_CONFIG,
GEMINI_PRO_DEFAULT_MODEL_CONFIG,
] as const;
Expand Down

0 comments on commit b89f4b9

Please sign in to comment.