Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Diviner0
Copy link

@Diviner0 Diviner0 commented Jul 5, 2025

πŸ’» ε˜ζ›΄η±»εž‹ | Change Type

  • feat
  • fix
  • refactor
  • perf
  • style
  • test
  • docs
  • ci
  • chore
  • build

πŸ”€ ε˜ζ›΄θ―΄ζ˜Ž | Description of Change

This pull request introduces several enhancements to improve the AI model support and deployment workflow:

Model Updates:

  • Updated model lists for OpenAI, Gemini, and Claude to include the latest available models and remove deprecated models
  • Ensures compatibility with the newest AI model versions and features

New Deployment Script:

  • Added a new deployment script that enables local building and remote deployment
  • Allows users to build the application locally on their machine
  • Provides seamless push and deployment to remote servers using Docker
  • Streamlines the development-to-production workflow

These changes enhance both the AI capabilities of the application and the developer experience for deployment.

πŸ“ θ‘₯充俑息 | Additional Information

Model List Updates:

  • OpenAI: Added the o1, o1-pro, and o3-pro models; removed the o1-mini and o1-preview models.
  • Gemini: Added the gemini-2.5-flash and gemini-2.5-pro models; removed the gemini-2.5-pro-preview-06-05 model.
  • Claude: Added the claude-opus-4-20250514 and claude-sonnet-4-20250514 models; removed the claude-instant-1.2, claude-2.0, claude-2.1, claude-3-sonnet-20240229, and claude-3-opus-20240229 models.

Deployment Script Features:

  • Cross-platform compatibility (Windows, macOS, Linux)
  • Docker-based deployment for consistent environments

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

    • Added support for new and updated AI models from OpenAI, Google Gemini, and Anthropic, while removing deprecated or preview models.
    • Introduced a deployment script to automate building, transferring, and running the application with Docker on a remote server.
  • Documentation

    • Updated deployment instructions in the README to include guidance on using the new deployment script.

Copy link
Contributor

coderabbitai bot commented Jul 5, 2025

Walkthrough

This 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

File(s) Change Summary
app/constant.ts Updated arrays for supported OpenAI, Google Gemini, and Anthropic model identifiers: removed deprecated, added new.
scripts/deploy-local-build.sh Added a new shell script to automate Docker image build, transfer, and deployment to a remote server.
README.md Added deployment instructions referencing the new deployment script and environment variable guidance.

Possibly related PRs

Suggested reviewers

  • Dogtiti

Poem

In the warren, code hops anew,
Models refreshed, the old bid adieu.
With scripts to deploy and docs to explain,
The server's alive, no need to complain!
From burrow to cloud, the journey is swiftβ€”
πŸ‡ NextChat leaps with a Docker gift!

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

app/constant.ts

Oops! Something went wrong! :(

ESLint: 8.49.0

TypeError: Cannot read properties of undefined (reading 'loc')
Occurred while linting /app/constant.ts:1
Rule: "unused-imports/no-unused-imports"
at normalizeReportLoc (/node_modules/eslint-rule-composer/lib/rule-composer.js:47:26)
at normalizeReport (/node_modules/eslint-rule-composer/lib/rule-composer.js:107:12)
at Object.value [as report] (/node_modules/eslint-rule-composer/lib/rule-composer.js:143:72)
at Program:exit (/node_modules/eslint/lib/rules/no-unused-vars.js:694:33)
at ruleErrorHandler (/node_modules/eslint/lib/linter/linter.js:1051:28)
at /node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach ()
at Object.emit (/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors (/node_modules/eslint/lib/linter/node-event-generator.js:326:22)

✨ Finishing Touches
  • πŸ“ Generate Docstrings

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.

❀️ Share
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 sourcing

Storing 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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 814fd27 and 175f048.

πŸ“’ 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)

Comment on lines +530 to 536
"o1",
"o1-pro",
"o3-mini",
"o3",
"o3-pro",
"o4-mini",
];
Copy link
Contributor

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

  1. o1, o1-pro, o3-pro, gemini-2.5-flash, gemini-2.5-pro, claude-opus-4-20250514, and claude-sonnet-4-20250514 are now surfaced to the UI but:
    β€’ KnowledgeCutOffDate lacks entries for all of these newcomers, while it still contains the now-removed o1-mini* and o1-preview*.
    β€’ VISION_MODEL_REGEXES does not cover o1*/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.

  2. 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.

Comment on lines +1 to +7
# 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"

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

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.

Comment on lines +28 to +41
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}
Copy link
Contributor

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.

Suggested change
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.

@Diviner0 Diviner0 changed the title Diviners dev Update Model list and introduce a new deployment scirpt Jul 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant