Skip to main content

Software for aiding the best and multiplying the will - Core AI functionality and tracing

Project description

Synth AI

Modern Compound AI System Development

Comprehensive AI Framework for Language Models, Environments, and Observability

Python License PyPI Coverage Tests

A unified framework combining language model capabilities, synthetic environments, and comprehensive tracing for building and evaluating AI agents.

🚀 Quick Start

Installation

# Basic installation
pip install synth-ai

# With research environments (includes game environments)
pip install synth-ai[research]

# Full installation with all providers
pip install synth-ai[all]

Spinning Up

Start the Synth AI service daemon (includes sqld database + environment service):

# Start both database daemon (port 8080) and environment service (port 8901)
uvx synth-ai serve

Service Command Options

uvx synth-ai serve [OPTIONS]

Available Options:

  • --db-file - Database file path (default: "synth_ai.db")
  • --sqld-port - Port for sqld HTTP interface (default: 8080)
  • --env-port - Port for environment service (default: 8901)
  • --no-sqld - Skip starting sqld database daemon
  • --no-env - Skip starting environment service

Examples:

# Start with custom ports
uvx synth-ai serve --sqld-port 8081 --env-port 8902

# Start only the environment service
uvx synth-ai serve --no-sqld

# Start only the database service
uvx synth-ai serve --no-env

What the Serve Command Provides

sqld Database Service (port 8080)

  • Local SQLite-compatible database server with HTTP API
  • Automatically downloads and installs sqld binary if needed
  • Provides persistent storage for agent interactions and traces

Environment Service (port 8901)

  • FastAPI service for managing AI environments and tasks
  • Built-in environments: Crafter, Sokoban, MiniGrid, TicTacToe, Verilog, NetHack, Enron
  • RESTful API for environment initialization, stepping, and termination
  • Dynamic environment registry for custom environments

In another terminal, run your first example:

# Run a Crafter agent demo with Gemini
./examples/run_crafter_demo.sh

This will:

  • Start the sqld database daemon with HTTP API on port 8080
  • Launch the environment service API on port 8901
  • Run a reactive agent in the Crafter environment using Gemini 1.5 Flash

Demos (Eval + Finetuning)

You can run interactive demos from the repo without remembering exact commands:

# Lists all available demos under examples/, then prompts you to choose
uvx synth-ai demo

Today this includes:

  • Eval demo: examples/evals/run_demo.sh
    • Prompts for models, episodes, etc.
    • Runs Crafter rollouts with v3 tracing, then analyzes and filters traces
    • Writes a JSONL like ft_data/evals_filtered.jsonl for downstream use
  • Finetuning demo: examples/finetuning/synth_qwen/run_demo.sh
    • Guides you through: rollouts → filter v3 traces → prepare SFT JSONL
    • Pair with uvpm examples.finetuning.synth_qwen.sft_kickoff to start an SFT job when ready

Notes:

  • Ensure the service is running (uvx synth-ai serve) so v3 traces are recorded locally.
  • Set API configuration for finetuning:
    • export LEARNING_V2_BASE_URL="http://localhost:8000/api" (or your proxy)
    • export SYNTH_API_KEY="sk_live_..."
  • v3 trace data is stored under traces/v3/synth_ai.db/ by default. Inspect with uvx synth-ai traces.
  • LM tracing: all model calls (prompts, outputs, tool calls, token usage, latency, cost) are automatically captured via v3 tracing and stored locally; inspect with uvx synth-ai traces.

One-Command Demos

Quickly browse and launch interactive demos under examples/:

uvx synth-ai demo

This lists all run_demo.sh scripts found in the repo (e.g., eval comparisons, finetuning flows) and lets you pick one to run.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synth_ai-0.2.4.dev2.tar.gz (43.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synth_ai-0.2.4.dev2-py3-none-any.whl (47.3 MB view details)

Uploaded Python 3

File details

Details for the file synth_ai-0.2.4.dev2.tar.gz.

File metadata

  • Download URL: synth_ai-0.2.4.dev2.tar.gz
  • Upload date:
  • Size: 43.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for synth_ai-0.2.4.dev2.tar.gz
Algorithm Hash digest
SHA256 0d453eefb30bcb51a01d59e92c7ffd8cf2d1dc6953764477ea51b0de6faea50b
MD5 f3e34c1452ca48f3efd4840db8a0864a
BLAKE2b-256 fcecbdcdcc19c7f13c8441135a6def702a9e46536ed2aaf329f26c0d388c6be0

See more details on using hashes here.

File details

Details for the file synth_ai-0.2.4.dev2-py3-none-any.whl.

File metadata

  • Download URL: synth_ai-0.2.4.dev2-py3-none-any.whl
  • Upload date:
  • Size: 47.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for synth_ai-0.2.4.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 8334e8428eb0300524abd88d5f5a73ef51840824f733226c5f698d3a10b21e21
MD5 1733a448b70cba9afe43a9468cbc0d4b
BLAKE2b-256 b3729911dc569ab5c6fea4261b180b7723c9f8ab8d40b1712965fd22bd886c1b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page