--- language: - en license: gemma base_model: google/gemma-3-12b-it library_name: mlx pipeline_tag: text-generation tags: - mlx - aerospace - engineering - thermodynamics - mathematics - finance - coding - signals - statics - dynamics - mechanics-of-materials - controls - manufacturing - lora - fine-tuned - chain-of-thought --- # gemma3-12b-engineering A fine-tuned version of [Gemma 3 12B IT](https://huggingface.co/google/gemma-3-12b-it) specialized for **aerospace engineering, thermodynamics, advanced mathematics, coding, finance, and 6 additional engineering disciplines**. ## Model Details - **Base model:** google/gemma-3-12b-it (4-bit quantized via MLX) - **Fine-tuning method:** QLoRA (MLX/LoRA) — 4 sequential training passes - **Format:** MLX 4-bit quantized safetensors (~6.7 GB) - **Hardware:** Apple MacBook Air M4 16GB ## Training Summary | Pass | Dataset | Examples | Best Val Loss | |------|---------|----------|---------------| | v2 domain | MetaMathQA, Open-Platypus, OpenHermes STEM, ArXiv QA, SciQ, WikiText, WikiQA, CAMEL Physics/Math, CodeAlpaca, Finance | ~56K | 0.617 | | CoT reasoning | nvidia/OpenMathReasoning, Open-Platypus CoT, MetaMathQA CoT, handcrafted aerospace | ~11K | 0.439 | | Precision | Handcrafted aerospace/thermo — correct R=8314/M derivation (never R=287 for custom propellants) | ~60 | 0.620 | | v3 comprehensive | 6 new engineering domains + NuminaMath-CoT, Magicoder, Finance-Alpaca, OpenHermes STEM, CodeFeedback | 23,850 | 0.689 | **LoRA config:** rank=16, alpha=32, lora_layers=4, keys=[q_proj, v_proj], LR=2e-6 ## Capabilities - **Aerospace:** Isentropic flow, normal shocks, Brayton/Rankine cycles, rocket nozzles, Hohmann transfers - **Thermodynamics:** Carnot, heat exchangers, entropy, propellant property derivation - **Signals & Systems:** Laplace transforms, Bode plots, Z-transforms, Fourier series, stability, RC filters, sampling - **Statics:** Equilibrium, beam reactions, trusses, centroids, moments of inertia, friction, frames - **Dynamics:** Kinematics, Newton's 2nd law, work-energy, impulse-momentum, rotation, vibrations - **Mechanics of Materials:** Axial stress, torsion, bending, Mohr's circle, Euler buckling, thermal stress, deflection - **Controls:** Routh-Hurwitz, PID design, state-space, root locus, steady-state error, block diagrams, time specs - **Manufacturing:** Turning/milling, Taylor tool life, tolerances, Chvorinov's rule, grinding, machining time - **Mathematics:** ODEs, linear algebra, RK4, Newton-Raphson, induction proofs, competition-level math - **Coding:** Python, C++, Java, JavaScript, numerical solvers - **Finance:** Black-Scholes, NPV, DCF, engineering economics, portfolio theory ## Chain-of-Thought Reasoning Activate step-by-step reasoning with this system prompt: ``` You are an expert aerospace engineer. Always reason step by step inside tags before giving your final answer. ``` ## Usage (MLX on Apple Silicon) ```python from mlx_lm import load, generate model, tokenizer = load("vininhosts/gemma3-12b-engineering") prompt = "A rocket nozzle has Pc=2MPa, Tc=3000K, exit Mach=3, propellant M=20g/mol, gamma=1.3. Find exit pressure." response = generate(model, tokenizer, prompt=prompt, max_tokens=1024) print(response) ``` ## Key Precision: R = 8314 / M This model correctly computes the specific gas constant from molar mass as **R = 8314 / M**, and never defaults to R = 287 J/(kg·K) (air) when a different propellant molar mass is given. This was enforced via a dedicated precision fine-tuning pass with 60+ handcrafted examples. ## Example Domains Covered - Isentropic nozzle flow and normal shock relations - Brayton cycle thermal efficiency and compressor work - PID controller tuning and Routh-Hurwitz stability - Beam deflection and Mohr's circle stress analysis - Z-transform and discrete-time system stability - Taylor tool life equation and machining parameters - Black-Scholes option pricing and DCF valuation ## License Derived from Gemma 3 — subject to [Gemma Terms of Use](https://ai.google.dev/gemma/terms).