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.47.tar.gz (822.1 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.47-py3-none-any.whl (831.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fxn-0.0.47.tar.gz
  • Upload date:
  • Size: 822.1 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.47.tar.gz
Algorithm Hash digest
SHA256 ee6cae72186c358d9b0a5970bfd9cbe5a8505ee848710e095235fa2b2a547a14
MD5 cde96cb47a4e14f873c6b13635fea87d
BLAKE2b-256 3829bdd555b77973f380525ec669679d9860428c2bb9c96fbaa8945cbf9e9ecd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fxn-0.0.47-py3-none-any.whl
  • Upload date:
  • Size: 831.2 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.47-py3-none-any.whl
Algorithm Hash digest
SHA256 1ad242b0f26775fcc949fa9edd77d7917d4e73b3f75b81c43fe7a0ce155fdbd5
MD5 484efef63249ae1520220507c98c3f12
BLAKE2b-256 f2e08ea7d6ce0cd9e3bbeae8051c6df5d56865011fdb41bdfc32eaf95a176a83

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