https://github.com/fxnai/fxn
Run Python functions on desktop, mobile, web, and in the cloud. https://fxn.ai/explore
https://github.com/fxnai/fxn
ai deep-learning machine-learning numpy pytorch serverless serverless-gpu
Last synced: 10 months ago
JSON representation
Run Python functions on desktop, mobile, web, and in the cloud. https://fxn.ai/explore
- Host: GitHub
- URL: https://github.com/fxnai/fxn
- Owner: fxnai
- License: apache-2.0
- Created: 2023-05-15T15:10:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-08T16:36:43.000Z (10 months ago)
- Last Synced: 2025-04-08T17:34:33.553Z (10 months ago)
- Topics: ai, deep-learning, machine-learning, numpy, pytorch, serverless, serverless-gpu
- Language: Python
- Homepage: https://docs.fxn.ai
- Size: 975 KB
- Stars: 47
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# Function for Python

[](https://discord.gg/fxn)
Run prediction functions (a.k.a "predictors") locally in your Python apps, with full GPU acceleration and zero dependencies.
> [!TIP]
> [Join our waitlist](https://fxn.ai/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:
```sh
# Install Function
$ pip install --upgrade fxn
```
> [!NOTE]
> Function requires Python 3.10+
## Retrieving your Access Key
Head over to [fxn.ai](https://www.fxn.ai/account/developer) 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:
```py
from fxn import Function
# Create the Function client
fxn = Function(access_key="")
```
Then make a prediction:
```py
# 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:
```sh
# Login to Function
$ fxn auth login
```
Then make a prediction:
```sh
# Make a prediction using the Function CLI
$ fxn predict @fxn/greeting --name Peter
```
___
## Useful Links
- [Discover predictors to use in your apps](https://fxn.ai/explore).
- [Join our Discord community](https://discord.gg/fxn).
- [Check out our docs](https://docs.fxn.ai).
- Learn more about us [on our blog](https://blog.fxn.ai).
- Reach out to us at [hi@fxn.ai](mailto:hi@fxn.ai).
Function is a product of [NatML Inc](https://github.com/natmlx).