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

polythlang_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.

polythlang_mbc-1.0.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polythlang_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 polythlang_mbc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 27b17f172509f9afd54863344879e271d22d45fe02261e64da6ce50ac18a9c7b
MD5 06abb7d401fd8c19523a71af1220cbfb
BLAKE2b-256 319d7087f5f4c31819e69d6a59660f00c02e16065244232c1bb1212438ca2ced

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for polythlang_mbc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37442b05d85b2853055d83ca054270ee27c07e280a4469055524e38283e3d9fb
MD5 5538457d906d1de4a81c553d6e0fab55
BLAKE2b-256 4b9c973099c96da60f095e22f9445c115018af7a2adfbfd82c3f1a8baf3ca594

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