Created
January 28, 2026 15:50
-
-
Save kinncj/952d0286aaaac696b4770e0539296fed to your computer and use it in GitHub Desktop.
CLAUDE DGX SPARK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## CLAUDE | |
| #export ANTHROPIC_BASE_URL="http://localhost:11434" | |
| #export ANTHROPIC_AUTH_TOKEN="ollama" | |
| # Launch Claude Code targeting your new Spark model | |
| #claude --model spark-coder | |
| #export ANTHROPIC_BASE_URL="http://192.168.1.229:11434" | |
| #export ANTHROPIC_AUTH_TOKEN="ollama" | |
| # Launch Claude Code targeting your new Spark model | |
| #claude --model spark-coder | |
| #OLLAMA_HOST=192.168.1.229 ollama launch | |
| #export ANTHROPIC_BASE_URL="http://192.168.1.229:11434/v1" | |
| #export ANTHROPIC_AUTH_TOKEN="ollama" | |
| #export ANTHROPIC_API_KEY="" | |
| #claude --model mac-coder | |
| # Function to run the claude-code CLI using the remote DGX (Spark) Ollama server | |
| claude_on_spark() { | |
| # 1. Include the port 11434 | |
| # 2. Add AUTH_TOKEN to trigger Claude Code's Ollama compatibility mode | |
| export ANTHROPIC_BASE_URL="http://192.168.1.229:11434" | |
| export ANTHROPIC_AUTH_TOKEN="ollama" | |
| export ANTHROPIC_API_KEY="ollama" | |
| local model_name="mac-coder" | |
| if [ -n "$1" ]; then | |
| model_name="$1" | |
| fi | |
| echo "Connecting to DGX Spark (192.168.1.229:11434) using model: $model_name" | |
| # Run with localized environment variables | |
| command env \ | |
| ANTHROPIC_BASE_URL="$ANTHROPIC_BASE_URL" \ | |
| ANTHROPIC_AUTH_TOKEN="$ANTHROPIC_AUTH_TOKEN" \ | |
| ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \ | |
| claude --model "$model_name" | |
| } | |
| opencode_on_spark() { | |
| echo "Launching OpenCode pointing to Spark DGX (192.168.1.229)..." | |
| # We use 'env' to ensure these variables ONLY exist for this specific command execution | |
| env \ | |
| OPENAI_BASE_URL="http://192.168.1.229" \ | |
| OPENAI_API_KEY="ollama" \ | |
| opencode --model "mac-coder" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment