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.51.tar.gz (207.6 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.51-py3-none-any.whl (401.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: model_compose-0.4.51.tar.gz
  • Upload date:
  • Size: 207.6 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.51.tar.gz
Algorithm Hash digest
SHA256 23301cc968cc0a80482c3c1f75fd6bc0273c0633bb69c455e13ec52528730a15
MD5 d9573dbde950eaf75f31f85a5e4a0978
BLAKE2b-256 7c7eecbd158461cce9d66653be880ee9deb4ddb78ce1abff4e7bb6002ba5c410

See more details on using hashes here.

File details

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

File metadata

  • Download URL: model_compose-0.4.51-py3-none-any.whl
  • Upload date:
  • Size: 401.6 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.51-py3-none-any.whl
Algorithm Hash digest
SHA256 793e14a98a237b5849fb588ee98aafe40421e7d1e053ddf9a739a6be628f6afa
MD5 b8a2313a74b3146f1bc4754ef6e19352
BLAKE2b-256 0b48b93bc935e0c64c6659b277aabefe0b2ce1ddc37edb878d1c2e4af41c4b0e

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