Skip to main content

truffile the TruffleOS SDK - Connect and deploy apps to Truffle devices

Project description

🍄‍🟫 Truffile

Python SDK/CLI for Truffle devices.

What It Does

  • discovers and connects to your Truffle (scan, connect, disconnect)
  • validates and deploys apps from truffile.yaml (validate, deploy)
  • manages installed apps (list apps, delete)
  • talks to inference directly (models, chat)
  • exposes an OpenAI-compatible local proxy (proxy)

Start making your Own Apps

  • app schema and validation: truffile/truffile/schema/app_config.py
  • schedule parsing: truffile/truffile/schedule.py
  • deploy planning + builder flow: truffile/truffile/deploy/builder.py
  • generated TruffleOS protos vendored in: truffile/truffle/
  • examples:
    • truffile/example-apps/kalshi
    • truffile/example-apps/reddit

truffile.yaml defines:

  • metadata (name, description, type)
  • process (cmd, working_directory, environment)
  • files to upload
  • optional run/build commands
  • background schedule policy (for BG apps)

App Types and Runtime Model

Apps can be:

  • foreground (fg): exposes MCP tools that tasks/agents can call during active execution
  • background (bg): runs on schedule and emits context for proactivity, enabling the device to trigger actions and write/update memory
  • both (fg + bg): one app package can provide MCP tools and scheduled context emission

How to think about it:

  • FG path is tool-serving: app process is used as a callable capability surface (MCP)
  • BG path is context/proactivity: scheduled runs feed the proactive agent with fresh signals
  • Proactivity can take actions and persist memory based on BG outputs

In practice:

  • use fg when you need direct tool invocation from tasks
  • use bg when you need periodic monitoring, summaries, or event-driven context
  • use both when the same app should both expose tools and continuously feed proactivity/memory

Core Commands

truffile scan
truffile connect <device>
truffile validate [app_dir]
truffile deploy [app_dir]
truffile deploy --dry-run [app_dir]
truffile list apps
truffile delete
truffile models
truffile chat "hello"
truffile proxy --host 127.0.0.1 --port 8080

Inference Interfaces

Direct IF2:

  • list models: GET /if2/v1/models
  • chat completions: POST /if2/v1/chat/completions

CLI wrappers:

  • truffile models
  • truffile chat (streaming by default)

Proxy

truffile proxy serves OpenAI-compatible routes locally and forwards to device IF2:

  • GET /v1/models
  • POST /v1/chat/completions

Default local base URL:

  • http://127.0.0.1:8080/v1

Reasoning behavior:

  • default: proxy can inject reasoning into content as <think>...</think>
  • --no-think-tags: keeps reasoning separate as reasoning_content in stream deltas

Proto Sync

Refresh vendored protos from firmware repo:

./scripts/sync_protos.sh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

truffile-0.1.17.tar.gz (556.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

truffile-0.1.17-py3-none-any.whl (147.5 kB view details)

Uploaded Python 3

File details

Details for the file truffile-0.1.17.tar.gz.

File metadata

  • Download URL: truffile-0.1.17.tar.gz
  • Upload date:
  • Size: 556.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for truffile-0.1.17.tar.gz
Algorithm Hash digest
SHA256 a77c4c1f83dc1254fe3b3409b4d4239688d5e236c2576dc1798caf1de7a9bcd4
MD5 2780a22c42fcf8910a5991d32ae0cd97
BLAKE2b-256 6dbde9dc30969974a2cf91e322a285f97812513ae53a210e10b5155c05df43af

See more details on using hashes here.

Provenance

The following attestation bundles were made for truffile-0.1.17.tar.gz:

Publisher: publish_pip.yml on deepshard/truffile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file truffile-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: truffile-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 147.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for truffile-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 2d055b7b064938389427d9fc3309cedabc8a028085b767a2c3267632f2b0e787
MD5 6172c0b157a14d7e796f6e2c7082ad43
BLAKE2b-256 cfca50a0dc71321ef3d8cf923b180ae857129676fc824781aa9115242db0d6ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for truffile-0.1.17-py3-none-any.whl:

Publisher: publish_pip.yml on deepshard/truffile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page