跳到正文
原文
Google AI:DEV 作者专属(RSS)· Ch Yasaswini·· 11 小时前AI 评分25

CrackIt:把化工重型方程拆成小块的工程方程解读器,用 Gemma 3 4B 做 AI 辅导

CrackIt: Big Equations, Broken into Small Pieces (Built for My Brother)

AI 导读

开发者用 Gradio 6 打造了 CrackIt,把 Ergun 方程、伯努利原理、拉乌尔定律等 10 个石化工程公式拆解为公式用途、符号释义、分步算例和实时计算器。

正文

💡 What I Built

My younger brother is a diploma student in petrochemical engineering. Every evening, he sits with thick textbooks filled with dry, heavy equations like the Ergun Equation, Bernoulli's Principle, and Raoult's Law.

Like many engineering students, he gets bored and overwhelmed by abstract derivations. When you're trying to understand how a packed catalyst bed in an oil hydrotreater works, looking at this:

ΔPL=150μ(1−ϵ)2vsϵ3dp2+1.75ρ(1−ϵ)vs2ϵ3dp

...feels completely disconnected from real plant operations.

So for the Hacktoberfest "Build for a Friend" Weekend Challenge, I built CrackIt: an engineering equation interpreter designed like a friendly senior explaining over a cup of chai.

CrackIt breaks heavy formulas into small, practical pieces:

  1. 🎯 What It's For: One clear sentence connecting the formula to real plant equipment (distillation towers, hydrotreaters, heat exchangers).
  2. 🔤 Crack the Symbols: Every symbol in plain words with its engineering units, plus an Interactive Focus picker.
  3. ✏️ Worked Example: Calculations broken into 3 to 5 clean steps with round numbers.
  4. 🧪 Try It Live (Interactive Calculator): A live numeric playground where students tweak parameters (flow rates, particle size, void fraction) and watch outputs recalculate in real time.
  5. 💡 What Happens If...?: Real plant intuition, e.g. "Smaller catalyst particles create a substantially higher pressure drop due to the dp2 term in the denominator."
  6. 🎯 Practice Challenge & AI Feedback: Practice problems with an answer checker powered by Google's open-weight Gemma 3 4B.

🌐 Live Demo & Code

⚗️ CrackIt

Big equations, broken into small pieces.

CrackIt Dashboard

Built for my brother, a diploma student in petrochemical engineering who finds heavy maths boring CrackIt takes an engineering equation and breaks it into small, friendly parts, with a petrochemical plant example every time, and lets you play with the numbers live.


🌐 Live Demo & Deployment


What it does

Type an equation name (or pick a quick card, or upload a photo of your notes) and CrackIt shows:

  1. The formula, rendered properly (Ergun's viscous and inertial terms are colour-labelled)
  2. What it's for, with a real plant example
  3. Crack the Symbols, a table of every symbol, its meaning and its unit, plus an Interactive Focus picker for any one symbol
  4. Worked example, small round numbers, one step per line
  5. Try it live, a calculator pre-filled with the worked-example values. Change a…

📸 Screenshots & Walkthrough

1. The Equation Dashboard

Midnight Navy and Off-White interface with Inter and STIX Two Math typography.

CrackIt Dashboard

Students can:

  • Type in any equation name (e.g. "Ergun equation", "Q = mCpΔT", or "Bernoulli").
  • Upload textbook photos to have the vision model identify the formula.
  • Click any of the 10 quick-start cards spanning fluid dynamics, heat transfer, kinetics, and thermodynamics.

2. The Learning Workspace

Semantic color highlights: viscous contribution in Soft Blue (#EAF3FF) vs. inertial contribution in Soft Violet (#F1ECFF).

CrackIt Workspace Top

3. Step-by-Step Breakdown, Symbols & Worked Example

Every variable cataloged with physical units, followed by sequential numeric walkthroughs.

CrackIt Details


🛠️ How I Built It

CrackIt is built around two principles: deterministic physical accuracy and open-weight AI guidance. The numbers always come from plain Python, and the AI only explains and checks.

┌─────────────────────────────────────────────────────────────────┐
│                      Browser UI: Gradio 6                       │
│      (Inter Typography + STIX Two Math + KaTeX Rendering)       │
└────────────────────────────────┬────────────────────────────────┘
                                 │
                ┌────────────────┴────────────────┐
                ▼                                 ▼
┌───────────────────────────────┐ ┌───────────────────────────────┐
│      Deterministic Core       │ │     Open-Weight AI Tutor      │
│    (Pure Python / Offline)    │ │    (Gemma 3 4B via Ollama)    │
├───────────────────────────────┤ ├───────────────────────────────┤
│ • 10 Petrochemical Formulas   │ │ • AI Practice Answer Checker  │
│ • Step-by-Step Walkthroughs   │ │ • Multimodal Vision Reader    │
│ • Real-time Live Calculator   │ │ • Cloud Fallback (Backboard)  │
└───────────────────────────────┘ └───────────────────────────────┘

1. The Open-Weight AI Core: Gemma 3 4B & Ollama

On local laptops, CrackIt runs fully offline via Ollama using Google's gemma3:4b:

  • Why open-weight AI? Students often study with limited bandwidth or in offline libraries. Gemma runs privately on consumer laptop hardware with zero API fees.
  • Multimodal equation recognition: Gemma's vision encoder reads textbook snapshots and identifies formulas directly.
  • Pedagogical tutor mode: Gemma checks student practice answers, explaining math or unit mistakes in at most two friendly sentences.

2. Live Cloud Deployment on Render

The application is deployed on Render as a Python web service using a render.yaml blueprint with automated port binding and dynamic environment handling.

3. Cloud Fallback & Prompt Evaluation via Backboard

So the live Render demo stays responsive for judges even without a local Ollama daemon, I integrated Backboard as a cloud inference gateway, evaluating prompts across open-weight models (google/gemma-2-9b-it).

4. Industrial Design System

Instead of generic AI gradients, CrackIt uses an engineering palette:

  • 90% Baseline: Midnight Navy (#14263D), Deep Navy (#172B45), and Off-White (#F8FAFC).
  • Semantic Accents: Viscous laminar contribution in Engineering Blue (#2F80ED / #EAF3FF) and turbulent inertial contribution in Violet (#7C5CDB / #F1ECFF).
  • Typography: Inter for clean UI paired with STIX Two Math for proper mathematical typesetting.

🌍 Why Does Open Innovation Matter?

Engineering education shouldn't be locked behind expensive proprietary cloud subscriptions that track student data.

Open-weight models like Gemma show that a compact 4-billion-parameter model on a modest laptop can work as a personal chemical engineering tutor. When AI is open and runs locally:

  • Students with limited connectivity can still use AI study tools.
  • Plant engineers can run proprietary calculations without data leaving their laptops.
  • Learners are not dependent on closed API providers.

🤖 My Agent Session

CrackIt was built with the help of an autonomous AI pair-programmer. From resolving Windows Hyper-V port exclusion conflicts, to refactoring Gradio 6 lifecycle hooks, to implementing the deterministic calculation engine and custom CSS design tokens, the agent and I worked through it together. You can explore the full commit history in the GitHub Repository.


🏆 Prize Categories Entered

  1. Overall Winner: Theme: Build for a Friend (built for my brother studying petrochemical engineering)
  2. Featured Partner: Render: Deployed live on Render Web Services
  3. Featured Partner: Gemma: Powered by Google's open-weight Gemma models (gemma3:4b locally, Gemma cloud via Backboard)
  4. Partner Category: Backboard: Open-weight inference routing and prompt benchmarking
  5. Partner Category: Entire: Agent-assisted pairing session and documented build trajectory

Built with ❤️ for my brother and engineering diploma students everywhere.

来源:Google AI:DEV 作者专属(RSS) · dev.to