Skip to main content

Faro SDK: run free Faro tools on-device via the bundled Rust core, fall back to the API for the rest. Local and remote results share the identical envelope.

Project description

askfaro

PyPI CI License: MIT

The Faro Python SDK. Local-first: tools the bundled Rust core can run execute on-device — no API key, no network, no credits. Everything else falls back to the Faro backend. Local and remote results share the identical canonical envelope, so the same code path works whether a tool ran on your machine or in the cloud.

pip install askfaro
from faro import Faro

faro = Faro()                                    # no key needed for on-device tools
r = faro.invoke("calc/evaluate", {"expression": "2 + 2 * 3"})
assert r.ok and r.local and r.data["result"] == 8

# Anything beyond the on-device core is a *skill*: the skill agent picks the
# tools, runs them, enforces your budget, and bills your account.
faro = Faro(api_key="faro_...")
faro.run("image", {"prompt": "a red bicycle"})

The Rust core is compiled into this package (faro._core), so a single pip install askfaro is all you need — there is no separate core package to install.

invoke() vs run()

Two execution methods:

  • invoke("namespace/tool") calls one tool. Use it for the on-device core (calc, units, phone, …), which runs locally with no key and no network. Raw remote tools are not directly callable (the API answers "use the skill layer"), so for anything vendor-backed, use run().
  • run("skill", intent) runs a skill: the skill agent selects the operations, calls the underlying tools, enforces your budget, and bills your account. This is the path for every capability that isn't an on-device tool. It needs an API key and runs on Faro's hosted skill agent (skill.askfaro.com).

invoke() routing (mode=, per-call override on invoke(..., mode=...)):

mode behavior
auto (default) run on-device when the core can; otherwise call the API
local on-device only; raise LocalUnavailableError if the core can't run it
remote always call the API (succeeds only for tools the API still exposes directly)

What runs on-device is the bundled core's capability list (Faro.local_namespaces()), not a pricing flag; it grows as more tools are ported into the core.

Discovery

Two ways to reach a capability: invoke one you already know, or find one from intent. Discovery needs no API key.

faro = Faro()

# Describe what you want; get ranked, ready-to-invoke skills/tools:
for hit in faro.search("transcribe an audio file"):
    print(hit.id, hit.short_description, hit.pricing)

# Each hit's .id is exactly what invoke() takes:
best = faro.search("transcribe an audio file")[0]
# faro.invoke(best.id, {"url": "https://.../clip.mp3"}, mode="remote")   # paid -> needs a key

# Full input schema + pricing for one candidate:
faro.describe("audio-intelligence/transcribe")

# A skill hit's .id runs via the skill agent; a tool hit's .id is for invoke():
hit = faro.search("generate an image")[0]
if hit.kind == "skill":
    faro.run(hit.id, {"prompt": "a red bicycle"})

# Browse instead of search: a progressive-context (pcx) map you expand one branch
# at a time, sized for small / on-device context windows:
manifest = faro.browse(budget="4k")    # navigate via its self-describing `usage` field

search() is hybrid lexical + semantic over the public catalog; browse() returns the progressive-context manifest. Both work with no account. invoke() on a paid tool still needs a key and credits.

What's bundled

faro._core is the MIT open-source free-tool slice of the Faro core (the faro-core-free Rust crate): calc, units, phone, astronomy, encoding, datetime, timezone, random, and timer, plus the canonical envelope builders. The proprietary parts of Faro (selection gate, signed continuations, cloud client, billing) are NOT in this package; vendor-backed tools run server-side via the API.

Development

This is a maturin mixed Rust/Python project, fully self-contained:

  • core-free/ — the faro-core-free Rust crate (the free-tool implementations + the canonical envelope)
  • src/lib.rs — the PyO3 binding that builds the faro._core extension from it
  • python/faro/ — the pure-Python SDK (routing, client, result types)
  • examples/quickstart.py — a runnable tour
cargo test -p faro-core-free   # Rust tests
uv venv && uv pip install ".[dev]"   # builds faro._core via maturin
.venv/bin/pytest               # Python tests, no network
python examples/quickstart.py

Published wheels are prebuilt (manylinux x86_64/aarch64 + macOS universal2), so end users install with no Rust toolchain.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

askfaro-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

askfaro-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.7 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

askfaro-0.2.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.4 MB view details)

Uploaded CPython 3.9+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file askfaro-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for askfaro-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d3c4f8af95d1c7b27b781849f63ddf45ccea3f3fd296add7d14f0fee866385d8
MD5 0a72fdef3236a1680d3251221592ee28
BLAKE2b-256 c92fa2ed24f2a8715cc88361dee9dc077ea5b378eb4e18dd2af0f397af803c60

See more details on using hashes here.

Provenance

The following attestation bundles were made for askfaro-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on poolside-ventures/askfaro

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

File details

Details for the file askfaro-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for askfaro-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a134e2ce60d5669c17c4558ddb0e61a84e8ee0ad9945b4e7eaf3fdce1fb2b49d
MD5 45fcf12f2c6e8d1f61f23facf575876a
BLAKE2b-256 3d6667b03ac9cb2b8b69797948403043e14f63dce2df1e733aeebc0a36273498

See more details on using hashes here.

Provenance

The following attestation bundles were made for askfaro-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on poolside-ventures/askfaro

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

File details

Details for the file askfaro-0.2.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for askfaro-0.2.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 1575883bf9017441c4553de3496573f74b3b7b177ed3ab92aa03b2c9cd85ed25
MD5 07f46c4098efc2735d1d011f60dbe9ed
BLAKE2b-256 da5fc8023ee2652ca67c7b46961c5d0fb82e108d2cb0f2b679887af20fb21e88

See more details on using hashes here.

Provenance

The following attestation bundles were made for askfaro-0.2.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on poolside-ventures/askfaro

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