Skip to main content

model-compose: Declarative AI Workflow Orchestrator

Project description


🤖 Model-Compose

model-compose is a declarative AI workflow orchestrator inspired by docker-compose. It lets you define and run AI model pipelines using simple YAML files — no custom code required. Effortlessly connect external AI services (OpenAI, Anthropic, Google, etc.), run local AI models, integrate vector stores, and more — all within powerful, composable workflows.

No custom code. Just YAML configuration.


✨ Features

🎨 No-Code AI Orchestration

Define complex AI workflows entirely in YAML—no Python, no JavaScript, no coding required. Connect multiple AI services, models, and APIs through simple declarative configuration.

🔗 Universal AI Service Integration

Connect to any AI provider out of the box—OpenAI, Anthropic Claude, Google Gemini, ElevenLabs, Stability AI, Replicate, or any custom HTTP API. Mix and match services in a single workflow.

🤖 Agent Components

Build autonomous AI agents that use workflows as tools. Agents can reason, plan, and execute multi-step tasks by dynamically invoking other workflows—all defined declaratively in YAML.

Human-in-the-Loop

Add approval gates and user input steps to any workflow with interrupt configuration. Workflows pause, prompt for human input via CLI, Web UI, or API, and resume seamlessly—perfect for review, moderation, and supervised AI pipelines.

🖥️ Local Model Execution

Run models from HuggingFace and other sources locally with native support for transformers, PyTorch, and model serving frameworks. Fine-tune models with LoRA/PEFT, train with custom datasets, all through YAML configuration.

Real-Time Streaming

Built-in SSE (Server-Sent Events) streaming for real-time AI responses. Stream from OpenAI, Claude, local models, or any streaming API with automatic chunking and connection management.

🔄 Advanced Workflow Composition

Build multi-step pipelines with conditional logic, data transformation, and parallel execution. Pass data between jobs with powerful variable binding—${input}, ${response}, ${env}, with type conversion and defaults.

🚀 Production-Ready Deployment

Deploy as HTTP REST API or MCP (Model Context Protocol) server by changing one line. Includes concurrency control, health checks, and automatic API documentation.

📡 Distributed Workflow Execution

Scale AI workloads across multiple machines using Redis-backed queue dispatch. Dispatcher instances route workflow requests to remote subscribers—no shared filesystem or code changes needed. Add workers to scale horizontally.

🎯 Event-Driven Architecture

HTTP Callback listeners for async workflows (image generation, video processing). HTTP Trigger listeners for webhooks and external events. Build reactive AI systems that respond to real-world events.

🌐 Smart Tunneling & Gateways

Expose local services to the internet instantly with ngrok, Cloudflare, or SSH tunnels. Perfect for webhook integration and public API deployment without complex networking.

🐳 Container-Native Deployment

First-class Docker support with runtime configuration, volume mounting, and environment management. Deploy to any cloud provider or Kubernetes cluster with minimal configuration.

🎨 Instant Web UI

Add a visual interface with just 2 lines—get Gradio-powered chat UI or serve custom static frontends. Test workflows, monitor executions, and debug pipelines visually.

🗄️ RAG & Vector Database Ready

Native integration with ChromaDB, Milvus, Pinecone, and Weaviate. Build retrieval-augmented generation (RAG) systems with embedding search, document indexing, and semantic retrieval.

🔧 Flexible Component System

Reusable components with multi-action support. Define once, use everywhere. Mix HTTP clients, local models, vector stores, shell commands, and custom workflows in any combination.


📦 Installation

pip install model-compose

Or install from source:

git clone https://github.com/hanyeol/model-compose.git
cd model-compose
pip install -e .

Requires: Python 3.10 or higher


🚀 Quick Start

Create a model-compose.yml:

controller:
  type: http-server
  port: 8080
  webui:
    port: 8081

workflows:
  - id: chat
    default: true
    jobs:
      - component: chatgpt

components:
  - id: chatgpt
    type: http-client
    base_url: https://api.openai.com/v1
    path: /chat/completions
    method: POST
    headers:
      Authorization: Bearer ${env.OPENAI_API_KEY}
    body:
      model: gpt-4o
      messages:
        - role: user
          content: ${input.prompt}

Create a .env file:

OPENAI_API_KEY=your-key

Run it:

model-compose up

Your API is now live at http://localhost:8080 and Web UI at http://localhost:8081 🎉


🎯 Powerful Yet Simple

🖥️ Add Web UI with 2 Lines

controller:
  webui:
    port: 8081

🛰️ Switch to MCP Server with 1 Line

controller:
  type: mcp-server

🔄 Run Components in Separate Processes

component:
  runtime: process

🐳 Deploy in Docker with 1 Line

controller:
  runtime: docker

💡 Explore examples for more workflows or read the User Guide.


🏗 Architecture

Archtecture Diagram


🤝 Contributing

We welcome all contributions! Whether it's fixing bugs, improving docs, or adding examples — every bit helps.

# Setup for development
git clone https://github.com/hanyeol/model-compose.git
cd model-compose
pip install -e .[dev]

📄 License

MIT License © 2025-2026 Hanyeol Cho.


📬 Contact

Have questions, ideas, or feedback? Open an issue or start a discussion on GitHub Discussions.

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

model_compose-0.4.45.tar.gz (197.0 kB view details)

Uploaded Source

Built Distribution

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

model_compose-0.4.45-py3-none-any.whl (379.1 kB view details)

Uploaded Python 3

File details

Details for the file model_compose-0.4.45.tar.gz.

File metadata

  • Download URL: model_compose-0.4.45.tar.gz
  • Upload date:
  • Size: 197.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for model_compose-0.4.45.tar.gz
Algorithm Hash digest
SHA256 2d97d58dc07b57900748555613f68af5c8c7cf726e68be59d1a86302636485ef
MD5 59fb65920d7968b1a80c7ed45e087d73
BLAKE2b-256 cdc78c4ec0b0611c837072b31a051372991102cf81a09f2e67a7db62314486f7

See more details on using hashes here.

File details

Details for the file model_compose-0.4.45-py3-none-any.whl.

File metadata

  • Download URL: model_compose-0.4.45-py3-none-any.whl
  • Upload date:
  • Size: 379.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for model_compose-0.4.45-py3-none-any.whl
Algorithm Hash digest
SHA256 91fc93e32914a3384a93c17dda779e4b080c843685c33d2f9eb4c60ae9008ae6
MD5 b7e6298cb4211703281037fa2137a4fe
BLAKE2b-256 c6b955178bed836a9fb5b3d1d38349e654354fc262bba99d4d7e7c2d443615fc

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