Fournex
F
Fournex Docs

Fournex Documentation

Deploy Reinforcement Learning Agents at Scale. High performance, multi-tenant, and production ready.

v0.0.1StableUpdated 2 days ago

Getting Started

Get up and running with Fournex in minutes. Our platform is designed to be framework-agnostic, supporting Stable-Baselines3, ONNX, and custom PyTorch models out of the box.

Installation
# Clone the repository
git clone https://github.com/jorgevee/Fournex.git
cd Fournex

# Start all services (PostgreSQL, MinIO, Redis, API)
docker-compose up -d

# Start the platform
docker-compose up -d
Deploy Your First Agent
from fournex import Client

# Response includes agent_id and version_id
# {
#   "agent_id": "123e4567-e89b-12d3-a456-426614174000",
#   "version_id": "...",
#   "artifact_uri": "s3://agents/workspace/agent/v1/model.zip",
#   "checksum": "a3d2f8e9...",
#   "size_bytes": 10485760
# }

# Upload your trained agent
agent = client.deploy(
    name="my-cartpole-agent",
    framework="sb3",
    model_path="./trained_agent.zip",
    obs_space={"type": "box", "shape": [4]},
    action_space={"type": "discrete", "n": 2}
)

Key Features

Multi-Framework

Native support for SB3, ONNX, RLLib, and PyTorch.

High Performance

C-optimized inference engine delivering 85M+ ops/sec.

Stateful & Stateless

Support for both reactive agents and environment sessions.

Multi-tenant

Built-in workspace isolation, API keys, and rate limiting.

System Architecture

Fournex follows a three-phase implementation strategy to ensure scalability and reliability.

Phase 1: Foundation

Complete
  • Multi-tenant PostgreSQL database (12 tables)
  • C performance layer (405M+ ops/sec memory operations)
  • pybind11 Python bindings with zero-copy NumPy

Phase 2: Inference Engine

Complete
  • FastAPI async service (10K+ RPS per instance)
  • Two-tier caching (LRU + Redis)
  • Prometheus metrics and rate limiting

Performance Benchmarks

OperationThroughputUse Case
Arena Allocator405M ops/secBulk tensor allocations
Ring Buffer253M ops/secTrajectory storage
Memory Pool319M ops/secSmall allocations
Tensor Add64M ops/secVector math

API Reference

POST/v0/agents

Upload and register a new agent. Supports SB3 and ONNX formats.

POST/v0/agents/{agent_id}:act

Stateless inference - send observation, receive action prediction.

POST/v0/sessions/{session_id}/step

Step the environment. Agent automatically selects action if not provided.

Deployment

Deploy your agents to production with confidence.