Introduction

Getting Started

Install

pip3 install forefront

Import

from forefront import Forefront

Basic Usage

To get started, create an account and navigate to your personal settings to get an API key. This API key can be used for any personal or team project.

To inference your model, you'll need to copy the staging or production endpoint URL on a project dashboard. The current version of the client library supports sending numpy data, so you'll need to convert Tensorflow or Pytorch tensors.

ff = Forefront()
# CIFAR-like data for example
data = np.random.rand(8, 32, 32, 3)
result = ff("galactic-elongated-testorg.forefront.link", data, "API_KEY")

Lower level inference

If you'd like to inference your models more manually, or perhaps using a different programming language (other client libraries coming soon), you can make a simple HTTP request.

import json
import numpy as np
api_key = "{MY_API_KEY}"
endpoint = "galactic-elongated-testorg.forefront.link"
method = "POST"
headers = {'Content-Type': 'application/json',
'Authorization': f'Bearer {api_key}'}
data = np.random.rand(8, 32, 32, 3)
formatted_data = json.dumps(data.tolist())
response = requests.post(endpoint, body=formatted_data, headers=headers)