Using AI development tools outside the Argonne trusted network

There are now a huge number of AI-enabled code development tools. If you are tired of copying and pasting between an LLM in a browser and your editor, you should try AI-enabled code development tools.

An overview of AI development tools I wrote for E3SM is here

These tools need to be hooked up to an LLM. This usually involves buying a subscription but you can instead hook them up to Argonne's Argo service.

CELS general instructions for this are on this box document: https://anl.app.box.com/notes/1871610644419?s=hxc72dkm0a8mlmo7ownfl4ixwx6iu3ko. (This was originally part of a Vibe Coding workshop held at Argonne: https://anl.app.box.com/folder/316633295027?s=iva9qhm478a29pt3lt4yy53ubhdrs239.).

This page focuses on using AI-dev tools with Argo but outside the Argonne trusted network.

Connecting your AI tool to Argo

These instructions are for connecting AI development tools to Argo when outside of the Argonne trusted internal network using the argo-proxy developed by Peng Ding. They work for your laptop on your home network but also for machines on lcrc.anl.gov or alcf.anl.gov networks or really anywhere that can establish an ssh connection with Argonne.

If you are on the Argonne network (via VPN or being on campus) use the CELS instructions above.

To connect Argo to your tool from elsewhere, these instructions focus on 2 elements: The argo-proxy service running on a CELS or other machine AND an ssh tunnel from your external machine to that proxy instance.

These instructions assume the machine running the proxy is homes.cels.anl.gov. This works for any machine from which you can establish an ssh connection to homes.cels.anl.gov.

One-time setup of argo-proxy

  1. ssh to homes.cels.anl.gov
  2. Create a python virtual environment: python -m venv argoenv
  3. activate the environment: source argoenv/bin/activate
  4. Install argo-proxy > pip install argo-proxy
  5. start the proxy to configure it: > argo-proxy config init
    1. There will be some setup questions. Answer "Y" to all. When it asks for your username, use your Argonne user id.
    2. Note the port number it uses. It will be the same every time. We'll assume its 12345 in these instructions.
    3. Chose the "prod" environment unless you know for sure you want dev or test.
    4. Let it write its configure file.
  6. quit the proxy with "control-c"
  7. deactivate the virtual environment: > deactivate
  8. Done with one-time setup!

Routine use

start the proxy

  1. ssh to homes.cels.anl.gov. Note if you are on homes-01 or homes-02.
  2. Start a "screen" (or tmux) session: > screen
  3. activate the environment: > source argoenv/bin/activate
  4. start the proxy > argo-proxy serve
  5. leave the screen: "ctl-a-d" which leaves the screen and the proxy running.
  6. You can now log out if you want.

The proxy will keep running in your screen session after you log out. It will not need to be restarted unless homes gets rebooted. You can check how it is doing by logging back in to homes-01 (if that's where you started it) and doing "screen -r". Do "ctl-a-d" to put the screen in the background again. To actually stop the screen session, do "ctl-c" to stop the proxy, then type "exit".

Start the tunnel

From your laptop on your home network or other machine you want run AI tools and connect them to Argo:

  1. Start an ssh tunnel for the port used by argo-proxy and the specific homes login host you started it on
    1. (we assume the machine is homes-01 and the port is 12345) > ssh -4 -N -f -L 12345:localhost:12345 -J [email protected] [email protected]
  2. NOTE: This is an ssh connection FROM the machine outside the Argonne network TO homes.gce. You may need to create an ssh key on the remote machine and install it on accounts.cels.anl.gov for this to work. (You've already done that with your Argonne laptop but you may need to do it for improv TO homes or aurora TO homes) Test that you can ssh with a command like: ssh -J [email protected] [email protected] ls
  3. NOTE: The "-f" argument in the tunnel creation command will send the ssh tunnel to the background after you authenticate.

Tell the AI tool about the tunnel

  1. Find the settings for your AI tool where you can specify the model provider. Look for an option like "OpenAI Compatible"
    1. For "base Url", use http://localhost:12345/v1/. If you are using the Argonne network use https://apps-dev.inside.anl.gov/argoapi/v1
    2. If it asks for an OpenAI Compatible API key, enter your Argonne username
    3. Specify model. See list at This box list. Try "argo:gpt52"
  2. You should now be able to use the specified model with your AI tool.

Optional: update the proxy

Tools like claude code update frequently and sometimes break the protocol for talking to LLMs. You may then need to update argo-proxy to compensate.
  1. Log on to where you started the proxy.
  2. Attach to the screen it was running in: screen -r
  3. Stop the proxy with ctl-C
  4. Update it: > argo-proxy update install
  5. start it again: > argo-proxy serve
  6. Detach from the screen: Ctl-a-d
  7. done!

Notes

Testing the tunnel

To test that your tunnel is connected to the proxy: after you have started the tunnel, in another terminal on the same machine, do

> curl http://localhost:12345/v1/models

The result will be a long string listing all the models available.

ssh within VScode

If you use VScode to ssh to another machine to do development, start the tunnel from that machine, not your laptop. This is needed because VScode sets up a small server on the machine you ssh to and runs commands through that.

IDE-based AIdev tools

Examples of how to connect IDE tools and extensions to Argo.

Cline - extension to VSCode

VScode by default comes with Copilot which has access to several LLMs but you need to buy a Copilot seat to use it. To use Argo with VScode, you need to add an AI extension that allows any AI provider such as Cline.

This is what the settings look like for Argo with Cline in VScode:

Zed

CLI-based AIdev tools

Using Argo with CLI based tools usually involves editing a settings file.

Claude Code CLI

  1. Install Claude Code cli on the remote machine you want to do development on: curl -fsSL https://claude.ai/install.sh | bash
  2. set up the ssh tunnel from your remote machine to the proxy. (using screen or another terminal session)
  3. Create or edit ~/.claude/settings.json as follows
    {
    "apiKeyHelper": "echo 'UserName'",
      "env": {
        "ANTHROPIC_BASE_URL": "http://localhost:12345",
        "CLAUDE_CODE_SKIP_ANTHROPIC_AUTH": "1"
        "ANTHROPIC_MODEL": "claudesonnet46",
        "ANTHROPIC_DEFAULT_OPUS_MODEL": "claudeopus47",
        "ANTHROPIC_DEFAULT_SONNET_MODEL": "claudesonnet46",
        "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claudehaiku45",
        "DISABLE_AUTOUPDATER": "1",
        "USE_BUILTIN_RIPGREP": "0"
      },
      "model" : "opusplan"
    }
    
    Replace UserName with your Argonne user name. The ANTHROPIC_BASE_URL is supposed to end with the port number for Claude Code CLI app only. Also replace 12345 with your port number.
  4. cd to the git repo with your code and start claude.

NOTES:

  1. To change the model's available, you'll have to edit the settings.json file.
  2. Claude has an aggresive update cycle and will auto-updated every time you start it. DISABLE_AUTOUPDATER: "1" will turn that off.

Opencode CLI

  1. Install OpenCode on remote machine: curl -fsSL https://opencode.ai/install | bash
  2. set up your ssh tunnel from the remote machine.
  3. create or edit ~/.config/opencode/config.json as follows:
    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "Argo": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "Argo",
          "options": {
            "baseURL": "http://0.0.0.0:12345/v1",
            "apiKey": "UserName"
          },
          "models": {
            "claudesonnet45": {
              "name": "Claude-4.5-Sonnet"
            },
            "claudeopus45": {
              "name": "Claude-4.5-Opus"
            },
            "claudehaiku45": {
              "name": "Claude-4.5-Haiku"
            },
            "gpt51": {
              "name": "GPT-5.1"
            },
            "gpt52": {
              "name": "GPT-5.2"
            },
            "gemini25pro": {
              "name": "Gemini-2.5-Pro"
            }
          }
        }
      }
    }
    
    Replace UserName with your Argonne user name and port number (12345) with your port number.
  4. cd to the git repo with your code and start opencode
  5. You can change the model used to one of those included in the above config using /model