Skip to content

armgit / Soup

Public Imported from GitHub
0

Fine-tune LLMs from one YAML. Layer streaming trains an 8B model on a 4 GB laptop GPU.

1.6 KB
Raw Blame
  • soup_cli.mcp_server.registry.call_tool runs a registry tool without an MCP server (#1761 by @Faisal-Fayaz in #1770). The three guarantees a tool call gets — stray stdout diverted to stderr for the duration of the handler so it cannot corrupt a caller's channel, the result passed through C0/ESC/DEL sanitization, and every failure from the lookup or the handler mapped to a message carrying neither a path nor a traceback — lived in mcp_server/server.py::_dispatch_tool, which is private. A caller running the registry tools directly had to reimplement all three and import the private _sanitize, whose name could change without notice. call_tool(name, arguments, *, allow_mutating=False) is the helper the MCP server calls, so the two cannot drift apart; it is not promised as a stable in-process API. It returns the Python value rather than pretty-printed JSON, so a caller does not re-parse what it just called; serialization stays with the transport. _sanitize is public as sanitize, following #896, and the old private name remains as an alias so a downstream import is not broken. allow_mutating is a second gate for callers rather than a duplicate of the one build_registry applies: a table built permissively still needs the flag per call, so it cannot run a mutating tool by accident. A name that is not hashable raises TypeError rather than McpToolError: that is a caller bug, not a tool failure. The stdout guard is process-wide, so a threaded caller's other threads have their prints diverted for the duration of a call. No behaviour changes for soup mcp serve.