Skip to main content

The Generative AI Pipeline DSL - Compose, evaluate, and deploy LLM pipelines with confidence

Project description

SynthLang ๐Ÿš€

License VS Code Extension GitHub Stars Discord

The Generative AI Pipeline DSL - Compose, evaluate, and deploy LLM pipelines with confidence.

pipeline CustomerSupport {
    // Multi-model routing with A/B testing
    router intent_classifier {
        strategy: ab_split(0.5)
        routes: [
            {name: "gpt4", target: gpt4_model},
            {name: "claude", target: claude_model}
        ]
    }
    
    // Built-in safety & compliance
    guardrail safety {
        toxicity_threshold: 0.1
        pii_detection: true
        bias_check: ["gender", "race"]
    }
    
    // Smart caching & evaluation
    cache responses {
        ttl: 3600
        strategy: semantic_similarity(0.95)
    }
}

๐ŸŽฏ Why SynthLang?

  • ๐Ÿ”„ Multi-Model Orchestration: Route between models, A/B test, and optimize costs automatically
  • ๐Ÿ›ก๏ธ Built-in Safety: Toxicity detection, bias testing, and PII protection out of the box
  • ๐Ÿ“Š Comprehensive Evaluation: Dataset versioning, statistical testing, and performance metrics
  • โšก Production Ready: Caching, rate limiting, and monitoring built into the language
  • ๐ŸŽจ Developer Experience: VS Code extension with IntelliSense, debugging, and live metrics

๐Ÿš€ Quick Start

Install the VS Code Extension (Free)

  1. Open VS Code
  2. Search for "SynthLang" in Extensions
  3. Click Install

Install the CLI

# NPM
npm install -g synthlang

# Or using Cargo
cargo install synthlang

# Or download binary
curl -sSL https://get.synthlang.ai | sh

Your First Pipeline

Create hello.synth:

pipeline HelloWorld {
    prompt greeting {
        template: """
        Generate a friendly greeting for {{name}}.
        Make it warm and welcoming!
        """
    }
    
    model gpt {
        provider: "openai"
        model: "gpt-3.5-turbo"
        temperature: 0.7
    }
    
    edges: [
        input -> greeting -> gpt -> output
    ]
}

// Run with: synth run hello.synth --input '{"name": "Alice"}'

๐Ÿ“ฆ Features

Free Tier

  • โœ… VS Code Extension with syntax highlighting
  • โœ… Local pipeline execution
  • โœ… Basic evaluation metrics
  • โœ… Community support

Pro Tier ($49/mo)

  • โœ… Everything in Free
  • โœ… Advanced caching strategies
  • โœ… A/B testing & routing
  • โœ… Bias & toxicity detection
  • โœ… Dataset versioning
  • โœ… Priority support

Team Tier ($199/mo)

  • โœ… Everything in Pro
  • โœ… Team collaboration
  • โœ… Audit trails
  • โœ… Custom guardrails
  • โœ… SLA guarantees
  • โœ… Dedicated support

Enterprise (Custom)

  • โœ… Everything in Team
  • โœ… On-premise deployment
  • โœ… Custom integrations
  • โœ… Compliance reporting
  • โœ… 24/7 support

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           SynthLang Pipeline            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  DSL Parser โ†’ Graph Builder โ†’ Executor  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Safety Layer (Toxicity, Bias, PII)     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Caching & Optimization Layer           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Model Providers (OpenAI, Anthropic...) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“Š Evaluation & Testing

eval CustomerSupportQuality {
    dataset: "support_test_v1"  // Versioned dataset
    
    metrics: {
        accuracy: true,
        toxicity: true,
        bias: true,
        latency_p95: 2000  // ms
    }
    
    comparison: {
        baseline: "gpt-3.5",
        candidates: ["CustomerSupport"],
        significance: 0.95
    }
}

๐Ÿ›ก๏ธ Safety First

Every pipeline automatically includes:

  • Toxicity Detection: Perspective API integration
  • Bias Testing: Multi-dimensional bias detection
  • PII Protection: Automatic redaction
  • Adversarial Testing: Jailbreak prevention
  • Audit Logging: Complete traceability

๐Ÿ”ง Advanced Features

Multi-Stage Pipelines

pipeline MultiStage {
    // Stage 1: Classification
    model classifier { ... }
    
    // Stage 2: Specialized routing
    router by_intent {
        strategy: conditional
        routes: [
            {condition: "intent == 'technical'", target: tech_expert},
            {condition: "intent == 'billing'", target: billing_expert}
        ]
    }
}

Dataset Versioning

dataset CustomerQueries {
    version: "2.1.0"
    parent: "CustomerQueries@2.0.0"
    
    transformations: [
        {type: "filter", condition: "quality_score > 0.8"},
        {type: "augment", method: "paraphrase"}
    ]
}

A/B Testing

router experiment {
    strategy: ab_split(0.5)
    
    metrics: [
        "response_quality",
        "latency",
        "cost"
    ]
    
    auto_optimize: true  // Automatically shift traffic
}

๐Ÿ“ˆ Metrics & Monitoring

Real-time metrics dashboard in VS Code:

  • Request volume & latency
  • Cost tracking
  • Cache hit rates
  • Error rates
  • A/B test results

๐Ÿค Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

# Clone the repo
git clone https://github.com/synth-lang/synth
cd synth

# Install dependencies
cargo build --release

# Run tests
cargo test

# Run examples
synth run examples/

๐Ÿ“š Documentation

๐Ÿ—บ๏ธ Roadmap

Phase 0 (Current) - Free Extension

  • โœ… VS Code extension
  • โœ… Basic pipeline runner
  • โœ… Evaluation harness

Phase 1 (Q1 2024) - Pro Launch

  • ๐Ÿ”„ Cloud execution
  • ๐Ÿ”„ Advanced caching
  • ๐Ÿ”„ Team features

Phase 2 (Q2 2024) - Enterprise

  • ๐Ÿ“‹ Fine-tuning management
  • ๐Ÿ“‹ Compliance suite
  • ๐Ÿ“‹ Custom deployments

Phase 3 (Q3 2024) - Platform

  • ๐Ÿ“‹ Model marketplace
  • ๐Ÿ“‹ Component library
  • ๐Ÿ“‹ Community hub

๐Ÿ’ฌ Community

๐Ÿ“„ License

Licensed under Apache 2.0. See LICENSE for details.

๐Ÿ™ Acknowledgments

Built with โค๏ธ by the SynthLang team.

Special thanks to our contributors and early adopters!


Ready to build safer, more reliable AI pipelines?

Get Started โ†’ | View Examples โ†’ | Join Discord โ†’

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

synthlang_mbc-1.0.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

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

synthlang_mbc-1.0.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file synthlang_mbc-1.0.0.tar.gz.

File metadata

  • Download URL: synthlang_mbc-1.0.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for synthlang_mbc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ebfe89c871ed9599c047659a9d611eb4d1764ebbf2f50acc1460689b24f4d379
MD5 a1a8dc8457abfcc608f7e61eef39b25c
BLAKE2b-256 b2465f66facd60daf101620891437193bd78a4081949b0de27de6791475557e9

See more details on using hashes here.

File details

Details for the file synthlang_mbc-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: synthlang_mbc-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for synthlang_mbc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58cc67ac368275b72c5fddada6950feab4c2586d0cc5b80fb43cb6213d1f02c6
MD5 25c433b3055ec010f8f425d5654c8534
BLAKE2b-256 5c4667323209dfe6a1affc1e65a5b6f8519c822ce50ac06cdfc628fc847ac035

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