r/Python • • 20d ago

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

28 Upvotes

152 comments sorted by

View all comments

1

u/Business_Rain_1042 7d ago

Weave: a Python package where the agent writes one script instead of a loop of tool calls

What My Project Does

Weave is a Python package (PyPI: weave-lang) with a Rust runtime. You wrap your tools once, and the model gets a single run_weave tool. It writes a short script in a small Python subset (loops, branches, helpers). The runtime runs independent reads in parallel, orders writes by declared effects, and gives the model back only what the script printed.

It works with Chat Completions, the OpenAI Agents SDK, LangChain/LangGraph, and MCP clients. Install is pip install weave-lang (import weave). Python 3.9 to 3.13, Linux, macOS, and Windows. I'm the author.

Target Audience

People building tool-using agents who do a lot of fan-out or chained lookups (audit many packages, scan several repos, filter results before they hit the context). Not aimed at one-shot tool calls or chat flows where every step waits for a person. Usable in real projects, but still early.

Comparison

Native function calling sends each tool round as its own model call and stuffs every raw result back into context. LangChain and the OpenAI Agents SDK still sit on that loop; Weave plugs into both as one tool, so the model can batch the work inside a script instead.

Against native function calling, same model and tools, pre-registered:

  • Fan-out on real services: 40/40 vs 27/40, about half the cost (0.45 to 0.50x).
  • BFCL v4 multi-turn, fresh tasks, write gate: 159/378 vs 140/378 at 0.91x cost, p = 0.07, not significant.
  • GPT-5.4 mini lost an earlier BFCL round, 18/60 vs 27/60.
  • tau-bench retail: a draw.

Source: https://github.com/AtharvRaotole/weave