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
The Faro Python SDK. Local-first: the free tools the bundled Rust core can run
execute on-device with invoke() — no API key, no network, no credits. Everything
else is a skill you run() on Faro's hosted skill agent. Both return the
identical canonical envelope, so your result-handling code is the same 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_...")
r = faro.run("image", {"prompt": "a red bicycle"})
if r.ok:
print(r.data, r.credits_charged)
else:
print("failed:", r.error) # a failed skill is a result, not an exception
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, split by where the work happens:
invoke("namespace/tool")runs an on-device core tool (calc, units, phone, …) in-process: no key, no network, no credits. Only the bundled core's free tools are invocable; raw remote tools are not directly callable (the API answers "use the skill layer"), so for anything vendor-backed, userun().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).
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. Calling invoke() on a non-core tool raises and points you at
run().
Results & errors
invoke() and run() return an InvokeResult (the canonical envelope). Read
.status, which is one of three outcomes — a failed call is a result, not an
exception:
r = faro.run("audio-intelligence", {"url": "https://.../clip.mp3"}, confirm_above=50)
if r.ok: # status == "success"
use(r.data) # .data, .summary, .meta, .credits_charged
elif r.status == "needs_input":
# A clarification, or a budget QUOTE that crossed confirm_above. Inspect
# r.needs_input, then resume the *same* plan with the signed token:
r = faro.run("audio-intelligence", {...}, continuation=r.continuation)
else: # status == "failed"
print(r.error["code"], r.error["message"]) # auth | insufficient_credits | ...
Only transport/HTTP problems raise: FaroError (bad input, missing key) and
RemoteError (network failure, or an HTTP error from the skill agent, with
.status and .retryable). Everything the skill itself reports — failure,
clarification, budget quote — comes back on the result so you handle all outcomes
in one place. Cost ceilings: max_credits is a hard cap (the run aborts rather
than exceed it); confirm_above is the soft ceiling that returns the quote above.
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 and result types as Faro. The network methods (search,
describe, browse, run) are coroutines; invoke() is awaitable too for a
uniform surface, but the on-device core runs in-process (sub-millisecond), so
there is no blocking I/O to offload.
Discovery
Describe what you want and get a ranked skill to run(). Discovery needs no API key.
faro = Faro()
# Describe what you want; get ranked, ready-to-run skills:
for hit in faro.search("transcribe an audio file"):
print(hit.id, hit.short_description, hit.pricing)
# A hit's .id is exactly what run() takes:
best = faro.search("transcribe an audio file")[0]
faro.run(best.id, {"url": "https://.../clip.mp3"}) # paid -> needs a key
# Full input schema + pricing for one candidate:
faro.describe("audio-intelligence/transcribe")
# 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. run() on a paid skill 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/— thefaro-core-freeRust crate (the free-tool implementations + the canonical envelope)src/lib.rs— the PyO3 binding that builds theaskfaro._coreextension from itpython/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 # offline Python tests (mocked, no network)
FARO_API_KEY=faro_... .venv/bin/pytest -m live # contract tests vs the real API
python examples/quickstart.py
Tests come in two layers — offline (mocked) and live contract tests that hit the real endpoints and gate the release. Mocks can't catch contract drift, so see TESTING.md for the rule: every mocked boundary must be paired with a live check.
Published wheels are prebuilt (manylinux x86_64/aarch64 + macOS universal2), so end users install with no Rust toolchain.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file askfaro-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: askfaro-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.1 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a98598fb43845c306cab94123a476cb410dc1210e773e1913a9eec6f4f572a1a
|
|
| MD5 |
4892a11617048cfa929d733e71aea94e
|
|
| BLAKE2b-256 |
7c4f8964ca5fb58ffdafc3416bf4308e2bb6846b0d77818cc90aa8c763050a7f
|
Provenance
The following attestation bundles were made for askfaro-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on poolside-ventures/askfaro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
askfaro-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
a98598fb43845c306cab94123a476cb410dc1210e773e1913a9eec6f4f572a1a - Sigstore transparency entry: 1853575195
- Sigstore integration time:
-
Permalink:
poolside-ventures/askfaro@f395c293a8a16d5aba357d79772f19149ab48802 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/poolside-ventures
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f395c293a8a16d5aba357d79772f19149ab48802 -
Trigger Event:
push
-
Statement type:
File details
Details for the file askfaro-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: askfaro-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 3.7 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e7ac66cbd1801fadb680a52f01ae6e53627533f0d7a7edec695555b3048ce04
|
|
| MD5 |
836cbce87ca11b99bfbab3e757199b14
|
|
| BLAKE2b-256 |
575755142814b2938d916fbf42beae82fd0ef672477bd1a200389d199f2350da
|
Provenance
The following attestation bundles were made for askfaro-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on poolside-ventures/askfaro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
askfaro-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
7e7ac66cbd1801fadb680a52f01ae6e53627533f0d7a7edec695555b3048ce04 - Sigstore transparency entry: 1853575115
- Sigstore integration time:
-
Permalink:
poolside-ventures/askfaro@f395c293a8a16d5aba357d79772f19149ab48802 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/poolside-ventures
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f395c293a8a16d5aba357d79772f19149ab48802 -
Trigger Event:
push
-
Statement type:
File details
Details for the file askfaro-0.4.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: askfaro-0.4.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 7.4 MB
- Tags: CPython 3.9+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8fc12c2db6db8a48f110292317123bbed4731fa9d25a0f41eed4681b3277cc5
|
|
| MD5 |
1d5ee33b3fb63a78b393f88cf7d417dd
|
|
| BLAKE2b-256 |
8b271b4bc5ded39bf981613046ddebd4d45d70609a5341e60b7b05118f5510de
|
Provenance
The following attestation bundles were made for askfaro-0.4.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:
Publisher:
release.yml on poolside-ventures/askfaro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
askfaro-0.4.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl -
Subject digest:
e8fc12c2db6db8a48f110292317123bbed4731fa9d25a0f41eed4681b3277cc5 - Sigstore transparency entry: 1853575148
- Sigstore integration time:
-
Permalink:
poolside-ventures/askfaro@f395c293a8a16d5aba357d79772f19149ab48802 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/poolside-ventures
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f395c293a8a16d5aba357d79772f19149ab48802 -
Trigger Event:
push
-
Statement type: