Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions frontend/src/components/ModelSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export const MODEL_CONFIG: Record<string, ModelCfg> = {
displayName: "Llama 3.3 70B",
tokenLimit: 70000
},
"llama3-3-70b": {
displayName: "Llama 3.3 70B",
tokenLimit: 70000
},
Comment on lines +31 to +34
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Duplicate model configuration for identical model. Will cause both models to appear in dropdown, confusing users

"google/gemma-3-27b-it": {
displayName: "Gemma 3 27B",
badge: "Starter",
Expand Down Expand Up @@ -113,9 +117,6 @@ export function ModelSelector({
const filteredModels = models.filter((model) => {
if (model.id === "latest") return false;

// Filter out duplicate llama model
if (model.id === "llama3-3-70b") return false;

// Filter out models with lowercase 'instruct' or 'embed' in their ID
if (model.id.includes("instruct") || model.id.includes("embed")) {
return false;
Expand Down
21 changes: 15 additions & 6 deletions frontend/src/state/LocalStateContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useOpenSecret } from "@opensecret/react";
import { useState } from "react";
import { BillingStatus } from "@/billing/billingApi";
import { LocalStateContext, Chat, HistoryItem, OpenSecretModel } from "./LocalStateContextDef";
import { aliasModelName } from "@/utils/utils";

export {
LocalStateContext,
Expand All @@ -11,23 +12,23 @@ export {
type LocalState
} from "./LocalStateContextDef";

export const DEFAULT_MODEL_ID = "ibnzterrell/Meta-Llama-3.3-70B-Instruct-AWQ-INT4";
export const DEFAULT_MODEL_ID = "llama3-3-70b";

export const LocalStateProvider = ({ children }: { children: React.ReactNode }) => {
/** The model that should be assumed when a chat doesn't yet have one */
const llamaModel: OpenSecretModel = {
id: DEFAULT_MODEL_ID,
object: "model",
created: Date.now(),
owned_by: "ibnzterrell",
owned_by: "meta",
tasks: ["generate"]
};
Comment on lines +15 to 25
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify model compatibility across the codebase

The model ID change from "ibnzterrell/Meta-Llama-3.3-70B-Instruct-AWQ-INT4" to "llama3-3-70b" may impact other parts of the codebase that reference the old model ID.


🏁 Script executed:

#!/bin/bash
# Description: Search for any remaining references to the old model ID
echo "Searching for references to the old model ID..."
rg -i "ibnzterrell/Meta-Llama-3.3-70B-Instruct-AWQ-INT4" --type ts --type tsx --type js --type jsx

echo -e "\nSearching for any hardcoded references to 'ibnzterrell' as owner..."
rg -i "ibnzterrell" --type ts --type tsx --type js --type jsx

echo -e "\nVerifying the new model ID is properly configured..."
rg -A 3 -B 3 "llama3-3-70b"

Length of output: 1614


🏁 Script executed:

#!/bin/bash
# Description: Search across all files (no type filters) for any lingering references

echo "Searching for any remaining references to the old model ID in all files..."
rg -i "ibnzterrell/Meta-Llama-3.3-70B-Instruct-AWQ-INT4" || echo "No matches for old model ID."

echo -e "\nSearching for any hardcoded references to 'ibnzterrell' as owner..."
rg -i "ibnzterrell" || echo "No matches for owner 'ibnzterrell'."

echo -e "\nVerifying the new model ID is configured everywhere..."
rg -i "llama3-3-70b" || echo "No occurrences of new model ID found."

Length of output: 885


Fix leftover old model ID in ModelSelector.tsx

We found a lingering entry for the old model ID in frontend/src/components/ModelSelector.tsx. Please remove or rename it to match the new ID:

• File: frontend/src/components/ModelSelector.tsx
• Location: the object key for "ibnzterrell/Meta-Llama-3.3-70B-Instruct-AWQ-INT4"

Suggested diff:

   // …other model entries…
-  "ibnzterrell/Meta-Llama-3.3-70B-Instruct-AWQ-INT4": {
+  "llama3-3-70b": {
     displayName: "Llama 3.3 70B",
     tokenLimit: 70000
   },

This ensures we no longer reference the deprecated model ID and consolidate on "llama3-3-70b".

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In frontend/src/components/ModelSelector.tsx, locate the object key referencing
"ibnzterrell/Meta-Llama-3.3-70B-Instruct-AWQ-INT4" and either remove it or
rename it to "llama3-3-70b" to match the updated model ID used in
LocalStateContext.tsx. This will eliminate references to the deprecated model ID
and ensure consistency across the codebase.


const [localState, setLocalState] = useState({
userPrompt: "",
systemPrompt: null as string | null,
userImages: [] as File[],
model: import.meta.env.VITE_DEV_MODEL_OVERRIDE || DEFAULT_MODEL_ID,
model: aliasModelName(import.meta.env.VITE_DEV_MODEL_OVERRIDE) || DEFAULT_MODEL_ID,
availableModels: [llamaModel] as OpenSecretModel[],
billingStatus: null as BillingStatus | null,
searchQuery: "",
Expand All @@ -40,7 +41,7 @@ export const LocalStateProvider = ({ children }: { children: React.ReactNode })
async function persistChat(chat: Chat) {
const chatToSave = {
/** If a model is missing, assume the default Llama and write it now */
model: chat.model || DEFAULT_MODEL_ID,
model: aliasModelName(chat.model) || DEFAULT_MODEL_ID,
...chat
};

Expand Down Expand Up @@ -123,7 +124,12 @@ export const LocalStateProvider = ({ children }: { children: React.ReactNode })
try {
const chat = await get(`chat_${id}`);
if (!chat) return undefined;
return JSON.parse(chat) as Chat;
const parsedChat = JSON.parse(chat) as Chat;
// Alias the model name for backward compatibility
if (parsedChat.model) {
parsedChat.model = aliasModelName(parsedChat.model);
}
return parsedChat;
} catch (error) {
console.error("Error fetching chat:", error);
return undefined;
Expand Down Expand Up @@ -253,7 +259,10 @@ export const LocalStateProvider = ({ children }: { children: React.ReactNode })
}

function setModel(model: string) {
setLocalState((prev) => (prev.model === model ? prev : { ...prev, model }));
const aliasedModel = aliasModelName(model);
setLocalState((prev) =>
prev.model === aliasedModel ? prev : { ...prev, model: aliasedModel }
);
}

function setAvailableModels(models: OpenSecretModel[]) {
Expand Down
15 changes: 15 additions & 0 deletions frontend/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,18 @@ export function useClickOutside(
};
}, [ref, callback]);
}

/**
* Alias old model names to new simplified names
* This ensures backward compatibility when the backend changes model names
*/
export function aliasModelName(modelName: string | undefined): string {
if (!modelName) return "";

// Map old complicated model name to new simplified name
if (modelName === "ibnzterrell/Meta-Llama-3.3-70B-Instruct-AWQ-INT4") {
return "llama3-3-70b";
}

return modelName;
}
Loading