title: Forge
emoji: π οΈ
colorFrom: yellow
colorTo: gray
sdk: docker
app_port: 7860
pinned: false
Forge
A self-improving assistant you talk to like a person. Ask it to do something; if it doesn't already have the tool for the job, it writes one and puts it in front of you for approval before it ever runs. If an approved tool breaks, it patches itself and sends the patch back for approval too.
How it works
- Chat β plain conversation, backed by your Inference Port API.
- Tools β small JavaScript functions (
async function run(args) { ... }) that Forge writes on demand and calls like normal functions once approved. - Approval gate β nothing Forge writes runs until you hit Approve on its ticket card. Decline it and Forge is told why (if you give a reason) so it can try something else.
- Self-healing β if a tool throws, Forge automatically drafts a fix and files it as a new ticket. The broken tool keeps its old code until the fix is approved.
- Sandboxing β tool code runs in a restricted
vmcontext with a timeout, not a fully hardened sandbox. The approval step is the real safety boundary β read the code before approving it, same as you would review a PR.
Setup
Set Space secrets/variables (Settings β Variables and secrets):
INFERENCE_API_URLβ the chat completions endpoint for your Inference Port API. Double-check this is current before deploying; see.env.examplefor the last known value.INFERENCE_API_KEYβ your key, as a secret, not a variable.INFERENCE_MODELβ defaults tollama-3.3-70b-versatileif unset.AGENT_NAMEβ optional, defaults toForge.USE_PERSISTENT_STORAGEβ set totrueto store tools at/data/forge-tools(requires persistent storage enabled in Space settings).
Persistence. Tools are written to
/data/forge-toolsif theUSE_PERSISTENT_STORAGEenv var is set totrueand the Space has persistent storage enabled, otherwise they fall back to a local folder that's wiped on every rebuild. Turn on persistent storage in Space settings and setUSE_PERSISTENT_STORAGE=trueif you want tools to survive restarts.Push this repo to your Space. The
Dockerfilebuilds and runs it on port 7860.
Local dev
npm install
cp .env.example .env # fill in your values
npm start
Then open http://localhost:7860.