Skip to main content

A lightweight TUI coding assistant using Gemini API free tier

Project description

VerySmolCode

A lightweight TUI coding assistant powered by Gemini API free tier, designed for resource-constrained devices like Raspberry Pi 3.

Features

  • Smart Model Routing: 6 models across Gemini 3.x and 2.5 — automatically selects the best available model based on task complexity, with graceful fallback when rate-limited or overloaded
  • Planning Mode: /plan for read-only analysis using Pro models before making changes
  • Full Tool Suite: File read/write/edit, grep search, find files, git operations, shell commands, web fetch, image reading (18 tools)
  • MCP Support: Connect to MCP servers (context7, playwright, etc.) via /mcp-add — tools are live in the agent loop
  • Critic Verification: After tool use, a lightweight model verifies the work was done correctly
  • Token-Aware: /tokens dashboard, /fast//smart model selection, rate limit warnings, conversation compaction, and thinking budget control
  • Safe by Default: Blocks destructive operations, validates paths, and prevents dangerous commands
  • Lightweight: ~5MB binary, minimal memory footprint, runs on Raspberry Pi 3

Installation

With pip (Python)

Pre-built wheels available for Linux (x86_64, aarch64, armv7), macOS (Intel + Apple Silicon), and Windows (x86_64):

pip install verysmolcode

From Source (Rust)

# Install Rust if needed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Clone and build
git clone https://github.com/marcelotournier/verysmolcode.git
cd verysmolcode
cargo install --path .

From Source (Python wheel)

pip install maturin
git clone https://github.com/marcelotournier/verysmolcode.git
cd verysmolcode
maturin develop --features python

Usage

# Set your Gemini API key (get one free at https://aistudio.google.com/apikey)
export GEMINI_API_KEY=your_key_here

# Run VerySmolCode
vsc

Commands

Command Description
/help Show available commands and keybindings
/fast Use Flash models for next message (saves budget)
/smart Use Pro models for next message (best quality)
/plan Toggle planning mode (read-only, Pro model)
/undo Undo the last batch of file changes
/save Save conversation to file: /save [filename]
/tokens Show detailed token usage and rate limits
/status Show rate limits and token usage
/model Show available models and rate limits
/config Show current configuration
/config set Edit config: /config set temperature 0.5
/compact Manually compact conversation to save tokens
/mcp List configured MCP servers
/mcp-add Add MCP server: /mcp-add name command [args]
/mcp-rm Remove MCP server: /mcp-rm name
/version Show version information
/clear Clear conversation and screen
/quit Exit VerySmolCode

Keybindings

Key Action
Ctrl+C Cancel/Quit
Ctrl+L Clear screen
Up/Down Input history
PgUp/PgDn Scroll output
Tab Auto-complete
Ctrl+A/E Home/End of line
Ctrl+U/K Clear line before/after cursor
Ctrl+W Delete word backward

Model Tiers (Free Tier)

Model RPM RPD Best For
Gemini 3.1 Pro 5 25 Complex tasks
Gemini 3 Flash 10 250 General coding
Gemini 3.1 Flash-Lite 15 1000 Simple tasks
Gemini 2.5 Pro 5 25 Fallback complex
Gemini 2.5 Flash 10 250 Fallback general
Gemini 2.5 Flash-Lite 15 1000 Fallback simple

VerySmolCode automatically manages rate limits across all 6 models independently. When one model is exhausted, it falls back to the next available one. Gemini 3 models are preferred; 2.5 models serve as fallbacks, effectively doubling your daily quota per tier.

Configuration

Config file is stored at ~/.config/verysmolcode/config.json. You can edit it directly or use /config set in the TUI:

/config set temperature 0.5     # Lower = more focused, higher = more creative
/config set max_tokens 2048     # Limit response length to save tokens
/config set compact_threshold 16000  # Compact conversation earlier
/config set safety off          # Disable safety checks (not recommended)

Default values:

{
  "max_tokens_per_response": 4096,
  "max_conversation_tokens": 32000,
  "temperature": 0.7,
  "auto_compact_threshold": 24000,
  "safety_enabled": true
}

Architecture

src/
  main.rs           - Entry point
  config.rs         - Configuration management
  api/
    client.rs       - Gemini REST API client with fallback
    models.rs       - 6 model definitions, rate limiting, routing
    types.rs        - Request/response type definitions
  agent/
    loop_runner.rs  - Main agent loop with planning mode and critic
  tools/
    file_ops.rs     - File read/write/edit/list + image reading
    grep.rs         - Search and find files
    git.rs          - Git operations and shell commands
    web.rs          - Web page fetching
    registry.rs     - Tool registration and dispatch (18 tools)
  mcp/
    client.rs       - MCP client (stdio JSON-RPC 2.0)
    config.rs       - MCP server configuration
    types.rs        - MCP protocol types
  tui/
    app.rs          - Application state and event handling
    ui.rs           - Terminal UI rendering
    input.rs        - Keyboard input handling
    commands.rs     - Slash command processing

Testing

# Unit tests (213 tests)
cargo test

# Integration test (requires tmux + GEMINI_API_KEY)
./tests/integration_test.sh

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

verysmolcode-0.8.2.tar.gz (73.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

verysmolcode-0.8.2-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

verysmolcode-0.8.2-cp313-cp313-manylinux_2_28_armv7l.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

verysmolcode-0.8.2-cp313-cp313-manylinux_2_28_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

verysmolcode-0.8.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

verysmolcode-0.8.2-cp313-cp313-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

verysmolcode-0.8.2-cp313-cp313-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

File details

Details for the file verysmolcode-0.8.2.tar.gz.

File metadata

  • Download URL: verysmolcode-0.8.2.tar.gz
  • Upload date:
  • Size: 73.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.6

File hashes

Hashes for verysmolcode-0.8.2.tar.gz
Algorithm Hash digest
SHA256 ebccb594cfb4f3c854af679704a437d26c8a0f352eea17f64f2eedcfa17dc731
MD5 992f72c0ca4076a6bd0a3380e8624230
BLAKE2b-256 881ec623f21de316c5e8c2b651c7c1532336864de85d33adb1c1989829cff732

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 984c425022ec2e5a7177452f0fb7f0a73d6ac9f686211c34ff6fa95111f46976
MD5 da1b8d0f8a1b4792727f3a310ec8eec8
BLAKE2b-256 5c233d3dbedc6a754dd30bcc76df6cb61740a1e968edd2bad321c41d5660fce3

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.2-cp313-cp313-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.2-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 089a24bc33fc296a52e99e8c165ab5a6131c32f57b735b7c6690df30d5da4d9e
MD5 3817b23877120b8183d338a907b6427a
BLAKE2b-256 d4eff31505a65538ee3445623ad914ecb510742eca6fd0739e19164c9ca0d727

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.2-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.2-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 454efdf9b123ec7fcecb87e0fb303c4a282eeb7339a3d0a0ae5bb505555f90b0
MD5 0d7047eb58dbb101179c390f33ba7904
BLAKE2b-256 7f488415a661702cb1436cb2bf32d0d5b90dab0f9c35f8cfda6c19b6ba3c43fd

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c022ce3cb3a645f132ebcab55a7ef9b931edbeda479f489aa5f8c1520bffc023
MD5 e1f4afab73745594faeee190cfc0d84f
BLAKE2b-256 85b1b23cbd6eda7743b5b564ba55d7db745a84f32aba39facdc60043e3911af3

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b3bb353e0e599319bd3fb881aa9948adf0d1e408351ee4c7338b949dd0ef5149
MD5 de82e3fc59a7963a9ab93d60a64604a9
BLAKE2b-256 82c4e095a4b0b93a7bab7e8b016556e8b839acc4594a3010ab60c51405c31d30

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.2-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.2-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1dec18bc8f38706ee002d9052535112f17b1e93542f8d44ed2d9f9697107209e
MD5 012465f6761f14afdd265ed9a0abb9f6
BLAKE2b-256 e7c642d42beaeddb5c9820a1ccba976d76a97cb743d441f7d11d718d5399c11a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page