YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
π₯ Axiom: Neuro-Symbolic Inference Engine
Zero Hallucinations. 100% Deterministic Mathematical Precision.
π Overview
Standard Large Language Models (LLMs) rely strictly on probabilistic token prediction. When tasked with calculus, integration, or differential equations, this architecture inevitably suffers from arithmetic hallucinations.
Axiom solves this fundamental flaw by implementing a custom Neuro-Symbolic Dual-System Architecture. Constructed completely from scratch in PyTorch without relying on pre-trained API wrappers, Axiom pairs the intuitive pattern-recognition of a Neural Network with the absolute formal precision of a deterministic symbolic verification kernel.
π§ System Architecture
Axiom operates using a two-system cognitive pipeline:
ββββββββββββββββββββββββββββββββ
β Human Input (LaTeX/Text) β
ββββββββββββββββ¬ββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SYSTEM 1: Neural Intuition (PyTorch Seq2Seq Transformer) β
β - Parses structural syntax via Multi-Head Self-Attention β
β - Classifies target mathematical operation and equation type β
ββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SYSTEM 2: Symbolic Verification (SymPy Integration Kernel) β
β - Receives structured classification tokens β
β - Computes step-by-step calculus deterministically β
β - Back-propagates step derivations and generates LaTeX output β
ββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ
β 100% Verified Response β
ββββββββββββββββββββββββββββββββ
β¨ Key Features
- Zero-Hallucination Calculus: Decouples pattern recognition from symbolic manipulation for exact solutions.
- Step-by-Step Reasoning Stream: Visualizes the engine's internal thought process, from pattern detection to step-by-step algebraic manipulation.
- Custom Glassmorphic Interface: A deep-amber theme built with Streamlit and styled via dynamic CSS injection.
- OpenAI-Compatible Microservice: Includes a FastAPI deployment option (
/v1/chat/completions) for local or cloud LLM workflows. - Containerized & CI/CD Ready: Fully dockerized with automated deployment via GitLab CI/CD pipelines.
π Quick Start
Option 1: Run via Docker (Recommended)
No local Python or PyTorch setup required:
# 1. Clone the repository
git clone https://gitlab.com/YOUR_USERNAME/axiom-engine.git
cd axiom-engine
# 2. Build the Docker container
docker build -t axiom-engine .
# 3. Launch the container
docker run -p 8501:8501 axiom-engine
Open http://localhost:8501 in your browser to view the interface.
Option 2: Local Developer Setup
# 1. Clone and enter directory
git clone https://gitlab.com/YOUR_USERNAME/axiom-engine.git
cd axiom-engine
# 2. Install dependencies
pip install -r requirements.txt
# 3. Launch the Streamlit application
streamlit run app.py
Option 3: Launch Local OpenAI-Compatible API
Serve the custom neural model as an API service:
# Launch FastAPI server on port 8000
uvicorn api_server:app --host 127.0.0.1 --port 8000
Query via curl:
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "axiom",
"messages": [{"role": "user", "content": "dy/dx = x * y"}]
}'
π Repository Structure
axiom-engine/
βββ .gitlab-ci.yml # GitLab CI/CD Pipeline configuration
βββ .streamlit/
β βββ config.toml # Streamlit UI theme constraints
βββ src/
β βββ vocab.py # Character & mathematical tokenizers
β βββ model.py # PyTorch Transformer architecture
β βββ symbolic_engine.py# SymPy integration and LaTeX execution
β βββ pipeline.py # Neuro-Symbolic router logic
βββ weights/
β βββ model.pth # PyTorch neural weights state dictionary
β βββ vocab.json # Character vocabulary mapping
βββ app.py # Main Streamlit web application
βββ api_server.py # FastAPI OpenAI-compatible endpoint
βββ index.html # GitLab Pages landing embed wrapper
βββ Dockerfile # Container deployment specification
βββ requirements.txt # Python dependencies
π§ͺ Demonstration Queries
Test Axiom's dual-system pipeline using these queries:
| Query Category | Example Input | Target Engine Response |
|---|---|---|
| System Info | Tell me about yourself |
Neuro-symbolic architecture summary |
| First-Order Separable | dy/dx = x * y |
$y(x) = C_1 e^{x^2/2}$ |
| First-Order Linear | dy/dx + y = exp(x) |
$y(x) = \frac{e^x}{2} + C_1 e^{-x}$ |
| Second-Order ODE | y'' + 4*y = x^2 |
$y(x) = C_1 \sin(2x) + C_2 \cos(2x) + \frac{x^2}{4} - \frac{1}{8}$ |
π Live Deployments
- Interactive App: Axiom Live Interface
- GitLab Pages Portal: Axiom GitLab Portal