Skip to main content

Dan's Simple Agent Toolkit - Multi-provider LLM agents and experiment tracking

Project description

Dan's Simple Agent Toolkit (DSAT)

DSAT is a comprehensive Python toolkit for building LLM applications and running experiments. It provides three core components that work independently or together:

๐Ÿ’ฌ Chat CLI

An interactive terminal-based chat interface for testing prompts and having conversations with LLM agents.

Key Features:

  • Zero-config mode: Auto-detects providers via environment variables
  • Multiple usage patterns: Config files, inline creation, or auto-discovery
  • Interactive commands: /help, /agents, /switch, /export, and more
  • Flexible prompts: Multiple directory search strategies and per-agent overrides
  • Plugin system: Entry points for custom LLM provider extensions
  • Session management: History tracking and conversation export

Quick Start:

# Zero-config (with API key in environment)
dsat chat

# Use existing agent configuration
dsat chat --config agents.json --agent my_assistant

# Create agent inline
dsat chat --provider anthropic --model claude-3-5-haiku-latest

๐Ÿค– Agents Framework

A unified interface for working with multiple LLM providers through configuration-driven agents.

Key Features:

  • Multi-provider support: Anthropic Claude, Google Vertex AI, Ollama (local models)
  • Configuration-driven: JSON configs + TOML prompt templates
  • Comprehensive logging: Standard Python logging, JSONL files, or custom callbacks
  • Prompt versioning: Versioned prompt management with TOML templates
  • Factory patterns: Easy agent creation and management

Quick Example:

from agents.agent import Agent, AgentConfig

config = AgentConfig(
    agent_name="my_assistant",
    model_provider="anthropic",  # or "google", "ollama"
    model_family="claude", 
    model_version="claude-3-5-haiku-latest",
    prompt="assistant:v1",
    provider_auth={"api_key": "your-api-key"}
)

agent = Agent.create(config)
response = agent.invoke("Hello, how are you?")

๐Ÿ“Š Scryptorum Framework

A modern, annotation-driven framework for running and tracking LLM experiments.

Key Features:

  • Dual run types: Trial runs (logs only) vs Milestone runs (full versioning)
  • Annotation-driven: @experiment, @metric, @timer, @llm_call decorators
  • CLI-configurable: Same code runs as trial or milestone based on CLI flags
  • Thread-safe logging: JSONL format for metrics, timings, and LLM calls
  • Project integration: Seamlessly integrates with existing Python projects

Quick Example:

from scryptorum import experiment, metric, timer

@experiment(name="sentiment_analysis")
def main():
    reviews = load_reviews()
    results = []
    
    for review in reviews:
        sentiment = analyze_sentiment(review)
        results.append(sentiment)
    
    accuracy = calculate_accuracy(results)
    return accuracy

@timer("data_loading")
def load_reviews():
    return ["Great product!", "Terrible service", "Love it!"]

@metric(name="accuracy", metric_type="accuracy")
def calculate_accuracy(results):
    return 0.85

๐Ÿ”ง Framework Integration

When used together, DSAT provides AgentExperiment and AgentRun classes that extend Scryptorum's base classes with agent-specific capabilities:

from agents.agent_experiment import AgentExperiment
from scryptorum import metric

@experiment(name="agent_evaluation")
def evaluate_agents():
    # Load agents from configs
    agent1 = Agent.create(config1)
    agent2 = Agent.create(config2)
    
    # Run evaluation with automatic LLM call logging
    score1 = evaluate_agent(agent1)
    score2 = evaluate_agent(agent2) 
    
    return {"agent1": score1, "agent2": score2}

๐Ÿš€ Quick Start

Installation

# Basic installation
git clone <repository-url>
cd dsat
uv sync

# With optional dependencies
uv sync --extra dev      # Development tools
uv sync --extra server   # HTTP server support

Initialize a Project

# Initialize scryptorum in your Python project
scryptorum init

# Create your first experiment
scryptorum create-experiment my_experiment

Run Examples

# Interactive chat interface
dsat chat --config examples/config/agents.json --agent pirate

# Agent conversation demo
python examples/agents/conversation.py

# Agent logging examples  
python examples/agents/agent_logging_examples.py

# Complete experiment with agent evaluation
python examples/scryptorum/literary_evaluation.py

๐Ÿ“ Examples

The examples/ directory contains comprehensive demonstrations:

๐Ÿ—๏ธ Architecture

your_project/                    โ† Your Python Package
โ”œโ”€โ”€ src/your_package/
โ”‚   โ”œโ”€โ”€ experiments/             โ† Your experiment code
โ”‚   โ””โ”€โ”€ agents/                  โ† Your agent code  
โ”œโ”€โ”€ .scryptorum                  โ† Scryptorum config
โ””โ”€โ”€ pyproject.toml              โ† Dependencies

~/experiments/                   โ† Scryptorum Project (separate location)
โ”œโ”€โ”€ your_package/               โ† Project tracking
โ”‚   โ”œโ”€โ”€ experiments/            โ† Experiment data & results
โ”‚   โ”‚   โ””โ”€โ”€ my_experiment/
โ”‚   โ”‚       โ”œโ”€โ”€ runs/           โ† Trial & milestone runs
โ”‚   โ”‚       โ”œโ”€โ”€ config/         โ† Agent configs
โ”‚   โ”‚       โ””โ”€โ”€ prompts/        โ† Prompt templates
โ”‚   โ””โ”€โ”€ data/                   โ† Shared data

๐Ÿ“– Documentation

๐Ÿ› ๏ธ Development

# Install development dependencies
uv sync --extra dev

# Run tests
python -m pytest test/ -v

# Format code
black src/

# Lint code  
ruff check src/

๐Ÿ“„ License

MIT License - see LICENSE file for details.


DSAT simplifies LLM application development by providing unified agent abstractions and comprehensive experiment tracking with minimal boilerplate.

Project details


Download files

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

Source Distribution

dsat_ai-0.2.0.tar.gz (183.5 kB view details)

Uploaded Source

Built Distribution

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

dsat_ai-0.2.0-py3-none-any.whl (52.5 kB view details)

Uploaded Python 3

File details

Details for the file dsat_ai-0.2.0.tar.gz.

File metadata

  • Download URL: dsat_ai-0.2.0.tar.gz
  • Upload date:
  • Size: 183.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dsat_ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1bf604c3c768b89c10fa3b2ec0efa046f8a2ad1eefd92ab669cb76c34b1a81a3
MD5 a411231d4b7981587439670a1db1646b
BLAKE2b-256 b6a0a9561189cbe065e453992dc4d8bf287af68e5e6c11ca9a663c8ba29bcf85

See more details on using hashes here.

File details

Details for the file dsat_ai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dsat_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 52.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dsat_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89806afaafac2074cb2d806f3a1082dd82d75e4ead900e7e7c3205a204630889
MD5 e165084c96a0a07b71b1f057bd91ae27
BLAKE2b-256 363b6522a779339a648771a780f7e3fe7f6ed131961dd3eb59185227ae8d9e4d

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