git404hub

what is gemma4.pas fr?

tinybiggames/gemma4.pas — explained in plain English

Analysis updated 2026-05-18

27PythonAudience · developerComplexity · 3/5Setup · moderate

tl;dr

A self-contained AI engine, written in Delphi, that runs Google's Gemma 4 model locally on Windows using your GPU.

vibe map

mindmap
  root((Gemma4.pas))
    What it does
      Local Gemma 4 inference
      Runs on GPU via Vulkan
      Zero dependencies
    Tech stack
      Delphi
      Pascal
      Vulkan compute
      SQLite
    Use cases
      Local text generation
      Image audio video understanding
      Semantic search
      Tool calling agent
    Audience
      Delphi developers
      Privacy conscious users
    Application layer
      Persistent memory
      Interactive chat
      KV cache save restore

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Add local, offline AI text generation to a Delphi or Pascal application.

VIBE 2

Build an assistant that can understand images, audio, and video without cloud APIs.

VIBE 3

Set up semantic search or retrieval over documents using the bundled embedding model.

VIBE 4

Create a tool-using agent that can check weather, search the web, or read files.

what's the stack?

DelphiPascalVulkanSQLite

how it stacks up fr

tinybiggames/gemma4.pasavbiswas/sam2-mlxchanthruu/wind_energy_monitor
Stars272727
LanguagePythonPythonPython
Setup difficultymoderatemoderatemoderate
Complexity3/54/53/5
Audiencedeveloperresearcherdata

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · moderate time til it works · 30min

Requires downloading a large packaged model file from HuggingFace and Delphi 12 Athens or later to build.

License terms are not stated in the explanation.

in plain english

Gemma4.pas is a complete AI inference engine for Google's Gemma 4 E4B model, written entirely in Delphi and Pascal. It has no dependency on Python, C, or C++ under the hood, and no third-party libraries at all. You load a single packaged model file, called a VPK archive, and call one function to start generating streamed responses from your GPU. The engine covers the full range of what Gemma 4 E4B can do: generating text with an optional private reasoning step before answering, understanding images at different levels of detail, understanding audio from WAV files, and sampling frames from video clips to describe what is happening in them. All of the heavy math, like matrix operations and attention calculations, runs on the GPU through Vulkan compute shaders rather than the CPU. The project also bundles a smaller model called EmbeddingGemma300m for turning text into embeddings, which is useful for semantic search and retrieval tasks, often called RAG. On top of the core engine sits an optional application layer with higher level building blocks: a tool calling system so the model can trigger functions like checking the weather or searching the web, a persistent memory system backed by SQLite that supports both keyword and vector based recall, and a ready made interactive chat interface with slash commands for saving state, adding facts, and restoring past conversations. This project is aimed at Delphi and Pascal developers who want local AI without leaving their existing toolchain, at application developers who want a single file engine with full multimodal support on consumer hardware, and at privacy conscious users who want an assistant that never sends data over the network. To get started, you download the packaged model from HuggingFace, open the included testbed project in Delphi 12 Athens or later, and build it for Win64.

prompts (copy fr)

prompt 1
Show me how to load the Gemma4.vpk model and generate a text response using TInference in Delphi.
prompt 2
Help me write Pascal code that sends an image to Gemma4.pas and asks it to describe the image.
prompt 3
Explain how the TMemory and TSession classes work together to give the assistant persistent memory.
prompt 4
Walk me through registering a custom tool with TToolRegistry so the model can call my own function.
prompt 5
Show me how to save and restore the GPU KV cache so a conversation can resume with a warm prefix.

Frequently asked questions

what is gemma4.pas fr?

A self-contained AI engine, written in Delphi, that runs Google's Gemma 4 model locally on Windows using your GPU.

What language is gemma4.pas written in?

Mainly Python. The stack also includes Delphi, Pascal, Vulkan.

What license does gemma4.pas use?

License terms are not stated in the explanation.

How hard is gemma4.pas to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is gemma4.pas for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.