Run prediction functions locally in Python. Register at https://fxn.ai.
Project description
Function for Python and CLI
Run prediction functions (a.k.a "predictors") locally in your Python apps, with full GPU acceleration and zero dependencies.
[!TIP] Join our waitlist to bring your custom Python functions and run them on-device across Android, iOS, macOS, Linux, web, and Windows.
Installing Function
Function is distributed on PyPi. This distribution contains both the Python client and the command line interface (CLI). To install, open a terminal and run the following command:
# Install Function
$ pip install --upgrade fxn
[!NOTE] Function requires Python 3.10+
Retrieving your Access Key
Head over to fxn.ai to create an account by logging in. Once you do, generate an access key:
Making a Prediction
First, create a Function client, specifying your access key:
from fxn import Function
# Create the Function client
fxn = Function(access_key="<Function access key>")
Then make a prediction:
# Create a prediction
prediction = fxn.predictions.create(
tag="@fxn/greeting",
inputs={ "name": "Peter" }
)
# Print the returned greeting
print(prediction.results[0])
Using the Function CLI
Open up a terminal and login to the Function CLI:
# Login to Function
$ fxn auth login <ACCESS KEY>
Then make a prediction:
# Make a prediction using the Function CLI
$ fxn predict @fxn/greeting --name Peter
Useful Links
- Discover predictors to use in your apps.
- Join our Discord community.
- Check out our docs.
- Learn more about us on our blog.
- Reach out to us at hi@fxn.ai.
Function is a product of NatML Inc.
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 Distribution
Built Distribution
File details
Details for the file fxn-0.0.41.tar.gz
.
File metadata
- Download URL: fxn-0.0.41.tar.gz
- Upload date:
- Size: 812.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fbc2cf3274e4d222da14ad4c7320d8b7abdf95b83746d2d802d666b5211c044 |
|
MD5 | 7394b0f72824fc21a2d3bd6881e675bf |
|
BLAKE2b-256 | 7668e50818e4e4e6f00ba24c95998167e1c3a9ebe91c908e795e18f9bb8ff6e7 |
File details
Details for the file fxn-0.0.41-py3-none-any.whl
.
File metadata
- Download URL: fxn-0.0.41-py3-none-any.whl
- Upload date:
- Size: 818.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d71d1b35aca688d574006c7f367330f8645b13a15d86b0de99ade14cb318ca0 |
|
MD5 | 879d86c891ca557beb808f1c91621607 |
|
BLAKE2b-256 | 387d85f75d51478fc4cfea2c3b35a3b0742cd001347b146fb75994248b2dc2a1 |