Skip to content

taichuy/1flowbase

Repository files navigation

1flowbase

1flowbase Logo

English | 简体中文

💬 Community: WeChat | WeChat Official Account | Twitter

Open-source virtual model gateway for local AI agent clients. The first step to harness is to see the Agent's execution path clearly

1flowbase lets you build multi-model workflows, publish them as OpenAI / Claude-compatible model endpoints, and inspect what happened behind each request: model calls, node inputs and outputs, tool callbacks, tokens, latency, failures, and cost.

Use it to:

  • compose multiple models, tools, verifiers, routers, and formatters into one workflow
  • expose that workflow through OpenAI Responses, OpenAI Chat Completions, or Claude-compatible Messages APIs
  • call the workflow from compatible local AI clients and SDKs that support custom model endpoints
  • debug execution node by node instead of only seeing the final answer
  • optimize cost with model cascading, fallback, verification, and formatting steps

LiteLLM routes models.
1flowbase composes models into workflow-backed virtual model endpoints.

Build workflow → Publish endpoint → Call from clients → Inspect trace / tokens / cost → Optimize

Why?

Many AI tools only show the final response. A real AI request may include far more than the visible user message:

user input + system prompt + developer prompt + tool definitions + project context
+ chat history + command outputs + intermediate model calls + verifier / formatter steps

That hidden execution path affects token cost, latency, model behavior, failure rate, output quality, and unit economics.

A short input like hi can still become an expensive request once the surrounding context, tool schemas, history, and workflow steps are attached.

1flowbase helps you see the workflow behind the request, then optimize it with real runtime data instead of guesswork.


What works today

Current focus: workflow-backed virtual model endpoints and execution visibility inside 1flowbase workflows.

Implemented:

  • visual workflow editor
  • multi-node workflow orchestration
  • virtual model endpoint publishing
  • OpenAI Responses API support
  • OpenAI Chat Completions API support
  • Claude-compatible Messages API support
  • streaming response support
  • basic execution logs
  • tool callback traces inside 1flowbase workflows
  • application-level token statistics
  • prompt and model configuration version history

In progress:

  • deeper local agent conversation collection
  • session search and playback
  • Token Bill of Materials: system prompts, tool definitions, history, command outputs, and node-level sources
  • abnormal cost detection
  • Recall Pack export
  • more Claude Code / Codex / aionui templates
  • MCP-aware plugin nodes and tool-call source attribution

Note: 1flowbase is not currently positioned as an MCP server or MCP gateway. MCP-aware capabilities are on the roadmap. The current product focuses on publishing compatible model endpoints and tracing 1flowbase workflow execution.


How it works

1. Build a workflow

Vision Model → Small Model → Strong Reasoning Model → Verifier → Formatter

2. Publish it as a model endpoint

/v1/responses
/v1/chat/completions
/v1/messages

3. Call it from existing clients

To the client, it looks like a normal model. To you, it is an observable and tunable workflow.

4. Inspect the execution

Request
  → workflow node inputs
  → model calls
  → tool callbacks
  → node outputs
  → token usage / latency / errors
  → final response

5. Optimize and reuse

Compress prompts, split long context, move simple steps to cheaper models, add verifiers / formatters, add fallback strategies, then publish the optimized workflow as a reusable virtual model.


Quick Start

One-click Docker deployment

The script checks whether Docker / Compose is available, pulls the docker/ directory, and copies docker/.env.example to docker/.env.

curl -fsSL https://raw.githubusercontent.com/taichuy/1flowbase/main/scripts/shell/docker-deploy.sh | sh

PowerShell:

irm https://raw.githubusercontent.com/taichuy/1flowbase/main/scripts/powershell/docker-deploy.ps1 | iex

Windows CMD:

powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/taichuy/1flowbase/main/scripts/powershell/docker-deploy.ps1 | iex"

Run from source

Requirements: Node.js >= 24.0.0, latest stable Rust, and Docker for local middleware.

git clone https://github.com/taichuy/1flowbase.git
cd 1flowbase

docker compose -f docker/docker-compose.middleware.yaml up -d

cd web
pnpm install
pnpm dev

Frontend:

http://127.0.0.1:3100

Start backend services:

cd api
# Copy api/apps/api-server/.env.example to .env before the first run.
cargo run -p api-server --bin api-server
cargo run -p plugin-runner --bin plugin-runner

Default backend endpoints:

API Server: http://127.0.0.1:7800
Plugin Runner: http://127.0.0.1:7801

Script-assisted startup:

node scripts/node/dev-up.js
node scripts/node/dev-up.js status
node scripts/node/dev-up.js stop
node scripts/node/dev-up.js restart

See scripts/README.md for more options.


Feature preview

Build multi-model workflows

Create workflows with multiple models, tools, verifiers, and formatter nodes.

Workflow Editor Preview

Publish as OpenAI-compatible API

Publish OpenAI API

Publish as Claude-compatible Messages API

Publish Claude API

Customize exposed model information

Custom Model Settings

Use in compatible local AI clients

Call a published workflow from compatible clients that support custom model endpoints.

Claude Code Terminal Usage

View execution logs

Inspect model requests, node inputs and outputs, tool callbacks, response content, latency, and errors.

Detailed Execution Logs

View tool callback traces

Tool Callback Trace Logs

Track token consumption

Token Consumption Dashboard


Protocol compatibility

Protocol API path Typical usage
OpenAI Responses API /v1/responses newer OpenAI-style clients and application code
OpenAI Chat Completions API /v1/chat/completions SDKs, coding tools, chat clients, application frameworks
Claude-compatible Messages API /v1/messages Claude-compatible clients that support custom endpoints

Build one workflow, then expose it through multiple protocols.


Typical use cases

Add vision or OCR before a text model

Image / screenshot / PDF → Vision or OCR node → structured text context → strong text model → verifier → final answer

Control cost with model cascading

Simple classification → small model
Formatting → small model
Complex reasoning → strong model
Final verification → verifier node

Guarantee output structure

Use verifiers, JSON schema validation, and formatter nodes before returning the final result. This is useful for JSON outputs, API responses, tool call parameters, code patches, document generation, and automated task results.

Build a programmable upstream model for coding agents

Code generation → test / lint check → reviewer node → fix node → final patch

Existing clients call one model name, while 1flowbase runs the workflow behind it.

Debug workflow execution

Use execution logs and traces to answer which node failed, which model call was slow, which step used the most tokens, which tool callback returned unexpected output, and which verifier or formatter changed the final response.


How 1flowbase differs

1flowbase is not just a model proxy and not just a generic workflow canvas.

It focuses on one gap:

Build a multi-model workflow, publish it as a standard model endpoint, and inspect the execution behind it.

Tool category What it usually does How 1flowbase is different
Model router / LLM gateway routes one request to one provider or model composes multiple model and tool nodes into one workflow-backed virtual model
AI workflow builder builds an AI app or workflow exposes the workflow as OpenAI / Claude-compatible model APIs
Agent framework helps developers code agent graphs provides a visual runtime, protocol publishing, and execution logs
Cost tracker shows token or spend totals connects cost to workflow nodes, model calls, and execution traces
Model routers choose a model.
1flowbase builds a new virtual model from a workflow.

Transparency and security

1flowbase is designed for transparent, self-hosted AI workflow execution.

Recommended principles:

  • self-hosted first
  • transparent model chains
  • auditable node calls
  • traceable token usage
  • configurable log retention
  • sensitive data masking
  • explicit model and workflow configuration

1flowbase does not advocate stealthy model replacement. Published endpoints should be configured intentionally, observed clearly, and governed by the project owner.


Roadmap

Implemented

  • visual workflow editor
  • multiple built-in node types
  • virtual model endpoint publishing
  • OpenAI Responses protocol support
  • OpenAI Chat Completions protocol support
  • Claude-compatible Messages protocol support
  • streaming response support
  • basic execution logs
  • tool callback traces inside 1flowbase workflows
  • application-level token consumption statistics
  • prompt and model configuration version history

Enhancing

  • enhanced local agent conversation collection
  • Token Bill of Materials by prompt, history, tool definitions, command outputs, and nodes
  • agent session search and playback
  • session export and Recall Pack generation
  • abnormal cost detection and optimization suggestions
  • more Claude Code / Codex / aionui usage templates
  • MCP-aware plugin nodes and tool-call source attribution

Planned

  • low-code application building platform for AI organizations
  • team workspace and multi-tenant management
  • permissions, approval, audit, and cost governance
  • support for more local AI agent clients
  • template market and workflow recipe ecosystem

Repo layout

web/          Frontend root, powered by pnpm + Turbo
api/          Rust backend workspace
api/apps/     Backend service entry points
api/crates/   Shared backend crates
api/plugins/  Plugin workspace, HostExtension manifests, and templates
docker/       Local middleware orchestration
scripts/      Development, testing, verification, and debugging scripts

Contributing

Contributions are welcome. Before submitting a pull request, run:

node scripts/node/verify.js repo

Project guidelines:


Friend Links

Linux.do — Learn AI, on L Station.
Aionui — Remotely control AI to work via mobile phone, a lifesaver for token-dependent patients.
OfficeCLI — Office suite designed for AI agents.
deepseek-pp — DeepSeek web chat browser extension.
MuseAI — Local AI companion, text adventure, and story immersion app.
FrontAgent — AI Agent system designed specifically for front-end engineering.
RedBox — Localized AI creative workbench for Xiaohongshu creators.


License

This project is licensed under Apache-2.0.


Contributors

Contributors


Star History

Star History


If you want to build workflow-backed virtual models and see what happened behind each request, give 1flowbase a star.

Report Bug · Request Feature

About

Open-source virtual model gateway: publish multi-model workflows as OpenAI/Claude-compatible endpoints with trace, token, latency, and cost visibility.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors