-
Notifications
You must be signed in to change notification settings - Fork 7
Simple llama naming #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple llama naming #157
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify model compatibility across the codebase The model ID change from 🏁 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 • File: 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
🤖 Prompt for AI Agents |
||
|
|
||
| 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: "", | ||
|
|
@@ -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 | ||
| }; | ||
|
|
||
|
|
@@ -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; | ||
|
|
@@ -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[]) { | ||
|
|
||
There was a problem hiding this comment.
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