Skip to content

A lightweight Flask web app that takes the name of a mathematical formula, queries the Ollama model (gemma3:4b), and returns the LaTeX representation of the formula. The result is displayed both as raw LaTeX and as a beautifully rendered formula using MathJax.

Notifications You must be signed in to change notification settings

bdwarker/Formula_Recall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Formula Recall

A lightweight Flask web app that takes the name of a mathematical formula, queries the Ollama model (gemma3:4b), and returns the LaTeX representation of the formula. The result is displayed both as raw LaTeX and as a beautifully rendered formula using MathJax.


πŸš€ Features

  • Input a formula name (e.g., Quadratic Formula).
  • Model responds with JSON containing the LaTeX expression.
  • App extracts and displays:
    • Raw LaTeX
    • Rendered formula
  • Debug-friendly: saves raw model output to gemma_raw_response.txt.

πŸ›  Installation

  1. Clone this repository:

    git clone https://github.com/YOUR_USERNAME/formula-renderer.git
    cd formula-renderer
  2. Create a virtual environment and install dependencies:

    python -m venv venv
    source venv/bin/activate  # Linux/Mac
    venv\Scripts\activate     # Windows
    
    pip install -r requirements.txt
  3. Install Ollama and pull the model:

    ollama pull gemma3:4b

▢️ Usage

Run the app:

python app.py

Open in your browser: πŸ‘‰ http://127.0.0.1:5000/


⚠️ Notes

  • Raw responses from Gemma are saved to gemma_raw_response.txt for debugging.
  • If parsing fails, check that file to inspect the model output.

πŸ§‘β€πŸ’» Author

Made with ❀️ by Mohammed Shaan


About

A lightweight Flask web app that takes the name of a mathematical formula, queries the Ollama model (gemma3:4b), and returns the LaTeX representation of the formula. The result is displayed both as raw LaTeX and as a beautifully rendered formula using MathJax.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages