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 (218 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.3.tar.gz (74.6 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.3-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

verysmolcode-0.8.3-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.3-cp313-cp313-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

verysmolcode-0.8.3-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.3.tar.gz.

File metadata

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

File hashes

Hashes for verysmolcode-0.8.3.tar.gz
Algorithm Hash digest
SHA256 879ac3e662a758acfc46a838e91e65aa2877a45770680ff9bed8963b7123156b
MD5 c52b9961893676cf415d93101e6e564b
BLAKE2b-256 17a92eb08c25249bb9953635e41c3401bbb6a8b397dea54868137b71b24d1a3a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.8.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5b1776e26120e095ed816f59da21a4485838d1b51f05d87aa9b161c8113ea14d
MD5 1cd61716df900156ca1300e72b13d4fd
BLAKE2b-256 8354f4bc868e2949d60a2970f1e2d9fcaf97e66b81c26837f0a905a6fb4e19aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.8.3-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 f6f28a6836bb35363c5ff8773d42dc6d13c155692083fc202bcb6202389e5f92
MD5 f1d7321cb9bedb547bf3287dcb6aa161
BLAKE2b-256 bbe2a6652d7d5270ca91b326938e473bc39e531cebd426afedc2c3d732d80a22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.8.3-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e735746a3e134a1c76b4f1e956b84ced7b1c49774fe6922d7781ce2fa8dd102c
MD5 197e8c6d90ee5625a29e579302d1833f
BLAKE2b-256 43761eb30a7896ad60f468b8db043e51d93c45d4695a1c839473d6b8ba635f8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.8.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4a90c1983fde56a750514b0d6e9a262da737e4626700c65f6be508c7f4f4ea79
MD5 38fb37c7bebf00860839925d113a5416
BLAKE2b-256 f741faf0fb070f664b81be318dca5b7e871d0b890a635673829f2b49a216bd3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.8.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed50898af5af295ba20745b62863620bd50af7c5ffb82248c7298ba4a4be96b2
MD5 fa5678c91f55b1755b8a00aca2e62413
BLAKE2b-256 3e88a64c11c6729240bbb401e2e102568a68b0ca38bb7809a0e991112a7eac1d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.8.3-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4cdf1d428aa62b0c1fdbde7c3cff3e3c2943d9557675a46eafaea6da998310dc
MD5 06bc2f5bdfb193ad46c346c803fbabf1
BLAKE2b-256 a93a4f82055803fca329469a35e3f03409ab53738bf2a59632531d139b502a60

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