Skip to content

onurege3467/gemchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📸 GemChat — Talk to Gemma 4 12B from your terminal

GemChat is a fast, lightweight Go CLI for Google's Gemma 4 12B — the latest encoder-free multimodal model. Send text prompts, analyze images, pipe data, and get answers instantly. Single binary, zero dependencies.

# Text chat
gemchat "What is the meaning of life?"

# Multimodal — analyze images
gemchat -i chart.png "Explain this data visualization"

# Pipe data in
tail -100 server.log | gemchat --pipe "Find the errors:"

Why Gemma 4 12B?

Google just released Gemma 4 12B — a unified, encoder-free multimodal model that processes images natively as tokens rather than using a separate vision encoder. This architectural shift means better understanding of visual context and more coherent multimodal reasoning. And it's free for developers via the Gemini API.

Features

  • 🎯 Text generation — any prompt, any task
  • 🖼️ Image analysis — PNG, JPG, WebP, GIF, BMP
  • 📡 Pipe supportcat file | gemchat --pipe "summarize:"
  • 📝 System instructions — set persona/context with -s
  • 🌡️ Configurable — temperature, max tokens, model selection
  • 🎨 Clean output — plain text by default, JSON with -json
  • Single binary — no Python, no Node, no runtime deps

Installation

Option 1: Download binary (recommended)

# Linux x86_64
curl -sL https://github.com/onurege3467/gemchat/releases/latest/download/gemchat-linux-amd64 -o /usr/local/bin/gemchat
chmod +x /usr/local/bin/gemchat

Option 2: Build from source

git clone https://github.com/onurege3467/gemchat.git
cd gemchat
go build -o gemchat .
sudo mv gemchat /usr/local/bin/

Option 3: Use the LLM agent prompt (see INSTALL.md)

Quick Start

1. Get an API key

Get a free key from Google AI Studio.

2. Set your key

# Option A: environment variable
export GEMINI_API_KEY="your-key-here"

# Option B: config file (persistent)
mkdir -p ~/.gemini
echo "your-key-here" > ~/.gemini/api-key
chmod 600 ~/.gemini/api-key

3. Start chatting

# Basic chat
gemchat "Explain quantum entanglement like I'm 10"

# With system instruction
gemchat -s "You are a helpful Python tutor" "Explain decorators"

# Multimodal
gemchat -i screenshot.png "What error is shown in this screenshot?"

# Pipe mode
curl -s https://news.ycombinator.com | gemchat -s "You are a tech analyst" --pipe "Summarize the top stories on this page"

# Raw JSON output
gemchat -json "List 3 colors" | jq '.candidates[0].content.parts[0].text'

Advanced Usage

Model selection

# Instruction-tuned variant (default for chat)
gemchat -m gemma-4-12b-it "Write a poem"

# Base model (for completion tasks)
gemchat -m gemma-4-12b "Continue this code:\n\nfunc main() {"

Temperature control

# Precise (default 0.7)
gemchat -t 0.2 "What is 2+2?"

# Creative
gemchat -t 1.5 "Write a haiku about programming"

Max tokens

# Longer responses
gemchat -max-tokens 16384 "Explain the history of computing in detail"

CI/CD Integration

Use GemChat in GitHub Actions for AI-powered analysis:

name: AI Review
on: [pull_request]
jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install GemChat
        run: |
          curl -sL https://github.com/onurege3467/gemchat/releases/latest/download/gemchat-linux-amd64 -o /usr/local/bin/gemchat
          chmod +x /usr/local/bin/gemchat
      - name: Review code
        env:
          GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
        run: |
          gemchat -s "You are a code reviewer. Be concise." "Review this PR diff: $(git diff main...HEAD)"

How It Works

GemChat calls the Google Gemini API under the hood, targeting the gemma-4-12b or gemma-4-12b-it model. The model is encoder-free — it processes images as raw token sequences without a separate vision encoder, giving it more coherent multimodal understanding.

Configuration

Flag Default Description
-m gemma-4-12b Model name
-i "" Image path (PNG, JPG, WebP, GIF, BMP)
-s "" System instruction
-t 0.7 Temperature (0.0–2.0)
-max-tokens 8192 Max output tokens
-pipe false Read prompt from stdin pipe
-json false Output raw JSON

Project Status

Active. Gemma 4 12B is brand new (June 2026) — expect rapid iterations.

Contributing

PRs welcome! See CONTRIBUTING.md. Small, focused changes preferred.

License

MIT — see LICENSE.


Built with Go + ☕ for Google's Gemma 4 12B

About

Fast Go CLI for Google's Gemma 4 12B encoder-free multimodal model — text chat, image analysis, pipe support

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages