DeepAgents Code CLI + Ralph/tenacity goal loop, adapted for NVIDIA DGX Spark (GB10 / Linux aarch64) and a local vLLM OpenAI-compatible server.
This is a sibling of the original ralph repo (which targets Apple Silicon
OMLX / Hy3-MLX). It keeps the same install → patch → overlay pipeline, but
defaults to:
| Setting | Default |
|---|---|
| Provider | vllm |
| Model | Qwen/Qwen3-Coder-Next-FP8 |
| Endpoint | http://127.0.0.1:8000/v1 |
| Python | 3.12 (auto-preferred) |
- Linux with Python 3.12 +
pip(system/usr/bin/python3.12is fine) ripgrep(rg) for repo search used by DeepAgents- A local vLLM server on
:8000, or a cloudOPENAI_API_KEY
On this DGX box, start the local model with:
~/Desktop/start-vllm.sh # Qwen3-Coder-Next-FP8 (coder-next)
# or
~/Desktop/serve-local-llm.sh up coder-next
# optional denser fallback:
~/Desktop/serve-local-llm.sh up qwen27cd ~/Desktop/ralphdgx
cp .env.example .env # already tuned for this host if present
./ralphdgx doctor # GPU + vLLM + install status
./ralphdgx install # creates .venv (py3.12) → download → patch → install
./ralphdgx test vllm # catalog + tiny chat completion
./ralphdgx run # launch dcode against local vLLMInstalls land in ./.venv (not system Python). Activate with
source .venv/bin/activate if you want dcode / daz-ralph on PATH.
All-in-one (install + test + run):
./setup-and-run.sh --vllm
./setup-and-run.sh --vllm --no-run # CI-style validate only./ralphdgx install
./ralphdgx run
./ralphdgx run --provider openai
./ralphdgx test vllm
./ralphdgx test openai
./ralphdgx doctor
./ralphdgx update # safe DeepAgents upgrade workflowInstalled entry points (after install):
dcode --model "openai:Qwen/Qwen3-Coder-Next-FP8" --no-mcp
daz-ralph --model "openai:Qwen/Qwen3-Coder-Next-FP8" --no-mcp.env (gitignored) holds provider settings. Important keys:
DEEPAGENTS_MODEL_PROVIDER=vllm
VLLM_BASE_URL=http://127.0.0.1:8000/v1
VLLM_MODEL=Qwen/Qwen3-Coder-Next-FP8
VLLM_API_KEY=test
VLLM_MAX_INPUT_TOKENS=131072VLLM_MODEL must match an id from:
curl -s http://127.0.0.1:8000/v1/models | python3 -m json.toolCloud OpenAI (optional):
DEEPAGENTS_MODEL_PROVIDER=openai
OPENAI_MODEL=gpt-5.5
OPENAI_API_KEY=sk-...There is no separate dcode “vllm” backend. The vllm provider is wired through
dcode’s openai provider:
model_spec→openai:${VLLM_MODEL}configure_vllm_defaultsexportsOPENAI_BASE_URL/OPENAI_API_KEYwrite_deepagents_config.pywrites~/.deepagents/config.tomlwithbase_url+use_responses_api = false(vLLM speaks chat-completions only; the Responses API would 404)run_dcodealso passes--model-params '{"use_responses_api": false}'so it outranks any built-in openai profile default. Ralph’smodel_param_filterkeeps that flag on the ChatOpenAI constructor only — it is stripped beforemodel_settingsso it never reachesAsyncCompletions.create()(which rejects it with TypeError).
pip download pinned sdists
→ extract into deepagents-main/libs/{deepagents,acp,code}
→ apply Ralph overlays (daz_ralph, dcode_tenacity, goal, runtime_install_guard)
→ pip install patched packages
→ write ~/.deepagents/config.toml
→ verify imports
sequenceDiagram
participant User
participant Shell as ralphdgx/ setup-and-run.sh
participant Install as ralph_install.sh
participant Pip as pip download/extract
participant Patch as ralph_patch
participant Overlay as ralph_overlay
participant Venv as .venv (Python 3.12)
participant Config as write_deepagents_config.py
participant DeepAgents as deepagents_code
participant Provider as vLLM/OpenAI Provider
participant LLM as LLM (Qwen3-Coder-Next-FP8)
User->>Shell: ./ralphdgx install / setup-and-run.sh
Shell->>Install: resolve provider (vllm/openai)
Install->>Pip: download pinned sdists (deepagents==0.7.0a7, etc.)
Pip->>Pip: extract to deepagents-main/libs/
Patch->>Patch: apply patches (agent, model, server, pyproject)
Overlay->>Overlay: copy overlays (daz_ralph, dcode_tenacity, goal, runtime_guard)
Patch->>Venv: pip install patched packages
Venv->>Config: write ~/.deepagents/config.toml
Config->>Config: set provider defaults (VLLM_BASE_URL, use_responses_api=false)
Config->>DeepAgents: verify imports
DeepAgents->>User: install complete
User->>Shell: ./ralphdgx run / test
Shell->>Venv: activate .venv
Venv->>DeepAgents: load config from ~/.deepagents/config.toml
DeepAgents->>Provider: resolve model_spec (openai:${MODEL})
Provider->>Provider: configure_vllm_defaults (if vllm)
Provider->>Provider: export OPENAI_BASE_URL, OPENAI_API_KEY
loop Runtime Loop
DeepAgents->>DeepAgents: GoalState + tenacity graph
DeepAgents->>Provider: chat completion request
Provider->>LLM: /v1/chat/completions (vLLM) or OpenAI API
LLM->>Provider: streaming response
Provider->>DeepAgents: tool calls, intermediate steps
DeepAgents->>DeepAgents: runtime install guard middleware
DeepAgents->>DeepAgents: subagent middleware (sync/async)
DeepAgents->>User: stream results, tools, updates
end
User->>User: interactive feedback (tool approvals, compact_conversation)
sequenceDiagram
participant User
participant Update as run-ralph-update-langgraph.sh
participant Check as git/pre-flight checks
participant Backup as backups/last-known-good
participant Ralph as daz-ralph (goal agent)
participant Prompt as docs/upgradeLangGraphDeepAgentsStackSafely.md
participant Validate as ./setup-and-run.sh --vllm --no-run
participant Pip as pip freeze
participant Git as git commit
User->>Update: ./run-ralph-update-langgraph.sh
Update->>Check: validate prompt file exists & format
Check->>Check: verify git repository
Check->>Update: load .env, configure provider
Update->>Backup: create timestamped backup dir
Backup->>Backup: copy constraints.txt, .env.example
Backup->>Backup: copy .env (redact secrets)
Backup->>Backup: copy .toml files (repo + ~/.deepagents/config.toml)
Update->>Ralph: run daz-ralph with update goal
Ralph->>Prompt: read upgrade safety rules & constraints
Prompt->>Ralph: provide goal context
loop Goal Loop (up to 50 iterations)
Ralph->>Ralph: analyze current state
Ralph->>Ralph: plan updates (sdists, patches, constraints)
Ralph->>Update: propose file changes
Update->>Ralph: confirm/adjust plan
end
Ralph->>Update: final verdict (done=true or error)
alt done=true
Update->>Validate: run validation suite
Validate->>Validate: check shell syntax, python compile
Validate->>Validate: test vllm/openai providers
Validate->>Validate: setup-and-run.sh smoke test
Validate->>Pip: pip freeze --exclude-editable
Pip->>Pip: update constraints.txt
Update->>Git: git add .
Git->>Git: check for changes
alt changes exist
Git->>Git: commit with message
end
Git->>User: update complete (commit hash logged)
else done≠true
Update->>User: exit 1, show iteration log path
User->>User: resume with daz-ralph -r <thread-id>
end
Committed sources of truth: scripts/ralph_patch/, scripts/ralph_overlay/,
and the DGX-specific shell/Python helpers. deepagents-main/ and
deepagents-sdists/ are gitignored generated trees.
If you start a different vLLM recipe (e.g. qwen27):
~/Desktop/serve-local-llm.sh up qwen27- Update
VLLM_MODELin.envto the id advertised by/v1/models ./ralphdgx install(rewrites config) or just re-export env and./ralphdgx run
- OMLX / MLX Apple Silicon path
- Hy3-MLX-Q9 / vendored mlx-lm
- Micromamba-only install (uses system/conda Python 3.12 directly)
Same as the parent project (see LICENSE).