Software for aiding the best and multiplying the will - Core AI functionality and tracing
Project description
Synth AI
Comprehensive AI Framework for Language Models, Environments, and Observability

A unified framework combining language model capabilities, synthetic environments, and comprehensive tracing for building and evaluating AI agents.
๐ฏ Key Features
- ๐ค Language Models - Unified LM interface for OpenAI, Anthropic, Gemini, Groq, and more
- ๐๏ธ Synthetic Environments - Comprehensive framework for agent training and evaluation
- ๐ Observability & Tracing - Built-in monitoring, logging, and performance tracking
- ๐ Provider Support - Enhanced client wrappers with automatic tracing integration
- ๐ RESTful APIs - HTTP access for remote training and evaluation
- ๐ ๏ธ Agent Tools - Simple abstractions for agent-environment interaction
๐ 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]
Basic Usage
from synth_ai import LM
# Create language model
lm = LM("gpt-4o-mini", temperature=0.7)
# Generate structured output
from pydantic import BaseModel
class Response(BaseModel):
answer: str
confidence: float
result = lm("What is the capital of France?", response_format=Response)
print(result.structured_output.answer) # "Paris"
Environment Usage
from synth_ai.environments.examples.tictactoe.environment import TicTacToeEnvironment
# Create environment
env = TicTacToeEnvironment()
# Run agent
state = env.reset()
while not env.done:
action = agent.act(state)
state = env.step(action)
Tracing & Observability
from synth_ai.tracing import trace_event_sync
@trace_event_sync
def my_agent_step(observation):
# Your agent logic here
return action
# Automatic tracing of execution
๐ฎ Supported Environments
| Environment | Status | Description |
|---|---|---|
| TicTacToe | โ Stable | Simple strategic game for testing |
| Sokoban | โ Stable | Classic puzzle game for planning |
| Hendryks Math | โ Stable | Mathematical reasoning tasks |
| Crafter | ๐ Research | Minecraft-like survival environment |
| NetHack | ๐ Research | Complex dungeon exploration |
| MiniGrid | ๐ Research | Grid world navigation |
๐ค Supported LM Providers
| Provider | Status | Features |
|---|---|---|
| OpenAI | โ Full | GPT-4, structured outputs, tools |
| Anthropic | โ Full | Claude models, structured outputs |
| โ Full | Gemini models, structured outputs | |
| Groq | โ Full | Fast inference, structured outputs |
| Together | โ Full | Open source models |
| DeepSeek | โ Full | Code and reasoning models |
๐ Documentation
- API Reference - Complete API documentation
- Environment Guide - Detailed environment descriptions
- LM Provider Guide - Language model configuration
- Tracing Guide - Observability and monitoring
๐ง Development
Health Check
# Check codebase health
python scripts/check_health.py
Testing
# Fast tests (~3 seconds)
uv run pytest tests/ -x --tb=short
# With research environments
uv run --extra research pytest tests/
# Full test suite with coverage
uv run pytest tests/ --cov=synth_ai --cov-report=html
Code Quality
# Format code
ruff format .
# Check linting
ruff check .
# Type checking
uvx ty check
# Run all checks
uvx ty check && ruff check . && ruff format --check .
Performance Profiling
# Profile LM inference
uv run python -m synth_ai.lm.core.profiler
# Profile environment execution
uv run python -m synth_ai.environments.profiler
๐ Test Coverage & Metrics
Run comprehensive tests and generate metrics:
# Generate test coverage report
uv run pytest tests/ --cov=synth_ai --cov-report=html --cov-report=term
# Update README metrics
python dev/update_readme_metrics.py
# Fast metric update (unit tests only)
python dev/update_readme_metrics.py --fast
๐๏ธ Architecture
Monorepo Structure
synth_ai/
โโโ lm/ # Language model core (formerly zyk)
โ โโโ core/ # Main LM interface and clients
โ โโโ vendors/ # Provider-specific implementations
โ โโโ provider_support/ # Enhanced client wrappers
โ โโโ structured_outputs/ # Structured generation
โโโ environments/ # Environment framework (formerly synth_env)
โ โโโ examples/ # Built-in environments
โ โโโ service/ # REST API service
โ โโโ stateful/ # State management
โโโ tracing/ # Observability (formerly synth_sdk)
โ โโโ decorators/ # Function tracing
โ โโโ events/ # Event management
โ โโโ upload/ # Remote logging
โโโ zyk/ # Deprecated compatibility layer
Migration Guide
The package consolidates functionality from multiple repos:
# Old imports (deprecated, but still work)
from synth_ai.zyk import LM # โ ๏ธ Shows deprecation warning
from synth_env import tasks # โ ๏ธ Shows deprecation warning
# New imports (recommended)
from synth_ai import LM, environments
from synth_ai.environments import tasks
from synth_ai.lm.core.main import LM # Direct import
๐ข Publishing & Releases
Build Package
# Build for PyPI
uv build
# Check package contents
tar -tzf dist/synth-ai-*.tar.gz | head -20
Publish
# Test on TestPyPI
uv publish --index-url https://test.pypi.org/legacy/
# Publish to PyPI
uv publish
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for:
- Development setup with
uv - Code style guidelines (
ruff,uvx ty) - Testing requirements
- Pull request process
Pre-Commit Checklist
# Run all checks before committing
uvx ty check && \
ruff check . && \
ruff format --check . && \
uv run pytest tests/ -x --tb=short
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
Special thanks to the teams at OpenAI, Anthropic, Google, and other contributors to the AI ecosystem that made this framework possible.
โ ๏ธ Development Status: This is an active consolidation of multiple AI frameworks. While core LM and tracing functionality is production-ready, some environments may have breaking changes.
๐ Recent Updates
- v0.1.9: Consolidated monorepo with LM, environments, and tracing
- Migration: Moved from
synth_ai.zykโsynth_ai.lmwith backward compatibility - Integration: Combined synth-sdk tracing and synth-env environments
- Dependencies: Added optional
[research]extras for heavy game environments
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file synth_ai-0.2.1.dev0.tar.gz.
File metadata
- Download URL: synth_ai-0.2.1.dev0.tar.gz
- Upload date:
- Size: 477.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea1264348c14b0526538afa65259f5cd00099f468cf6774e3f26a5ac39bdacd2
|
|
| MD5 |
f27e1ccf81832c6a0927032721178b11
|
|
| BLAKE2b-256 |
6c6cbe362d169d5a637342b36b1701cbc0ea8d971ed8502c43ba6d75dcda5021
|
File details
Details for the file synth_ai-0.2.1.dev0-py3-none-any.whl.
File metadata
- Download URL: synth_ai-0.2.1.dev0-py3-none-any.whl
- Upload date:
- Size: 592.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4add88c891dae9845377c9bd10d643ad553e1b316c84487cbc41cdcf8b3c9a6
|
|
| MD5 |
ab707d76dd30b6004101c5da9e2c1c76
|
|
| BLAKE2b-256 |
ed753f6046c6bed448fa9b1bfb5ae8189a7efd757d800794fab96970f828c70d
|