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 askfaro 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 (askfaro._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.

Async

For server-side consumers on an event loop (e.g. an async FastAPI backend), AsyncFaro mirrors Faro with awaitable network methods, so you don't wrap calls in asyncio.to_thread:

from askfaro import AsyncFaro

async with AsyncFaro(api_key="faro_...") as faro:
    hits = await faro.search("transcribe an audio file")
    r = await faro.run("image", {"prompt": "a red bicycle"})
    assert r.ok

Same constructor, routing, and result types as Faro. Only the network methods (search, describe, browse, remote invoke, run) are coroutines; on-device invoke() runs in the synchronous in-process core (sub-millisecond), so there is no blocking I/O to offload.

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

askfaro._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 askfaro._core extension from it
  • python/askfaro/ — 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 askfaro._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.3.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.3.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.3.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.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for askfaro-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 67a9d847b91a0e7de37ae8d919d2083158fc96829a77e37ba0ac8e0d5729098e
MD5 fe2ab0c50dc41b903045be79b71eb4a3
BLAKE2b-256 2a3d49353d0f6982ed13f54149c00285a2c33a720bd829611fb598a2da8b5763

See more details on using hashes here.

Provenance

The following attestation bundles were made for askfaro-0.3.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.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for askfaro-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 043611fac83296583944e2a856b07e64e0207d9dcdb8dfa3641c47bba0bee116
MD5 987b84722fe8bdc325bffa8057c22516
BLAKE2b-256 880d8e90eb9aa5f06a334eda50aef49bd49071a4ef903bc52a3037097a2795a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for askfaro-0.3.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.3.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.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 583da43aa12d18f8ef6396b3751fc78cae0bb7aa6dae0a4777213600cecedb36
MD5 5d5d02635c89335830776ebb959c7f98
BLAKE2b-256 7d099efb60df76da8caa9e46867de8881c897b486c4520fcf8420aaffc49b47a

See more details on using hashes here.

Provenance

The following attestation bundles were made for askfaro-0.3.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