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 (222 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.4.tar.gz (75.5 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.4-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

verysmolcode-0.8.4-cp312-cp312-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.12Windows x86-64

verysmolcode-0.8.4-cp312-cp312-manylinux_2_28_armv7l.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARMv7l

verysmolcode-0.8.4-cp312-cp312-manylinux_2_28_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

verysmolcode-0.8.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

verysmolcode-0.8.4-cp312-cp312-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

verysmolcode-0.8.4-cp312-cp312-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

verysmolcode-0.8.4-cp311-cp311-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.11Windows x86-64

verysmolcode-0.8.4-cp311-cp311-manylinux_2_28_armv7l.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARMv7l

verysmolcode-0.8.4-cp311-cp311-manylinux_2_28_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

verysmolcode-0.8.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

verysmolcode-0.8.4-cp311-cp311-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

verysmolcode-0.8.4-cp311-cp311-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for verysmolcode-0.8.4.tar.gz
Algorithm Hash digest
SHA256 dadf9d9e7752a9261bb6b111da745c24c7d394578357b09250c81cadbc0392fe
MD5 f62d219c5f0ece22cdeae1070bf180f7
BLAKE2b-256 5f2c320907bc0e3d84b10d4b43f7ad108fc49ee5ee58dcea6f0b24a073d195a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e523c10af67e3c8a526af062e7e23fcd66f859b75f1ee612fde4702672eb7c3e
MD5 cde6bf0d0029547058520f1e1ba11488
BLAKE2b-256 941a7a7c4174d8ff04ee8c22c76f4783aa9faf22b05c85c2f401e9f2b1b9b489

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 c03bd234849292f01378e5959ea60c25a03d738a3bb016af7d80dd92530521b4
MD5 86c54473708f1ebdaec06ac7469166b3
BLAKE2b-256 570ec997fadf9f59301347f71a598abe4dab402a08fa75fd5d63ca8d2e19424c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d50aff22e22c2dd4116136719c52f75083744ebfe5041ff88899f4d1ab3f8359
MD5 2978fbf6deb98c98da15070a07d163fd
BLAKE2b-256 104902a330f0aae15f9c0d4fd3a8b104dbd045fd9a1d716904b7024ede7c0cf6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cda4b0b32dd3041bda92545a67e31dd30d895b8b9c2ae4d4e90d6f37626338e2
MD5 0aa67a9225f5ce85a3d78a94e0521e65
BLAKE2b-256 884acae5ac06648c5a316a47d36cba87d043068a93cb29316846d60c7557455c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 de23f57374b12a406c2a33aa55ee78a021c44da6cc62de22cbff867800507d28
MD5 6fb60e9689e07779a4ede504a191080b
BLAKE2b-256 d6645309a7ff3cb0ca99e1f7343312ee3175943888cc53967f2e64bd902d3fb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9cd8521ef0a139776a23ff54eec450c0090eab059d54893af97edbc631690696
MD5 c7cb2c9cf60248d33897365ed5eb8e42
BLAKE2b-256 13d17083c3cb8f35d952c90b6d075cb23e4e888d7fe1c6aaf6a85ed595aad8a4

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f999ac95c386e785060aa222b5126549ef6e82b9e2aa85cfb893ccb3c58895d8
MD5 7622f33b065340503f972f9a4e0090c7
BLAKE2b-256 3a962c62827abb60432201d73e2eac373e1af4c5d9d86ee1a68568a764258ffc

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.4-cp312-cp312-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp312-cp312-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 e907132d9aa7a7674d2c47e6fe1d62475cafd3f4fcde1dfdb44841d6ba863072
MD5 a235757fd972090528ec540ea52cf311
BLAKE2b-256 c1ee4281c5eefd882d76feca10a700d54243852fb905485e6eb2cccb372b33a8

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.4-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b2440dc07e615add37a7774277eef3f28ecc33a8062aca03d84a454a9a1fc371
MD5 fee34dba510d534751ac188be26fefdc
BLAKE2b-256 327c9251b00b8c0fa75ccfa2b9484dc46c0a93b8ae6d820c339d86a3ad5ab556

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 333e3660e2d39a4cde191a11760700863f9bf2646f0b52c9a72fe7286bff1a64
MD5 3663f0089213054b6b51b7f6e7810fb5
BLAKE2b-256 f6da5e06fe146bb6dce5cad696092734801da1a540ba0825d3853002615c3c6d

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b8fc942906a8f54b48714f96b9e506819380a388e9626da1a60b63933ba90365
MD5 97a64a9e7bdfa292da81f8d0d874b9b8
BLAKE2b-256 d90dc02e328c5a9d36f691e553c367584f6ca59ff080a3a87e9360c72a0196c8

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.4-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a5b5c1e0b3c471a80dbba8024321212fe302610e932d1a0bf484769fa7e196ec
MD5 045ed333f54fff988d93a542c67c655b
BLAKE2b-256 ade7a720db95f4af09eba8b6007ec6254a8291e83fb59f036bb811f7c466f9e6

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 868b6072f472a37ca3cad08a4d59f815368433753fd46335d0feb6b579eaa44b
MD5 b168f3bc32f9aa0bd5b256e23cb25ac5
BLAKE2b-256 d03783f59b23b3817215fe9bef4bb97c9266d7fe417a5e11950f412c9a5cf3e5

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.4-cp311-cp311-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp311-cp311-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 58f8cb23a597bf325377652f4ef32ce2ad4fa7dba2e949c51559fb355a6cd134
MD5 e2b5144b30825ad14aba49a1092b315c
BLAKE2b-256 8b44aab9d616eed4188c48551f6ff756ea5b175577f0157932313e6e02d8f990

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.4-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 469b2a769fc8079734cadafd6d9f7897c9e43becb23edf5bb543f3f35739a25e
MD5 1bb3d9017101bb18680a02e7d6ea18d7
BLAKE2b-256 9e1c1cff2aee1cdfdc2a2d41c6e437969bd0f630256a41476cb0d1203a1a9c4a

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee1e6d4e228121421ab503402fbe2720756e2a8b00fa30090cdf76f0986090ef
MD5 84c17946b59ff227f7e79fbc95ad39a4
BLAKE2b-256 7380ac145978f8114132eaaa211c3bddcf4e816d2fd92a0498ca7bfabbc7d5ed

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a88290ba6b36c3356dc5e2bec59277628b09acf893c4863355501c288cd28dc9
MD5 974fe50accd47f82897a6c947762f4d5
BLAKE2b-256 fbfd7b852863e444de053a8595284cdd7e4e98262abbf435a94ab7dc909dc313

See more details on using hashes here.

File details

Details for the file verysmolcode-0.8.4-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for verysmolcode-0.8.4-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 937588730bba31f58c32cb3f787483393e04ddb9e470d415b96a92eb689de8fc
MD5 25ae1dcae8ce6e8b3858da7f688ba91a
BLAKE2b-256 0b3ecca2f1c61b67a9238412f397ad0ae195e1543cc4a7b5bf9a07edbb5f0b5c

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