Flint — spark your agent workflows. Queue-driven AI agent orchestration SDK.
Project description
🔥 Flint
Fault-tolerant AI agent orchestration.
Build → Queue → Retry → Observe.
20 Lines. Full Pipeline.
from flint_ai import Workflow, Node
from flint_ai.adapters.openai import FlintOpenAIAgent
agent = FlintOpenAIAgent(name="writer", model="gpt-4o-mini")
results = (
Workflow("pipeline")
.add(Node("research", agent=agent, prompt="AI trends 2025"))
.add(Node("write", agent=agent, prompt="{research}").depends_on("research"))
.run()
)
Agent calls OpenAI → task queued → retries on failure → dead-letter if broken → costs tracked → dashboard at localhost:5160/ui/.
All of that, zero setup.
Why Flint
| If you need | Flint gives you |
|---|---|
| Agent fails | Auto-retry with backoff |
| Keeps failing | Dead Letter Queue — inspect & retry from dashboard |
| Human must approve | Approval gates pause the DAG |
| Crash mid-execution | DB heartbeat → auto-recovery on restart |
| See what's happening | Live dashboard: costs, traces, DAG view |
| API keys stay yours | Server orchestrates, agents run on your PC |
Two Modes, Same Code
Global Engine — Start Once, Run Many
from flint_ai import configure_engine, shutdown_engine, Workflow, Node
configure_engine(agents=[agent]) # background worker pool
Workflow("task-1").add(Node("s", agent, prompt="...")).run()
Workflow("task-2").add(Node("s", agent, prompt="...")).run()
shutdown_engine()
Server + Worker — Distributed
# Terminal 1
docker compose up -d
# Terminal 2 — agents run HERE
worker = FlintWorker(server_url="http://localhost:5156")
worker.register("writer", agent)
Workflow("task").add(Node("s", agent, prompt="...")).run(server_url="http://localhost:5156")
Install
pip install flint-ai
Cost Tracking — Built In
No boilerplate. Cost is auto-tracked per model, per task, per workflow.
agent = FlintOpenAIAgent(name="writer", model="gpt-4o-mini")
# that's it — cost tracked automatically
View costs at localhost:5160/ui/costs:
- Cost by model · timeline · per-task breakdown
- Per-tool-call costs · cumulative workflow cost
- Click any task → full token & cost breakdown
Pricing comes from database. Override per agent if needed:
agent = FlintOpenAIAgent(name="writer", model="gpt-4o-mini",
cost_config_override={"prompt": 3.0, "completion": 12.0})
Quickstart
| Example | What |
|---|---|
01_embedded_enqueue.py |
Start once, enqueue many |
02_embedded_run_once.py |
Run single workflow |
03_sequential_pipeline.py |
A → B → C |
04_fanout_fanin.py |
A → (B, C) → D |
05_approval_gate.py |
Pause for human approval |
06_server_enqueue.py |
Connect to server, enqueue |
07_server_run_once.py |
Connect, run, disconnect |
python examples/quickstart/01_embedded_enqueue.py
Dashboard
When running (embedded or server):
| Page | What |
|---|---|
/ui/ |
Overview — queue lengths, recent runs |
/ui/costs |
Cost by model, timeline, per-task breakdown |
/ui/tools |
Tool execution tree, errors with traces |
/ui/runs |
Workflow runs with DAG visualization |
/docs |
Swagger API |
Crash Recovery
| What crashes | What happens |
|---|---|
| Worker mid-task | DB heartbeat stops → stale task detected → auto-requeued |
| Server | Agents auto-reconstruct from DB, failed tasks re-queued |
| Both | All non-terminal tasks restored on startup |
Tasks survive any crash. No data loss with PostgreSQL + Redis.
Build Your Own Agent
from flint_ai import FlintAdapter, AgentRunResult
class MyAgent(FlintAdapter):
name = "my-agent"
async def run(self, input_data: dict) -> AgentRunResult:
result = await call_my_llm(input_data["prompt"])
return AgentRunResult(output=result)
Register it and it just works — retry, DLQ, cost tracking, dashboard.
License
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
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 flint_ai-0.2.4.tar.gz.
File metadata
- Download URL: flint_ai-0.2.4.tar.gz
- Upload date:
- Size: 348.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a72801f8a32b8e8be8a0a57c28466a8c82b4fb5537d7e3a7d21807e9185d098
|
|
| MD5 |
7b2c0804fd1daf52dc875d6d37666bd1
|
|
| BLAKE2b-256 |
d2ed3a889538c2ceec5b347b445608cff204f6dd5214b4267ae5bbfc60683a18
|
File details
Details for the file flint_ai-0.2.4-py3-none-any.whl.
File metadata
- Download URL: flint_ai-0.2.4-py3-none-any.whl
- Upload date:
- Size: 250.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a91f884498e7c2b4955d83166df15fd555881e81b0160a6bfbc1af55ec94621
|
|
| MD5 |
8cc606ee3751ec1c90ea02537048944d
|
|
| BLAKE2b-256 |
f2798e3a082e3ab59aeb145441c9a9962ca7f9583cda6d77651826015bae0aac
|