license: mit
language:
- en
pipeline_tag: text-generation
library_name: transformers
tags:
- Modular
- Intelligence
Modular Intelligence
A Small but Complete Reasoning System Built on Top of a Language Model
System-Level View (60 Seconds)
This repository is not a standard GPT-2 model.
It is a compact reasoning system built on top of an LLM, using:
- Modules β structured reasoning lenses
- Checkers β strict second-pass reviewers
- Contracts β fixed output sections for every module
- Optional Router β automatic module selection from free-form tasks
Pipeline:
Task β Lens (Module) β Structured Output β Checker (Optional)
The LLM engine is replaceable; the architecture is the system.
Architecture
+βββββββββββββββββββββ+ | MODULAR INTELLIGENCE | +βββββββββββββββββββββ+ | User Task | | | | | v | | [Auto-router or manual module selection] | | | | | v | | +ββββββββ+ +ββββββββ+ | | | GENERATOR MODULE | ββ> | CHECKER MODULE | | | | (structured output) | | (optional verification)| | | +ββββββββ+ +ββββββββ+ | | | ^ | | v | | | Structured Output Feedback / Fix Ideas | +βββββββββββββββββββββ+
Repository Contents
modules.jsonβ all modules, inputs, sections, checkersapp.pyβ Gradio UI with optional auto-routing- Model card
- GPT-2 base model (fully swappable)
Problem This Solves
Standard LLMs: unstructured text, drift, no audit trail.
Modular Intelligence: task decomposition, structured reasoning, verification, consistency, interpretability.
Modules (Lenses)
| Module | Use |
|---|---|
| Analysis Note | Explain or break down text/situations |
| Document Explainer | Summaries of contracts/policies/articles |
| Strategy Memo | Options β Recommendation β Risks β Next Steps |
| Message/Post Reply | Structured replies |
| Profile/Application | Bios, cover letters, statements |
| System Blueprint | Design or improve systems and workflows |
| Modular Brainstorm | Decompose problems into modules/checkers |
Checker Layer
Checkers produce:
- VERDICT
- ALIGNMENT
- STRUCTURE
- GAPS
- FIXES
Implements: Reason β Critique β Refine.
End-to-End Example
Task: βShould we expand into a new city in 6 months?β
- Select
strategy_memo_v1 - Fill: context, objective, constraints
- Run β structured memo with required sections
- Run checker β verdict + issues + fixes
Auto-Routing (Optional)
The provided app.py includes an Auto-Route tab:
- Paste free-form task
- Zero-shot classifier ranks modules
- Jump directly to best lens
Code Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("botbottingbot/Modular_Intelligence")
model = AutoModelForCausalLM.from_pretrained("botbottingbot/Modular_Intelligence")
prompt = """
MODULE: Strategy Memo
INPUTS:
CONTEXT: We are expanding to City X.
OBJECTIVE: Decide whether to enter within 6 months.
CONSTRAINTS: Budget limits; regulatory uncertainty.
OUTPUT SECTIONS:
- CONTEXT
- OBJECTIVE
- CONSTRAINTS
- OPTIONS
- RECOMMENDATION
- RISKS
- NEXT_ACTIONS
"""
inp = tok(prompt, return_tensors="pt")
out = model.generate(**inp, max_new_tokens=250)
print(tok.decode(out[0], skip_special_tokens=