Skip to main content

SmolFS Python SDK

SmolFS gives Python agents a workspace folder that can survive after the agent process stops. You can create a volume, mount it like a normal directory, write files into it, flush important changes, unmount it, and mount the same files again later.

The Python package is a native SDK over the same Rust core as the smolfs command. It is useful when an agent runner or automation service wants to manage workspace volumes without shelling out for every operation.

Install

Install the Python SDK with uv:

uv add smolfs

Mounting volumes also needs SmolFS' managed storage backend on the machine. The installer sets up both the CLI and backend:

curl -fsSL https://raw.githubusercontent.com/CelestoAI/smolfs/main/scripts/install.sh | SMOLFS_INSTALL_PYTHON=1 sh

If you only need the Python package inside an existing project or virtual environment, uv add smolfs is enough.

Quickstart

Start with a local development volume:

from pathlib import Path

from smolfs import SmolFS, doctor

report = doctor()
if not report["storage_backend"]["found"] or not report["mount_support"]["found"]:
    raise RuntimeError(f"SmolFS is not ready: {report}")

fs = SmolFS.from_env()
volume = fs.ensure_volume("demo", dev=True)
mount = fs.mount(volume.name, "./workspace")

workspace = Path(mount.mountpoint)
(workspace / "hello.txt").write_text("hello from SmolFS\n")

try:
    fs.flush(volume.name)
finally:
    fs.unmount(volume.name)

dev=True creates a local-only volume. It is the easiest way to test SmolFS on a single machine before connecting shared metadata and object storage.

Cloud Volumes

Cloud volumes use the same API with explicit metadata and object storage settings:

from smolfs import SmolFS

fs = SmolFS.from_env()
fs.ensure_volume(
    "agent-workspace",
    metadata="redis://localhost:6379/1",
    storage="s3",
    bucket="https://my-bucket.s3.us-east-2.amazonaws.com",
)

Keep storage credentials in the environment used by SmolFS. Do not print them in logs or store them in source files.

API Overview

  • doctor() checks whether the machine can create and mount volumes.
  • SmolFS.from_env() creates a client using SMOLFS_HOME and the current environment.
  • ensure_volume(...) creates a volume if it does not exist and returns the existing volume if it does.
  • init(...) creates a new volume.
  • mount(name, path) mounts a volume at a local directory.
  • flush(name) asks SmolFS to sync important writes.
  • unmount(name) unmounts a mounted volume.
  • status(name=None) lists known volumes and mountpoints.

Links

Metadata

Release files for smolfs 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smolfs 0.1.1
File Size Uploaded
smolfs-0.1.1.tar.gz 20.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for smolfs 0.1.1
File Interpreter ABI Platform
smolfs-0.1.1-cp39-abi3-manylinux_2_39_x86_64.whl CPython 3.9 abi3 Linux glibc 2.39+ x86-64 Details
smolfs-0.1.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details

Total release size: 1.0 MB

Release files / smolfs-0.1.1.tar.gz

Download URL smolfs-0.1.1.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3fec2b5b352095d73ec0da95c9396d3a0d5fd93d53773612d722dce16c1acdef
BLAKE2b-256 checksum
How to use checksums
c5aa990c164f0e17158183426301f4e7651cfb0c5f58ff36c47d533f831fbf92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release files / smolfs-0.1.1-cp39-abi3-manylinux_2_39_x86_64.whl

Download URL smolfs-0.1.1-cp39-abi3-manylinux_2_39_x86_64.whl
Size 522.6 kB
Tags CPython 3.9 Linux glibc 2.39+ x86-64 abi3
SHA-256 checksum
How to use checksums
f8ef322daa6c663251a5569c45ff338842b1ec7c023d041736c6cf82f4108fcd
BLAKE2b-256 checksum
How to use checksums
1c4445d0be85f0651b1c0f1116c61d3ed85219f5ca42c7a4b21696cbf543900a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release files / smolfs-0.1.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL smolfs-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Size 471.5 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7122e2c7d3354bdaf33b27c82394ff5ba05fdd63ff4f9f9ccda21cbf80c2ac99
BLAKE2b-256 checksum
How to use checksums
356968fa6268a72ccd3d8bea71b2ebf2a31ce0a51e56ea7fd4d8c2fe4d831a4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

3 release files

0.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page