The Generative AI Pipeline DSL - Compose, evaluate, and deploy LLM pipelines with confidence
Project description
SynthLang ๐
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)
- Open VS Code
- Search for "SynthLang" in Extensions
- 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
- Discord - Join our community
- Twitter - Follow for updates
- GitHub Discussions - Ask questions
๐ 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?
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebfe89c871ed9599c047659a9d611eb4d1764ebbf2f50acc1460689b24f4d379
|
|
| MD5 |
a1a8dc8457abfcc608f7e61eef39b25c
|
|
| BLAKE2b-256 |
b2465f66facd60daf101620891437193bd78a4081949b0de27de6791475557e9
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58cc67ac368275b72c5fddada6950feab4c2586d0cc5b80fb43cb6213d1f02c6
|
|
| MD5 |
25c433b3055ec010f8f425d5654c8534
|
|
| BLAKE2b-256 |
5c4667323209dfe6a1affc1e65a5b6f8519c822ce50ac06cdfc628fc847ac035
|