# ai.fxn.fxn3d

> Run AI prediction functions in Unity Engine.

Latest version **0.0.41** (published 2025-05-25) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install ai.fxn.fxn3d
pnpm add ai.fxn.fxn3d
yarn add ai.fxn.fxn3d
bun add ai.fxn.fxn3d
```

## Health

**Score 35/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.0.41 |
| Published | 2025-05-25 |
| First published | 2023-06-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | NatML Inc |
| Maintainers | olokobayusuf |
| Keywords | fxn, natml, machine learning, ml, aritificial intelligence, ai, computer vision, opencv, android, ios, macos, windows, coreml, nnapi, directml, tensorflow, pytorch, torch, llm |

## Links

- npm: https://www.npmjs.com/package/ai.fxn.fxn3d
- Repository: https://github.com/fxnai/fxn3d
- Homepage: https://github.com/fxnai/fxn3d#readme
- Issues: https://github.com/fxnai/fxn3d/issues
- npm.io page: https://npm.io/package/ai.fxn.fxn3d

## Dependencies (1)

- [com.unity.nuget.newtonsoft-json](https://npm.io/package/com.unity.nuget.newtonsoft-json.md) 3.2.1

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 0.0.41 (latest) — 2025-05-25
- 0.0.40 — 2025-05-17
- 0.0.39 — 2025-03-02
- 0.0.38 — 2025-02-20
- 0.0.37 — 2025-02-19
- 0.0.36 — 2025-02-19
- 0.0.35 — 2025-01-31
- 0.0.34 — 2025-01-22
- 0.0.33 — 2024-12-31
- 0.0.32 — 2024-12-20
- 0.0.31 — 2024-12-10
- 0.0.30 — 2024-10-26
- 0.0.29 — 2024-09-03
- 0.0.28 — 2024-09-03
- 0.0.27 — 2024-08-23
- … 26 more at https://npm.io/package/ai.fxn.fxn3d/versions

## README

# Function for Unity Engine

![function logo](https://raw.githubusercontent.com/fxnai/.github/main/logo_wide.png)

Run Python functions (a.k.a "predictors") locally in your Unity apps and games, with full GPU acceleration and zero dependencies. In a few steps:

## Installing Function
Add the following items to your Unity project's `Packages/manifest.json`:
```json
{
  "scopedRegistries": [
    {
      "name": "Function",
      "url": "https://registry.npmjs.com",
      "scopes": ["ai.fxn"]
    }
  ],
  "dependencies": {
    "ai.fxn.fxn3d": "0.0.41"
  }
}
```

## Retrieving your Access Key
Head over to [fxn.ai](https://fxn.ai) to create an account by logging in. Once you do, generate an access key:

![generate access key](https://raw.githubusercontent.com/fxnai/.github/main/access_key.gif)

Then add it to your Unity project in `Project Settings > Function`:

![add access key to Unity](https://raw.githubusercontent.com/fxnai/fxn3d/main/settings.gif)

## Making a Prediction
First, create a Function client:
```csharp
using Function;

// Create a Function client
var fxn = FunctionUnity.Create();
```

Then make a prediction:
```csharp
// Make a prediction
var prediction = await fxn.Predictions.Create(
    tag: "@fxn/greeting",
    inputs: new () { ["name"] = "Roberta" }
);
// Log the result
Debug.Log(prediction.results[0]);
```

___

## Requirements
- Unity 2022.3+

## Supported Platforms
- Android API Level 24+
- iOS 14+
- macOS 12+ (Apple Silicon and Intel)
- Windows 10+ (64-bit only)
- WebGL:
  - Chrome 91+
  - Firefox 90+
  - Safari 16.4+

## Useful Links
- [Discover predictors to use in your apps](https://fxn.ai/explore).
- [Join our Discord community](https://fxn.ai/community).
- [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).

Thank you very much!

---
_Source: https://npm.io/package/ai.fxn.fxn3d · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
