Skip to content

Tools

DeepFabric uses Spin, a WebAssembly framework, to execute tools during dataset generation. Tools run in isolated sandboxes, producing authentic training data based on real execution results.

Why Real Execution Matters

Traditional synthetic data generators simulate tool outputs, which creates unrealistic training data. With Spin, tools execute against real state:

Hallucinated Results

The model invents tool outputs - file contents, API responses, command results - with no grounding in reality.

Traditional Approach
Agent: read_file("config.json")
Result: {"setting": "value"}  # Made up

Agent: api_call("GET /users/123")
Result: {"name": "John", "id": 123}  # Fabricated

Agent: run_command("git status")
Result: "nothing to commit"  # Assumed

Grounded Results

Tools execute against real state - files, APIs, commands return actual results.

DeepFabric + Spin
Agent: read_file("config.json")
Result: FileNotFound  # Actually doesn't exist

Agent: write_file("config.json", '{"debug": true}')
Result: Written 16 bytes  # Real operation

Agent: read_file("config.json")
Result: {"debug": true}  # Actual content

Architecture

graph TB
    A[DeepFabric] --> B[Spin Service]
    B --> C[VFS<br/>Component]
    B --> D[Mock<br/>Component]
    B --> E[Custom<br/>Components]

Components are WebAssembly modules that handle specific tool categories:

Component Purpose Tools
VFS Virtual filesystem read_file, write_file, list_files, delete_file
Mock Dynamic mock execution Any tool loaded via MCP
Custom Your own components Any tools you build (see Custom Tools)

Quick Start

Install Spin

We provide a prepacked Docker image:

docker run -d -p 3000:3000 ghcr.io/always-further/deepfabric/tools-sdk:latest

This will now be accessible at http://localhost:3000.

brew install fermyon/tap/spin
curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash
sudo mv spin /usr/local/bin/

From the tools-sdk/ directory:

spin build
spin up

The service runs at http://localhost:3000.

Configure DeepFabric to use it:

config.yaml
generation:
  tools:
    spin_endpoint: "http://localhost:3000"
    components:
      builtin:  # VFS tools -> /vfs/execute
        - read_file
        - write_file
        - list_files

Each component routes to its own endpoint (/{component}/execute).

Session Isolation

Each dataset sample gets an isolated session. Files created during one sample don't affect others:

# Session A: Creates config.json
# Session B: config.json doesn't exist

# After sample generation, session is cleaned up

Automatic Cleanup

DeepFabric automatically creates and cleans up sessions for each sample, ensuring isolation between training examples.

Next Steps

  • Spin Setup


    Installation and running the tool service

    Setup guide

  • VFS Component


    Virtual filesystem tools for file operations

    Learn more

  • MCP & Mock Tools


    Import tools from MCP servers and configure mock responses

    Configure mocks

  • Custom Tools


    Creating your own Spin components

    Build tools