Hardware-aware local model recommender and zero-dependency TypeScript starters for Ollama.
Built for the Hacktoberfest 2026 "Build for a Friend" Weekend Challenge, Hack Day Starter profiles your hardware (RAM, GPU, CPU, SSD headroom), matches your machine with a verified open-weight AI model fitted to your system memory and compute limits, and generates an immediate, production-ready TypeScript project with zero runtime dependencies.
- π Verified Model Registry: All 23 tracked entries with exact manifest byte sizes, context token windows, lifecycle states, and verified capabilities.
- β‘ Ollama Hardware Requirements Guide: In-depth engineering analysis of Apple Silicon Metal, NVIDIA CUDA VRAM, CPU bottlenecks, and KV cache calculations.
- π οΈ Building Local Tool-Calling Agents: Native Ollama tool calling, multi-step agent loops, AST arithmetic security, and verified models.
- βοΈ Deterministic Sizing Logic: Mathematical scoring breakdown, binary safety gates, and 1.5 GB buffer policy.
If you are asking "How do I run an open-source AI model locally on my computer?", here is the 3-step process:
- Install Ollama (the local AI runtime):
# macOS / Linux curl -fsSL https://ollama.com/install.sh | sh # Windows: Download installer from https://ollama.com/download
- Match the right model to your RAM:
- 8 GB RAM: Run
phi4-mini(2.5 GB) orqwen3.5:4b(3.4 GB) - 16 GB RAM: Run
gemma4:e4b(6.6 GB) orqwen3.5:9b(6.6 GB) orgemma4:12b(7.7 GB) - 24 GB β 32 GB RAM: Run
gemma4:12b(with 256K context) orqwen3.8:27b(18 GB) - 64 GB+ RAM: Run
qwen3-coder-next(52 GB) or large MoE models
- 8 GB RAM: Run
- Pull and execute:
ollama run gemma4:12b
The catch? Wiring up streaming, handling conversational state, managing function/tool calls, avoiding disk swap death, and writing boilerplate code takes hours.
Hack Day Starter automates this end-to-end.
Hack Day Starter was built specifically for the Hacktoberfest 2026 "Build for a Friend" Weekend Challenge. During hackathons, weekend sprints, and local AI prototyping, developers lose the first 2β4 hours fighting common pitfalls:
- π₯ Out-of-Memory (OOM) Crashes: Downloading a 14 GB or 20 GB model on an 8 GB or 16 GB laptop triggers aggressive swap thrashing, freezing the machine or crawling at 0.2 tokens/second.
- π¦ Stale Model Catalogs: Outdated tutorials recommend retired 2023-era models (like Llama 2 7B) instead of modern state-of-the-art architectures (Gemma 4, Qwen 3.5, Phi-4) that offer 256K context and native tool calling.
- πΎ Disk Space Blindspots: Pulling models without checking SSD headroom can stall multi-gigabyte downloads halfway through.
- π Boilerplate & Runtime Frustration: Connecting to local REST daemons, handling chunked NDJSON streams, configuring tool execution loops, and debugging raw
ECONNREFUSEDconnection crashes drain developer momentum.
Hack Day Starter was created to solve this for a friend:
- Detect your hardware specs (RAM, GPU acceleration, OS, free storage).
- Deterministically recommend verified models with realistic memory requirements.
- Choose your starter archetype (Local Chat or Tool-Calling Agent).
- Download a clean, ready-to-run TypeScript project ZIP and start building in under 60 seconds.
Memory calculations must account for the model weights, the KV cache (which scales with context length), and operating system overhead (~2.5β4 GB):
| Your Available RAM | Recommended Models | Ollama Tag | Model Size | Context Window | Native Tool Calling | Experience / Speed |
|---|---|---|---|---|---|---|
| 8 GB RAM (Standard Laptop) | Phi-4 Mini Nemotron 3 Nano Qwen 3.5 4B |
phi4-mininemotron-3-nano:4bqwen3.5:4b |
2.5 GB 2.8 GB 3.4 GB |
128K 256K 256K |
β
β β |
β‘ Fast (30β60 tok/s on M-series or modern CPU) |
| 16 GB RAM (Dev Laptop) | Gemma 4 E4B Qwen 3.5 9B Gemma 4 12B |
gemma4:e4bqwen3.5:9bgemma4:12b |
6.6 GB 6.6 GB 7.7 GB |
128K 256K 256K |
β
β β |
π Optimal balance of intelligence, speed, and context |
| 24 GB β 32 GB RAM (Pro Mac / RTX PC) | Gemma 4 12B (Full KV) Qwen 3.8 27B GPT-OSS 20B |
gemma4:12bqwen3.8:27bgpt-oss:20b |
7.7 GB 18 GB 14 GB |
256K 256K 128K |
β
β β |
π§ High reasoning power, complex coding & agent tasks |
| 64 GB+ Unified / VRAM (Workstation) | Qwen 3 Coder Next Qwen 3.6 35B |
qwen3-coder-nextqwen3.6:35b |
52 GB 23 GB |
256K 256K |
β
β |
π Full frontier-grade local intelligence |
Note
Unified Memory (Apple Silicon M1βM6): macOS dynamically shares RAM between CPU and GPU. A 16 GB Mac can dedicate ~12 GB directly to model weights and KV cache, making it one of the most efficient local AI platforms available.
βββββββββββββββββββββββββββββββββββββββββββββββββ
β Developer Laptop Specifications β
β β’ RAM (GB) β’ GPU (Apple / NVIDIA / CPU) β
β β’ Operating OS β’ Free Disk Space Headroom β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββ
β Hack Day Starter (App) β
β β’ Deterministic hardware compatibility score β
β β’ Verified Model Registry (Oct 2026 data) β
β β’ Authoritative vs Estimated memory bounds β
β β’ Free disk space safety gate β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββ
β Verified Model Selection β
β β’ Exact Ollama tag (e.g. gemma4:12b) β
β β’ Verified native capabilities (tools/vision)β
β β’ Starter type: Local Chat vs Agent β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββ
β Generated Starter Project (ZIP) β
β β’ Zero runtime dependencies (native fetch) β
β β’ Direct /api/chat streaming client β
β β’ Built-in Ollama & Model Readiness check β
β β’ Safe recursive-descent math tool β
β β’ Deterministic in-memory generation β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββ
β Local Ollama Runtime Daemon β
β http://localhost:11434 β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββ
β Open-Weight Model Weights β
β gemma4:12b / qwen3.5:9b / ... β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
βββββββββββββββ΄ββββββββββββββ
βΌ βΌ
Direct Response Tool Call Execution
(src/tools/calculator.ts)
β
βΌ
Synthesized Result
| Component | Role | What It Does / Does Not Do |
|---|---|---|
| Ollama | Local Daemon | Runs locally on port 11434. Pulls weights, manages GGUF quants, and executes hardware-accelerated tensor math on Metal/CUDA/Vulkan. |
| Open-Weight Models | Intelligence Layer | Neural network weights (e.g., gemma4:12b, qwen3.5:9b). Runs completely offline inside Ollama. |
| Hack Day Starter | Generator & Recommender | Profiles hardware, filters models, and builds custom starter ZIPs in-memory. Does not proxy inference or transmit prompts. |
| Generated Project | Your Application | Independent TypeScript codebase. Runs directly on your machine with zero external SDKs or telemetry. |
- Best for: Chatbots, personal offline copilots, document Q&A, and conversational prototyping.
- Key Capabilities:
- Zero runtime dependencies: Uses native Node.js 18+ global
fetch. - Interactive CLI loop: Multi-turn conversational memory with seamless terminal I/O.
- Smart readiness check: Verifies the Ollama daemon and local model existence before prompting the user.
- Graceful shutdown: Clean EOF handling on
Ctrl+Cor typingexit.
- Zero runtime dependencies: Uses native Node.js 18+ global
- Best for: Multi-step autonomous agents, calculation engines, and structured function execution.
- Strict Safety Gate: Only selectable when the model is verified to support native tool calling (
model.capabilities.tools === true). - Key Capabilities:
- Autonomous ReAct Loop: Model generates structured
tool_callsβ runtime executes tool β sends{ role: "tool", content: result }back to model β model synthesizes natural language conclusion. - Safe Math Engine: Ships with
calculator.ts, a pure recursive-descent arithmetic parser (0%eval(), 0%new Function()). - Extensible Architecture: Add new tools in minutes using standard JSON Schema definitions.
- Autonomous ReAct Loop: Model generates structured
Here is the exact terminal output from the generated tool-calling agent running against local Ollama with gemma4:12b:
$ npm run dev
=================================================
π€ Hack Day Starter β Tool-Calling Agent
π― Model: gemma4:12b (Native Tool-Calling Verified)
π οΈ Active Tools: [calculate]
π‘ Ollama Host: http://localhost:11434
=================================================
β¨ Agent ready! Try asking complex calculations or math problems:
Example: 'What is 342 multiplied by 19, and then divide by 4?'
Type 'exit' or press Ctrl+C to quit.
User: What is 342 multiplied by 19, and then divide by 4?
Agent: Thinking...
βοΈ [Tool Call] calculate({"expression":"(342 * 19) / 4"})
π [Tool Result] 1624.5
Agent: Thinking...
Agent: 342 multiplied by 19, divided by 4, equals 1624.5.- User Prompt: Submitted a natural-language multi-step arithmetic request.
- Autonomous Tool Call:
gemma4:12brecognized it required a calculation and emitted a structured tool call:calculate({"expression": "(342 * 19) / 4"}). - Safe Evaluation:
src/tools/calculator.tsevaluated the expression mathematically without invoking any shell or arbitrary JavaScript execution. - Tool Context Feeding: The output
1624.5was sent back to the model as atoolrole message. - Final Synthesis: Gemma 4 synthesized the final, human-readable answer.
Unlike static blog posts that become outdated within weeks, Hack Day Starter uses a Verified Model Registry tracking 23 model entries categorized by capability verification, runtime testing status, and lifecycle. The complete catalog with manifest byte sizes and interactive filters is browsable on the Verified Model Registry page:
| Model | Creator | Ollama Tag | Display Size | Context | Tools | Verification Status |
|---|---|---|---|---|---|---|
| Gemma 4 12B | gemma4:12b |
7.7 GB | 256K | β | Official Spec: 16 GB | |
| Gemma 4 E4B | gemma4:e4b |
6.6 GB | 128K | β | Official Spec: 8 GB | |
| Llama 3.2 3B | Meta | llama3.2:3b |
2.0 GB | 128K | β | Runtime Verified |
| Llama 3.1 8B | Meta | llama3.1:8b |
4.9 GB | 128K | β | Runtime Verified |
| Qwen 3.5 9B | Alibaba | qwen3.5:9b |
6.6 GB | 256K | β | Source Verified |
| Qwen 3.5 4B | Alibaba | qwen3.5:4b |
3.4 GB | 256K | β | Source Verified |
| Qwen 2.5 Coder 7B | Alibaba | qwen2.5-coder:7b |
4.7 GB | 32K | β | Source Verified |
| Mistral NeMo 12B | Mistral | mistral-nemo:12b |
7.1 GB | 128K | β | Source Verified |
| Qwen 3.8 27B | Alibaba | qwen3.8:27b |
18 GB | 256K | β | Source Verified |
| Qwen 3.6 35B | Alibaba | qwen3.6:35b |
23 GB | 256K | β | Source Verified |
| GPT-OSS 20B | Community | gpt-oss:20b |
14 GB | 128K | β | Source Verified |
| Phi-4 Mini | Microsoft | phi4-mini |
2.5 GB | 128K | β | Source Verified |
| Nemotron 3 Nano 4B | NVIDIA | nemotron-3-nano:4b |
2.8 GB | 256K | β | Source Verified |
| LFM 2.5 8B | Liquid | lfm2.5:8b |
5.2 GB | 32K | β | Source Verified |
| Devstral Small 2 | Mistral | devstral-small-2:latest |
15 GB | 32K | β | Source Verified |
| DeepSeek R1 1.5B | DeepSeek | deepseek-r1:1.5b |
1.1 GB | 128K | β | Source Verified |
First-time local AI developers frequently run into confusing crashes:
FetchError: connect ECONNREFUSED 127.0.0.1:11434model 'xyz' not found, try pulling it first
Generated projects ship with an integrated Readiness Check (src/readiness.ts). Before any prompt is processed, it checks:
- Is Ollama Running?
If the daemon is offline, it prints a clean, formatted guide:=============================================================== β οΈ OLLAMA IS NOT REACHABLE --------------------------------------------------------------- Could not connect to Ollama at: http://localhost:11434 To run this starter, please: 1. Install Ollama: https://ollama.com/download 2. Start the Ollama application or run 'ollama serve' 3. Restart this starter: npm run dev =============================================================== - Is the Model Installed?
If the weights are missing, it provides the exact copy-paste command:=============================================================== β οΈ MODEL NOT INSTALLED: gemma4:12b --------------------------------------------------------------- Ollama is running, but 'gemma4:12b' is not downloaded yet. To download this model, run: ollama pull gemma4:12b Once download finishes, restart this starter: npm run dev ===============================================================
- No External API Keys: Inference executes locally through your local Ollama instance. Prompts, code, and documents are processed on your machine rather than sent to third-party cloud APIs.
- Deterministic & Safe Generation: The generator uses pure template composition. It does not invoke opaque third-party cloud LLMs to write code.
- No Dynamic Code Evaluation:
src/tools/calculator.tsstrictly rejects any input containing letters, semicolons, backticks, or non-arithmetic characters. It never toucheseval()ornew Function(). - Registry Enforcement: The API only generates starters for models registered in
VERIFIED_MODEL_REGISTRY. Arbitrary, unverified model tags are rejected.
# 1. Clone this repository
git clone https://github.com/TechGenDM/hack-day-starter.git
cd hack-day-starter
# 2. Install dependencies
npm install
# 3. Launch the web profiler
npm run dev
# 4. Open http://localhost:3000 in your browser
# - Review your hardware recommendations
# - Select Chat or Agent starter
# - Click "Download Starter (.ZIP)"# 1. Unzip your generated project
unzip hack-day-starter-agent-gemma4.zip -d my-ai-agent
cd my-ai-agent
# 2. Pull the model weights locally
ollama pull gemma4:12b
# 3. Install dev dependencies (TypeScript & tsx)
npm install
# 4. Start your local AI!
npm run devThe codebase includes an extensive automated test suite covering recommendation logic, live data syncing, generator determinism, AST security auditing, runtime readiness diagnostics, score transparency, and starter setup flow contracts:
npm testβ R1: Both starter types ship the readiness module and use it in index.ts
β R2 (chat): Ollama unavailable β friendly message, download URL, no raw error
β R2 (agent): Ollama unavailable β friendly message, download URL, no raw error
β R3 (chat): model missing β exact 'ollama pull qwen3.5:9b', no substitution
β R3 (agent): model missing β exact 'ollama pull gemma4:12b', no substitution
β R4: Chat β ready β readiness message, then unchanged chat behavior with exact tag
β R5: Agent β ready β unchanged model β calculator tool β result β model loop
β R6: readiness module matches exact tags only (':latest' normalization for bare names)
β A: Gemma 4 E4B metadata matches verified source snapshot
β B: Gemma 4 12B metadata matches verified source snapshot
β C: Qwen 3.5 4B metadata matches verified source snapshot
β D: Qwen 3.5 9B metadata matches verified source snapshot
β E: GPT-OSS 20B metadata matches verified source snapshot
β F: Capability fields match source snapshot
β G: Ollama display sizes and short digests match source snapshot
β H: Current model discovery finds newly added model families including Qwen 3.8
β I: Retired / unavailable models are never recommended
β J: Stale metadata cannot be presented as 'current' or recommended
β K: 24 GB Apple Silicon recommends only models that pass current hardware policy
β L: 8 GB CPU-only does not receive artificially inflated model-capacity bonuses
β M: Tool-calling selection depends on verified capability data
β N: Discrepancy detector flags discrepancies when curated registry disagrees with observations
β O: Runtime verified models and runtime pending models are strictly distinguished
β P: Recommendation transparency and score factor accuracy
β A: Chat starter generation produces standard file set
β B: Agent starter generation produces tool-calling file set
β C: Exact selected Ollama tag is injected into config, code, and README
β D: README contains exact setup commands in sequence
β E: Agent generation rejects a no-tools model with exact error message
β F: Generated file paths are valid relative paths and JSON files parse cleanly
β G: Generated project is 100% deterministic across multiple runs
β H: Retired, unverified, or arbitrary models cannot bypass safety gates
β I: Generated templates do not access invalid readline.clearLine or cursorTo
β J: Calculator tool security audit β zero eval, zero Function, strict validation, correct arithmetic
β K: Starter API route enforces strict model safety and capability verification
β L: Starter Workbench setup flow prerequisites and command contract
βΉ tests 36
βΉ suites 0
βΉ pass 36
βΉ fail 0
Yes. Modern open-weight small language models (such as phi4-mini at 2.5 GB or qwen3.5:4b at 3.4 GB) run efficiently on standard modern x86/ARM CPUs using Ollama's SIMD and AVX-512 optimizations. On Apple Silicon (M1βM6), the CPU and GPU share high-bandwidth Unified Memory, giving desktop-grade performance on thin laptops.
- Minimum: 8 GB RAM allows comfortable execution of 2Bβ4B parameter models.
- Sweet Spot: 16 GB RAM runs 7Bβ12B models (e.g.,
gemma4:12borqwen3.5:9b) at full speed with generous context windows. - Power User: 32 GBβ64 GB RAM unlocks 27Bβ35B parameter reasoning models and coding specialists.
- Local Privacy & Data Control: Prompts, code, and documents run directly on your machine instead of being transmitted to third-party cloud servers.
- Zero Incurred Usage Fees: No subscription tiers, no per-token billing, and no credit card required.
- Offline Resilience: Functions completely disconnected from external networks (airplanes, field work, secure offline environments).
- No Cloud Rate Limits: Requests are bound only by your local hardware capabilities, without artificial vendor request caps or token-per-minute throttling.
- Ollama is the runtime engine (analogous to the Node.js runtime or Docker daemon) that manages model execution.
- Hack Day Starter is the developer bootstrapper that profiles your machine, recommends the best model for your exact hardware, and scaffolds a complete TypeScript application with zero runtime dependencies.
The open-weight model is trained to recognize when a query requires a tool. It outputs a structured JSON object specifying the tool name and arguments. Your local TypeScript runtime executes the function on your machine (e.g., querying a local database or running a math parser) and returns the output to the model to generate the final response.
βββ app/
β βββ api/recommend/route.ts # Hardware scoring & model recommendation API
β βββ api/starter/route.ts # Starter generation & model safety gating API
β βββ globals.css # Dark theme & UI layout styling
β βββ layout.tsx # Root layout & SEO metadata
β βββ page.tsx # Hardware profiler, model picker & ZIP downloader
βββ lib/
β βββ types.ts # Core TypeScript interfaces & registry schemas
β βββ registry.ts # Curated Verified Model Registry
β βββ memory-calculator.ts # Authoritative vs estimated memory heuristics
β βββ recommend.ts # Deterministic recommendation scoring engine
β βββ sources/
β β βββ ollama.ts # Ollama library observation scraper & parser
β βββ starter/
β βββ types.ts # Starter project types
β βββ generate.ts # In-memory deterministic project generator
β βββ templates/
β βββ chat.ts # Zero-dependency Local Chat template
β βββ agent.ts # Autonomous Tool-Calling Agent template
β βββ readiness.ts # Ollama daemon & model readiness check template
βββ scripts/
β βββ sync-model-registry.ts # Automated registry discovery & discrepancy checker
βββ tests/
β βββ recommend.test.ts # Tests AβP: 16 recommendation, transparency & registry tests
β βββ starter.test.ts # Tests AβL: 12 starter generation, security & setup flow tests
β βββ readiness.test.ts # Tests R1βR6: 8 readiness & runtime integration tests
βββ package.json
βββ LICENSE # MIT License
βββ README.md
Contributions to improve hardware profiling heuristics, expand verified model registry snapshots, or add new starter templates are welcome!
- Fork the repository
- Create a feature branch:
git checkout -b feature/model-sync - Ensure all tests pass:
npm test - Submit a Pull Request
Distributed under the MIT License. See LICENSE for details.
Built with β€οΈ for Hacktoberfest 2026 β Weekend Challenge: Build for a Friend.