Autor: Luiz Roberto Meier
Data: August 25, 2025
An intelligent mathematical assistant that seamlessly combines LM Studio's local LLM capabilities with external computational tools. The system automatically decides when to use internal knowledge versus external computation, providing perfect LaTeX rendering in Jupyter notebooks.
- Seamless Intelligence: Automatically chooses between internal knowledge and external computation
- Advanced Math Tools: Eigenvalues, differential equations, quantum mechanics, numerical analysis
- Perfect LaTeX Rendering: Beautiful mathematical expressions in Jupyter
- Local & Private: Runs entirely on your machine
- Real-time Tool Integration: Live communication between LLM and computational backend
Advanced Tool Integration (Flask server running on http://localhost:5000 )
LM Studio with model loaded and API server running on http://localhost:1234
- Linux (tested on Linux Mint)
- Python 3.8+
- At least 32GB RAM (recommended for 20B model)
- NVIDIA RTX 4060 or better (RTX 4090 recommended for optimal performance)
- Download LM Studio 0.3.6+ from lmstudio.ai
- Install the AppImage:
chmod +x LM-Studio-*.AppImage ./LM-Studio-*.AppImage
In LM Studio:
- Go to "Models" tab
- Search for
openai/gpt-oss-20b
- Download the model
- Load the model (ensure it shows the tool icon ⚒️)
- Go to "Developer" tab in LM Studio
- Click "Start Server"
- Note the URL (typically
http://localhost:1234
)
# Clone repository
git clone https://github.com/yourusername/Advanced-Math-AI-Assistant
cd Advanced-Math-AI-Assistant
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# In terminal 1 (with venv activated)
python server.py
Server will start at http://127.0.0.1:5000
# In terminal 2 (with venv activated)
jupyter notebook
Open Seamless Math Assistant.ipynb
and run the first cell.
# Simple arithmetic (uses external computation for precision)
assistant.ask("What's 847 * 293?")
# Conceptual questions (uses internal knowledge)
assistant.ask("What are eigenvalues?")
# Advanced computations (uses external tools)
assistant.ask("Find eigenvalues of [[3, 1, 0], [1, 3, 1], [0, 1, 3]]")
# Mixed questions (uses both internal knowledge and external computation)
assistant.ask("Explain eigenvalues and find them for [[2, 1], [1, 2]]")
- Basic Arithmetic: Precise calculations
- Eigenvalue Analysis: Matrix eigenvalues and eigenvectors
- Differential Equations: Symbolic ODE system solutions
- Quantum Mechanics: Harmonic oscillator solutions
- Numerical Methods: Numerical ODE integration
- Question Analysis: LLM analyzes your mathematical question
- Decision Making: Automatically chooses internal knowledge vs external tools
- Tool Execution: Calls appropriate mathematical tools when needed
- Result Integration: Combines computed results with natural language explanations
- LaTeX Rendering: Displays beautiful mathematical expressions
- Ensure model shows tool icon ⚒️ (indicates function calling support)
- Check API server is running on port 1234
- Verify model is
openai/gpt-oss-20b
# Recreate environment if needed
rm -rf venv
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- Check server is running on port 5000
- Ensure no firewall blocking local connections
- Verify SymPy and NumPy are installed correctly
This project is licensed under the MIT License - see the LICENSE file for details.
- LM Studio for local LLM infrastructure
- SymPy for symbolic mathematics
- NumPy/SciPy for numerical computation
- OpenAI for the GPT-OSS-20B model architecture