mofa-org /mofa
Enterprise-grade LLM infrastructure: agent runtime → token metering & audit → credits → billing → recharge. Rust microkernel with dual-layer plugins — modular, compositional, programmable agents.
★ 303⑂ 175👁 14⑃ 1,032● 672▤ 31
+0
日增长
+4
周增长
303
stars
175
forks
14
watchers
1,032
prs
672
issues
31
releases
README
MoFA Agent Framework
English | 简体中文
Website
|
Quick Start
|
GitHub
|
Hackathon
|
Community
📋 Table of Contents
- Overview
- Enterprise-Grade LLM Infrastructure
- Why MoFA?
- Core Architecture
- Core Features
- Quick Start
- Roadmap
- Ecosystem & Related Repos
- Documentation
- Security
- Contributing
- Community
- License
Overview
MoFA (Modular Framework for Agents) is enterprise-grade LLM infrastructure.
Enterprises use MoFA to deliver agent capabilities for business AI integration, while MoFA runs the complete chain underneath: agent runtime → token metering & audit → credits → billing → recharge — not just another agent framework, and not a token relay.
It is also the first production-grade framework to achieve "write once, run everywhere" across languages, built for extreme performance, boundless extensibility, and runtime programmability.
Through its revolutionary microkernel architecture and innovative dual-layer plugin system (compile-time + runtime), MoFA strikes the elusive balance between raw performance and dynamic flexibility.
What Sets MoFA Apart:
✅ Enterprise LLM Infrastructure: The complete chain — agents, token audit, credits, billing & recharge
✅ Rust Core + UniFFI: Blazing performance with native multi-language interoperability
✅ Dual-Layer Plugins: Zero-cost compile-time extensions meet hot-swappable runtime scripts
✅ Microkernel Architecture: Clean separation of concerns, effortless to extend
✅ Cloud-Native by Design: First-class support for distributed deployments
Enterprise-Grade LLM Infrastructure
MoFA targets enterprises that deliver agent capabilities to their own users — business AI integration as a product.
Rather than stitching together an agent framework, a metering layer, a billing system, and a payment provider, an enterprise runs MoFA as the single piece of infrastructure that owns the whole chain:
mermaid
flowchart LR
U["End Users"] --|requests| A["Agent Runtimeagents · workflows · tools"]
A --|every LLM call| M["Token Metering & Auditper user / per tenant"]
M -- P["Platform Pricingtoken price configured in DB"]
P -- C["Credits & Balanceconversion + real-time deduction"]
C -- B["Plans & Billing"]
R["Recharge & Payment"] -- U
B -.-|top-up| R
Already in the codebase:
- Per-call token accounting persisted to PostgreSQL / MySQL / SQLite, with user_id / tenant_id attribution and full cost breakdown
- Model pricing registry (per-model token prices) with a cost summary dashboard (/costs/summary)
- Session / daily budget enforcement and quota control on every LLM call
- Prometheus token metrics and an OpenAI-compatible gateway API
Planned in the Enterprise Track: durable per-tenant ledgers, credits balances, plans & invoicing, and recharge channels.
MoFA vs Token Relay Stations
A token relay station resells upstream API quotas. MoFA is the infrastructure Top issues
#463feat: Implement async runtime abstraction layer11 comments · 2026-02-25#1269docs: Missing documentation for mofa-monitoring crate9 comments · 2026-03-15#1235Enable Persistent Memory Layer for MoFA Agents9 comments · 2026-03-14#872[ GSoC Task-12 ] Control Plane + Gateway — Phase 1: Foundation (Feature Flag + Module Skeleton)9 comments · 2026-03-05#1638fix(workflow-dsl): align registry-agent validation with runtime agent registry in build path6 comments · 2026-04-17#1295chore: Fix `clippy::collapsible_if` warnings in Gemini SSE parser6 comments · 2026-03-16#839Implement Agent Testing Framework (Unit & Integration Tests, Mocks, Utilities) – GSoC Task 286 comments · 2026-03-04#776execute_join() uses busy-wait polling with hard-coded 10-second timeout ceiling6 comments · 2026-03-02
Discussions
#1707Discord Joining Issue0 comments · 2026-11-05#1703New contributor learning Rust — where should I start in MoFA?0 comments · 2026-09-23#1399Guidance for 2026 Proposal0 comments · 2026-03-20#1128Adding streaming tool calls for progress updates from long-running tools1 comments · 2026-03-11#391Working on UI improvements and upcoming PR0 comments · 2026-02-24
Latest release
v0.1.36 v0.1.36 2026-02-11🚀 Release 0.1.36 安装: bash pip install --upgrade mofa-core What's Changed Expand MoFA acronym in README files by @Copilot in https://github.com/mofa-org/mofa/pull/105 New Contributors @Copilot made their first contribution in https://github.com/mofa-org/mofa/pull/105 Full Changelog: https://github.com/mofa-org/mofa/compare/v0.1.35...v0.1.36