-
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?
Conversation
WalkthroughThis update revises the supported AI model lists for OpenAI, Google Gemini, and Anthropic in the constants file, adds a deployment automation shell script, and expands the README with instructions for local Docker-based deployment using the new script. No application logic or interface changes are introduced. Changes
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. π§ ESLint
app/constant.tsOops! Something went wrong! :( ESLint: 8.49.0 TypeError: Cannot read properties of undefined (reading 'loc') β¨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 3
π§Ή Nitpick comments (2)
scripts/deploy-local-build.sh (1)
37-41
: Hard-coded secrets and missing.env
sourcingStoring
OPENAI_API_KEY=sk-xxxx
directly in VCS is unsafe and pushes users towards bad practice. Read from a local.env
or command-line arg:- -e OPENAI_API_KEY=sk-xxxx \ - -e CODE=your-password \ + --env-file /etc/nextchat/nextchat.env \Document the
.env
format in README.README.md (1)
446-449
: Minor wording fix for the new subsectionβrunning using Dockerβ β βrun using Dockerβ
-### Build locally and push to the remote server and running using Docker +### Build locally, push to the remote server, and run using Docker
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (3)
README.md
(1 hunks)app/constant.ts
(3 hunks)scripts/deploy-local-build.sh
(1 hunks)
π§° Additional context used
πͺ Shellcheck (0.10.0)
scripts/deploy-local-build.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
[warning] 28-28: Quote 'EOF' to make here document expansions happen on the server side rather than on the client.
(SC2087)
"o1", | ||
"o1-pro", | ||
"o3-mini", | ||
"o3", | ||
"o3-pro", | ||
"o4-mini", | ||
]; |
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.
+ "o1": "2023-10",
+ "o1-pro": "2023-10",
+ "o3-pro": "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",
and extend the VISION_MODEL_REGEXES
:
/o3/,
+ /o1/,
+ /o3-pro/,
Also cull the stale o1-mini*
/ o1-preview*
constants to avoid dead-code drift.
Also applies to: 557-559, 571-573
#!/bin/bash
# Check KnowledgeCutOffDate entries
rg -n "KnowledgeCutOffDate" -C5 app/constant.ts
# Check vision model regexes
rg -n "VISION_MODEL_REGEXES" -C5 app/constant.ts
# Check summarize model defaults/fallbacks
rg -n "SUMMARIZE_MODEL" -C5 app/constant.ts
π Script executed:
# Search for KnowledgeCutOffDate entries
rg -n "KnowledgeCutOffDate" -C5 app/constant.ts
# Search for VISION_MODEL_REGEXES definitions
rg -n "VISION_MODEL_REGEXES" -C5 app/constant.ts
# Search for SUMMARIZE_MODEL defaults or fallbacks
rg -n "SUMMARIZE_MODEL" -C5 app/constant.ts
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
In app/constant.ts around lines 427 to 462, add the missing KnowledgeCutOffDate
entries for the new model IDs with their respective cutoff dates as specified.
Then, around lines 478 to 495, extend the VISION_MODEL_REGEXES array to include
regex patterns for the new model IDs like /o1/ and /o3-pro/. Finally, review and
update any preferred default or fast-path constants such as SUMMARIZE_MODEL and
GEMINI_SUMMARIZE_MODEL to ensure they remain appropriate given the addition of
these new models.
# 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" | ||
|
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.
Add a proper shebang and quote configurable values
Without #!/usr/bin/env bash
the scriptβs target shell is unknown (SC2148) and may be executed by /bin/sh
, breaking [[ β¦ ]]
or arrays if later added.
Unquoted variables (${SERVER_USER}
, ${SERVER_IP}
, ${IMAGE_NAME}
β¦) invite word-splitting when they contain spaces or wildcard characters.
-# 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"
Committable suggestion skipped: line range outside the PR's diff.
π§° 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
In scripts/deploy-local-build.sh at lines 1 to 7, add the shebang line
#!/usr/bin/env bash at the very top to specify the script interpreter
explicitly. Also, enclose all variable assignments for SERVER_USER, SERVER_IP,
IMAGE_NAME, TAG, and TAR_FILE in double quotes to prevent word splitting and
globbing issues when these variables are used later in the script.
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} |
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.
π οΈ Refactor suggestion
Here-document expands on the local machine, not the server
Because the EOF
delimiter is not quoted, every $VAR
inside the block is interpolated before the SSH command is sent.
$SERVER_IP
(used in the final printf) therefore becomes an empty string on the server side. If you intend expansion remotely, quote the delimiter (<<'EOF'
). If you intend local expansion, remove $SERVER_IP
from the remote echo
.
-ssh ${SERVER_USER}@${SERVER_IP} << EOF
+ssh "${SERVER_USER}@${SERVER_IP}" <<'EOF'
π Committable suggestion
βΌοΈ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
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} | |
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} |
π§° 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
In scripts/deploy-local-build.sh around lines 28 to 41, the here-document used
with ssh is unquoted, causing all variables inside it to be expanded locally
instead of on the remote server. To fix this, quote the EOF delimiter as <<'EOF'
to prevent local expansion and ensure variables like $SERVER_IP are expanded on
the server side. Alternatively, if local expansion is intended, remove
$SERVER_IP from the remote commands inside the here-document.
π» εζ΄η±»ε | Change Type
π εζ΄θ―΄ζ | Description of Change
This pull request introduces several enhancements to improve the AI model support and deployment workflow:
Model Updates:
New Deployment Script:
These changes enhance both the AI capabilities of the application and the developer experience for deployment.
π θ‘₯ε δΏ‘ζ― | Additional Information
Model List Updates:
Deployment Script Features:
This update significantly improves the application's AI model coverage and makes the deployment process more accessible to developers working in different environments who prefer to deploy using Docker, but somehow, the image on Docker Hub is out of date.
Summary by CodeRabbit
New Features
Documentation