Repository navigation
cowork-to-code-bridge — async bridge letting DSPy modules delegate work to Claude Code on your local machine #9934
Replies: 2 comments
|
Thanks for reading. Honest answer to your question: none of those four, because the bridge deliberately isn't a multi-provider router. It shells out to one runtime — the Claude Code CLI on the user's own machine — so there's no provider matrix to reconcile. Streaming, tool calls, and structured output are the CLI's problem, not the bridge's. The friction that actually cost me implementation time is a layer below provider differences, and I think it generalizes to any DSPy module that delegates to a long-running external runtime:
On usage reporting specifically — since the run happens under the user's own CLI auth on their own hardware, cost accounting lives with them rather than in the bridge, which sidesteps the reconciliation problem but also means the bridge can't offer a unified usage view. That's a real tradeoff, not a free win. Repo if useful: https://github.com/abhinaykrupa/cowork-to-code-bridge |
Uh oh!
There was an error while loading. Please reload this page.
Show and Tell: cowork-to-code-bridge — let DSPy modules delegate to Claude Code on your local machine
Hey DSPy community,
I've been building agents with DSPy and kept hitting the same wall: the agent runs in a cloud sandbox (or CI), but the interesting work — running evals, generating embeddings, calling local tools — needs to happen on my actual machine. I ended up building cowork-to-code-bridge: an async, file-based RPC bridge that lets a sandboxed agent queue work for Claude Code running locally, with no open ports and no auth tokens flying around.
How it fits into a DSPy program
You can drop this module into any DSPy
ChainOfThoughtorReActprogram and the optimizer never has to care that the eval ran on a different machine.What the bridge handles
queue_task/poll_task_resultWhy it's useful for DSPy specifically
DSPy's teleprompters and optimizers can run for a long time. The bridge lets you keep the optimization loop in the sandbox while expensive side-effects (file I/O, subprocess evals, GPU jobs) stay on the local machine — and the budget cap means a runaway optimizer can't silently rack up costs.
Repo: https://github.com/abhinaykrupa/cowork-to-code-bridge
Question for the community: Are you running DSPy optimizers in cloud sandboxes today? What's your current strategy for connecting them to local evals or tools — and would an async bridge like this fit into your workflow?
All reactions