Skip to main content

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

Project description

Function for Python

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.52.tar.gz (826.0 kB view details)

Uploaded Source

Built Distribution

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

fxn-0.0.52-py3-none-any.whl (834.6 kB view details)

Uploaded Python 3

File details

Details for the file fxn-0.0.52.tar.gz.

File metadata

  • Download URL: fxn-0.0.52.tar.gz
  • Upload date:
  • Size: 826.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for fxn-0.0.52.tar.gz
Algorithm Hash digest
SHA256 b817c84cac6c86851e920cf09e4be0e4f8d49a4138be5fca88a28ccbbb4048b3
MD5 6976a02258191143f230e46b1c5ef523
BLAKE2b-256 0640ff1cb5e2b567901c69afed036942cbb2e1565b8853b0f44d0775a1b7632f

See more details on using hashes here.

File details

Details for the file fxn-0.0.52-py3-none-any.whl.

File metadata

  • Download URL: fxn-0.0.52-py3-none-any.whl
  • Upload date:
  • Size: 834.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for fxn-0.0.52-py3-none-any.whl
Algorithm Hash digest
SHA256 f621f8a5ae44455a1e1b2b52b15519fbce6736ca54c3112f9c393adac3a923aa
MD5 e9a225a98c960be0517492eff88ec440
BLAKE2b-256 f5288f5d28f33b427cd671081482e32b48a6a5bc11196ce127e71520b3fe8dc5

See more details on using hashes here.

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