Skip to main content

Run prediction functions locally in Python. Register at https://fxn.ai.

Project description

Function for Python and CLI

function logo

Dynamic JSON Badge

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:

generate 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

Function is a product of NatML Inc.

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

fxn-0.0.41.tar.gz (812.5 kB view details)

Uploaded Source

Built Distribution

fxn-0.0.41-py3-none-any.whl (818.0 kB view details)

Uploaded Python 3

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

Hashes for fxn-0.0.41.tar.gz
Algorithm Hash digest
SHA256 5fbc2cf3274e4d222da14ad4c7320d8b7abdf95b83746d2d802d666b5211c044
MD5 7394b0f72824fc21a2d3bd6881e675bf
BLAKE2b-256 7668e50818e4e4e6f00ba24c95998167e1c3a9ebe91c908e795e18f9bb8ff6e7

See more details on using hashes here.

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

Hashes for fxn-0.0.41-py3-none-any.whl
Algorithm Hash digest
SHA256 5d71d1b35aca688d574006c7f367330f8645b13a15d86b0de99ade14cb318ca0
MD5 879d86c891ca557beb808f1c91621607
BLAKE2b-256 387d85f75d51478fc4cfea2c3b35a3b0742cd001347b146fb75994248b2dc2a1

See more details on using hashes here.

Supported by

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