Welcome to nfrax — a suite of production-ready frameworks for building modern applications.
The Packages
svc-infra — Backend Foundation
The shared building blocks for production FastAPI services. If you're building a backend, start here.
What it provides:
- API Framework — FastAPI bootstrap with middleware, CORS, docs wiring
- Auth & Security — Sessions, OAuth/OIDC, MFA, JWT, password policies
- Database — SQL (PostgreSQL) + MongoDB wiring, Alembic migrations, repository patterns
- Caching — Redis-backed caching with namespace management and TTL helpers
- Job Queues — Background job execution with scheduling and retry logic
- Observability — Prometheus metrics, OpenTelemetry tracing, Grafana dashboards
- Webhooks — Subscription management, request signing, delivery workers
- Billing — Stripe integration for payments and subscriptions
- Multi-tenancy — Tenant boundaries and data isolation helpers
bash
pip install svc-infraai-infra — AI/LLM SDK
Production-ready SDK for building AI applications with LLMs, agents, and multimodal capabilities.
What it provides:
- LLM Chat — Multi-turn conversations, streaming, structured output, retries
- Agents — Tool calling, human-in-the-loop, provider fallbacks, autonomous mode
- Graph Workflows — LangGraph-based workflows with typed state and branching
- Embeddings & RAG — Vector storage, document retrieval, multiple backends
- Multimodal — Text-to-speech, speech-to-text, vision, real-time voice
- Image Generation — DALL-E, Imagen, Stability AI, Replicate
- MCP — Model Context Protocol client/server, OpenAPI→MCP conversion
- 10+ Providers — OpenAI, Anthropic, Google, xAI, ElevenLabs, Deepgram, and more
bash
pip install ai-infrafin-infra — Financial Data Layer
Purpose-built infrastructure for fintech applications needing financial data integrations.
What it provides:
- Banking — Account aggregation via Plaid/Teller, transactions, statements
- Investments — Holdings, portfolio data, real P/L with cost basis tracking
- Market Data — Stock quotes, crypto tickers, forex rates, historical data
- Credit — Credit score retrieval and monitoring via Experian
- Brokerage — Trading account connections and portfolio data
- Tax Data — Tax documents, crypto gains calculations, tax-loss harvesting
- Analytics — Cashflow analysis, budget tracking, spending insights, net worth
- Compliance — PII boundaries, GLBA/FCRA/PCI-DSS patterns
bash
pip install fin-infraHow They Work Together
fin-infra builds on svc-infra — it uses svc-infra's generic modules (auth, database, storage) and adds financial-specific features. Applications typically use both together.
ai-infra is independent — use it standalone for AI capabilities, or combine with svc-infra for a full AI-powered backend.
python
# Example: Personal finance app with AI insights
from svc_infra.api.fastapi import easy_service_app
from svc_infra.api.fastapi.db.sql import add_sql_db
from fin_infra.banking import add_banking
from fin_infra.analytics import get_spending_insights
from ai_infra import LLM
app = easy_service_app(name="FinanceApp")
add_sql_db(app)
add_banking(app, provider="plaid")
llm = LLM()
@app.get("/insights/{user_id}")
async def get_insights(user_id: str):
spending = await get_spending_insights(user_id)
analysis = llm.chat(f"Analyze this spending: {spending}")
return {"spending": spending, "analysis": analysis}Requirements
- Python 3.11+
- Redis — for caching, job queues, rate limiting
- PostgreSQL — recommended for production (SQLite works for development)
Quick Links
| Package | PyPI | GitHub |
|---|---|---|
| svc-infra | pypi.org/project/svc-infra | github.com/nfraxio/svc-infra |
| ai-infra | pypi.org/project/ai-infra | github.com/nfraxio/ai-infra |
| fin-infra | pypi.org/project/fin-infra | github.com/nfraxio/fin-infra |