Skip to main content

Run on-device and cloud AI prediction functions in Python. Register at https://fxn.ai.

Project description

Function for Python and CLI

function logo

Run AI prediction functions (a.k.a "predictors") in your Python apps. With Function, you can build AI-powered apps by creating and composing GPU-accelerated predictors that run in the cloud. In a few steps:

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:

pip install fxn

Note that Function requires Python 3.9+

Signing in to Function

Head over to fxn.ai to create an account by logging in. Once you do, generate an access key:

generate access key

Now, let's login to the Function CLI with your access key. Open a terminal and run the following command:

fxn auth login <ACCESS KEY>

You should see information about your Function account:

login to CLI

Making a Prediction

You can start off by running an existing predictor on Function. Let's run the @natml/stable-diffusion predictor which accepts a text prompt and generates a corresponding image. In terminal, run the following command:

fxn predict @natml/stable-diffusion --prompt "An astronaut riding a horse on the moon"

And within a few seconds, you should see a creepy-looking image pop up 😅:

prediction

Creating a Predictor

At some point, you might want to create your own predictor. With Function, you don't have to deal with GitHub repos, Dockerfiles, or weird YAMLs. All you need is a Jupyter Notebook with a predict function. See our samples project for more.


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.14.tar.gz (19.8 kB view hashes)

Uploaded Source

Built Distribution

fxn-0.0.14-py3-none-any.whl (25.4 kB view hashes)

Uploaded Python 3

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