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
RustApache-2.0Created 2024-06-26mofa.ai
Download: v0.1.36v0.1.36 ↓0.1.362026-02-11
+0
Daily
+4
Weekly
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

Discussions

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

Snapshot: 2026-11-27T22:26:53Z · Data license Apache-2.0 · JSON