SCRP-Assistant is an AI assistant on the SCRP Cluster, with the ability to:

  • Code
  • Run analysis
  • Read articles and webpages
  • Write reports
  • Understanding and generating images
  • Implement version control

At the core of SCRP-Assistant is a command line interface (CLI), which serves as the frontend of the Assistant, and a connection to SCRP-Chat, which serves the large language model (LLM) that powers the Assistant.

Launching the Assistant

Jupyter

In Jupyter’s file explorer, right click on any folder to show the context menu and select AI Assistant. This will launch the Assistant with the selected folder as the working directory. The AI will be confined within this directory for most operations, with important exceptions.

To launch the Assistant in the current directory, simply right click on any empty space in the file explorer.

Jupyter SCRP-Assistant

Terminal

Use the scrp-assistant command to launch the Assistant in a terminal.

Changing Assistant Settings

Use the assistant-setup command in a terminal to change the Assistant’s settings. Remember to approve overwriting existing CLI configuration files at the end, otherwise the changes you make will not be saved.

The following settings are available:

CLI

SCRP-Assistant can support the following CLI:

  • Qwen Code (default)
  • Codex CLI
  • Claude Code
  • Gemini CLI

Of the four CLI, only Qwen Code is fully integrated with SCRP, allowing it to fully utilize the cluster. For the other CLI, we recommend including an AGENT.md file in the working directory based on our template, which has detailed instructions on how to utilize the cluster.

LLM Endpoint

  • API key: The Assistant will first check if there is an existing API key. If not, it can extract your SCRP-Chat API key on your behalf, or you can manually specify a key.
  • Base URL: Defaults to https://scrp-chat.econ.cuhk.edu.hk.
  • Model name: Defaults to scrp-assistant, which is currently backed by zai.org/GLM-4.7-FP8.
Qwen Code Settings

If you have chosen Qwen Code as the Assistant’s CLI, you will be asked to choose from the following approval modes. The approval mode controls how Qwen asks for permission before executing actions.

Modes other than yolo will frequently request confirmation before taking actions. Note that because SCRP is completely separate from your personal computer, data on your own computer will never be altered by the assistant, even in this mode.

You can always switch mode within Qwen Code by pressing Shift-Tab.

  • yolo - Full automation (default)
    • Choose this mode if you want to fully automate your workflow.
    • The assistant will edit files and execute commands without asking for confirmation.
  • auto-edit - Automate file editing and non-destructive actions
    • Actions that do not require user confirmation: Reading and modifying files, web access, image generation and git operations
    • Actions that require user confirmation: Running programs
    • Best if you prefer instructing the assistant to code, before switching to the yolo mode for code execution.
  • Qwen default - Automate non-destructive actions only
    • Actions that do not require user confirmation: Reading files, web access, image generation and git operations
    • Actions that require user confirmation: File modification and running programs
    • Best if you prefer discussing the plan of action with the assistant, before giving manual approval for code modification and execution.
  • plan - Plan only mode
    • Creates execution plans without running them.
    • Requires switching to another mode in the CLI to run any command.

Interacting with the Assistant

You can interact with the Assistant with natural language through the CLI.

Jupyter SCRP-Assistant CLI

Security

CLIs typically confine its AI agent to the working directory you start the CLI in. This does not mean, however, that the Assistant cannot modify files outside of the working directory, because the confinement does not extend to programs launched by the CLI. It is possible for the agent to modify your files through:

  • Executable scripts
  • Programs such as R, Stata or MATLAB.
  • Slurm jobs

While it is unlikely for the Assistant to write code that escape confinement on its own, it could be guided to do so through prompt injection.

For users who need extra security, we offer separate assistant accounts that are completely isolated from the primary user account. Please contact support for details.