AlgebrAI is an AI-powered calculator built to solve linear algebra problems with high precision.
Unlike general-purpose language models that often produce incorrect or inconsistent math outputs, AlgebrAI generates and executes reliable Python code to directly compute the accurate final answer.
It is powered by a fine-tuned Qwen 3 1.7B model enhanced with QLoRA adapters, and trained on a custom dataset of linear algebra problems paired with executable Python solutions. When a user inputs a natural language math problem, the model:
- Understands the query,
- Generates valid Python code to solve it (e.g., SVD, eigenvalues),
- Executes the code, and
- Returns the final result.
- Purpose-built for linear algebra
Unlike generic LLMs that fumble math, AlgebrAI is fine-tuned specifically to handle linear algebra queries with precision and consistency.
- Direct code execution
It converts math queries into executable Python code, and returns only the final answer with no fake steps or guesswork.
- Custom Training Data
Trained on a hand-crafted dataset of 6000+ real linear algebra problems.
βββ linear_algebra.ipynb # Main notebook (run your queries here) βββ final_dataset_no_comments.json # Training/inference dataset βββ README.md # Project documentation
π Run It Yourself
1. Clone the Repo
git clone https://github.com/Umme-2003/AlgrbAI.git cd AlgrbAI
2.Install dependencies
pip install numpy torch transformers peft accelerate
3. Launch the notebook
jupyter notebook
Open linear_algebra.ipynb and run the cells step-by-step. You can enter your own linear algebra problem and watch the model solve it with generated Python code.
β¨ Sample Usage Input Prompt:
Let A = [[1, 2], [3, 4], [5, 6]]. Perform Singular Value Decomposition (SVD) on matrix A and return its singular values.
Model Output:
import numpy as np A = np.array([[1, 2], [3, 4], [5, 6]]) U, S, Vt = np.linalg.svd(A) print(S)
Final Answer:
[9.5255, 1.5143]
π§ Model Info
-
Base LLM: Qwen 3 1.7B
-
Tuning: LoRA adapters on a curated problem-code dataset
-
Inference Tools: Hugging Face Transformers + PEFT
-
Execution Env: Jupyter / Lightning AI
Use Cases
- π§βπ Students verifying linear algebra homework
- π©βπ» Developers testing numerical algorithms
- π€ Researchers benchmarking LLMs for mathematical reasoning