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.dev3.tar.gz (211.9 kB 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.dev3-py3-none-any.whl (270.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: synth_ai-0.2.4.dev3.tar.gz
  • Upload date:
  • Size: 211.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for synth_ai-0.2.4.dev3.tar.gz
Algorithm Hash digest
SHA256 9f578084cfd1b6bca3885c7b546d90ca61c41ea1eabe947954d2b9e376f1bd8b
MD5 41f5fa0a5c0433f2f3bddaae2e8f697f
BLAKE2b-256 50ee35cf29cd72646f4d83d4462667b34c1cab8637b9fe8561fbbd8b2a7d6b73

See more details on using hashes here.

File details

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

File metadata

  • Download URL: synth_ai-0.2.4.dev3-py3-none-any.whl
  • Upload date:
  • Size: 270.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for synth_ai-0.2.4.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 d9e571a73e62363104818b0c64c47a74defb4c9dd72289e65c54661bde513838
MD5 e4278c9ee8d5e431551530d27d7cd614
BLAKE2b-256 705736c7e3acdfd586adcb52b12a7decea40409226febab0f7995b39af186a29

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