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)

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)
/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 (181 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.7.9.tar.gz (67.9 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.7.9-cp313-cp313-manylinux_2_28_armv7l.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

verysmolcode-0.7.9-cp313-cp313-manylinux_2_28_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

verysmolcode-0.7.9-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

File details

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

File metadata

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

File hashes

Hashes for verysmolcode-0.7.9.tar.gz
Algorithm Hash digest
SHA256 bbcb814ac86e155f0f073534909af7fe51fab5b625d05572fe40e416d609f919
MD5 d407df39bbb5a3007ad1841fde12c6ca
BLAKE2b-256 eefea10b00ef7bc352a516988cb990ba9907d18830b51534120858e99d9f897c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.7.9-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 f8cbcbf8c42364e26d8b1fa96d67ac98c798d873239ccc93246dc9b6cc5541ea
MD5 a5743bf2ae8d9481fdd753c576f63b4f
BLAKE2b-256 fbcc776c1588587fabb6f0b8bfa6da5ee61b60e5edd4b208ae43f39a4996e9ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.7.9-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 879db02983a3bd96e5a854d8b48fed50f7f38d31864202e3c2378373f3b4998b
MD5 864a8461c86bb2804f14bfad55048143
BLAKE2b-256 b462b3a36eb5f82c3d9d27275e67512ad6498b3735dafad109c93826d3921372

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.7.9-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4a7bd3e1c28a438ac0e1b2c75f66b291a255e2befd8d626e19549b7cbe0bed46
MD5 bda984365f5736e3c5ac75ec4136e1e2
BLAKE2b-256 742abd0b19d0577eb0daffe57028ca306188dc77a63beec5c2ba58be695294f7

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