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.
Grounded Results
Tools execute against real state - files, APIs, commands return actual results.
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:
This will now be accessible at http://localhost:3000.
Configure DeepFabric to use it:
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
-
VFS Component
Virtual filesystem tools for file operations
-
MCP & Mock Tools
Import tools from MCP servers and configure mock responses
-
Custom Tools
Creating your own Spin components