-
Notifications
You must be signed in to change notification settings - Fork 61.1k
Update Model list and introduce a new deployment scirpt #6556
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
base: main
Are you sure you want to change the base?
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,53 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Configuration | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SERVER_USER="YOUR_USERNAME" # Replace with your server's username | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SERVER_IP="YOUR_SERVER_IP" # Replace with your server's IP address | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IMAGE_NAME="nextchat" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TAG="latest" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TAR_FILE="nextchat-image.tar" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+1
to
+7
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. Add a proper shebang and quote configurable values Without -# Configuration
+#/usr/bin/env bash
+# ---------------- Configuration ----------------
+set -euo pipefail
+
SERVER_USER="YOUR_USERNAME" # Replace with your server's username
SERVER_IP="YOUR_SERVER_IP" # Replace with your server's IP address
IMAGE_NAME="nextchat"
TAG="latest"
TAR_FILE="nextchat-image.tar"
🧰 Tools🪛 Shellcheck (0.10.0)[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. (SC2148) 🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
echo "Building NextChat Docker image locally..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Build the Docker image locally for AMD64 platform, change as needed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docker build --platform linux/amd64 -t ${IMAGE_NAME}:${TAG} . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if [ $? -ne 0 ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
echo "Docker build failed!" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
echo "Saving Docker image to tar file..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Save the image to a tar file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docker save -o ${TAR_FILE} ${IMAGE_NAME}:${TAG} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
echo "Transferring image to server..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Transfer the tar file to server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
scp ${TAR_FILE} ${SERVER_USER}@${SERVER_IP}:/tmp/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
echo "Loading image on server and running container..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# SSH to server and load the image, then run it, change the environment variables as needed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ssh ${SERVER_USER}@${SERVER_IP} << EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Load the Docker image | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docker load -i /tmp/${TAR_FILE} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Stop existing container if running | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docker stop nextchat 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docker rm nextchat 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Run the new container | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docker run -d -p 3000:3000 \\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--name nextchat \\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-e OPENAI_API_KEY=sk-xxxx \\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-e CODE=your-password \\ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
${IMAGE_NAME}:${TAG} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+28
to
+41
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. 🛠️ Refactor suggestion Here-document expands on the local machine, not the server Because the -ssh ${SERVER_USER}@${SERVER_IP} << EOF
+ssh "${SERVER_USER}@${SERVER_IP}" <<'EOF' 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Shellcheck (0.10.0)[warning] 28-28: Quote 'EOF' to make here document expansions happen on the server side rather than on the client. (SC2087) 🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Clean up the tar file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rm -f /tmp/${TAR_FILE} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
echo "NextChat is now running on port 3000!" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
echo "You can access it at: http://${SERVER_IP}:3000" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Clean up local tar file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rm -f ${TAR_FILE} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
echo "Deployment complete!" |
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.
💡 Verification agent
🧩 Analysis chain
Keep ancillary metadata in sync with the new model IDs
o1
,o1-pro
,o3-pro
,gemini-2.5-flash
,gemini-2.5-pro
,claude-opus-4-20250514
, andclaude-sonnet-4-20250514
are now surfaced to the UI but:•
KnowledgeCutOffDate
lacks entries for all of these newcomers, while it still contains the now-removedo1-mini*
ando1-preview*
.•
VISION_MODEL_REGEXES
does not covero1*
/o3-pro
; if they are multimodal they will silently lose image-upload UI affordances.• Any downstream “preferred default model” or “fast-path fall-backs” lists (e.g.
SUMMARIZE_MODEL
) were not revisited.Risk: users may pick a model that later hits missing metadata branches or loses expected features; the mis-aligned regex may break vision support.
and extend the
VISION_MODEL_REGEXES
:Also cull the stale
o1-mini*
/o1-preview*
constants to avoid dead-code drift.Also applies to: 557-559, 571-573
🏁 Script executed:
Length of output: 1989
Sync ancillary metadata & regexes for new model IDs
The UI now surfaces these new models but their metadata and vision support aren’t fully wired up. In app/constant.ts:
• In KnowledgeCutOffDate (around lines 427–462):
– Add missing entries for the new IDs with their cutoff dates:
•
"o1-pro": "2023-10"
•
"o3": "2023-10"
•
"o3-pro": "2023-10"
•
"o4-mini": "2023-10"
•
"gemini-2.5-flash": "2024-06"
•
"gemini-2.5-pro": "2024-06"
•
"claude-opus-4-20250514": "2024-06"
•
"claude-sonnet-4-20250514": "2024-06"
• In VISION_MODEL_REGEXES (around lines 478–495):
– Extend the array to cover the new IDs:
+
/o1/,
+
/o3-pro/,
• Review any “preferred default” or “fast-path” constants (e.g. SUMMARIZE_MODEL, GEMINI_SUMMARIZE_MODEL) to ensure they still make sense now that these new models are available.
🤖 Prompt for AI Agents