Skip to main content

An AI coding assistant CLI using OpenRouter and various LLM models.

Project description

LM Code

LM Code is a powerful AI coding assistant for your terminal, leveraging the OpenRouter API and supporting multiple LLM models like Qwen, DeepSeek, and Gemini. With LM Code, you can interactively work on coding tasks, automate file operations, and improve your workflow directly from the command line.


Features

  • Interactive CLI with AI Assistance:
    • Chat with AI models for coding advice, file management, and more.
    • Markdown rendering for improved readability.
  • Multi-Model Support:
    • Qwen, DeepSeek, Gemini, and more.
  • Automated Tool Usage:
    • File operations: view, edit, list, grep, glob.
    • Directory operations: ls, tree, create_directory.
    • System commands: bash.
    • Quality checks: linting, formatting.
    • Test running: pytest and similar tools.
  • Customizable Configurations:
    • Easily set default models and API keys.

Installation

Method 1: Install from PyPI (Recommended)

pip install lmcode

Method 2: Install from Source

# Clone the repository
git clone https://github.com/Panagiotis897/lm-code.git
cd lm-code

# Install the package
pip install -e .

Setup

Before using LM Code, you need to set up your API keys for OpenRouter.

Configure API Key

lmcode setup YOUR_OPENROUTER_API_KEY

This saves your API key in the configuration file located at ~/.config/gemini-code/config.yaml.


Usage

Start an Interactive Session

# Start with the default model
lmcode

# Start with a specific model
lmcode --model qwen/qwen-2.5-coder-32b-instruct:free

Manage Models

# Set a default model
lmcode set-default-model deepseek/deepseek-r1:free

# List all available models
lmcode list-models

Supported Models

  • Qwen 2.5 Coder 32B: qwen/qwen-2.5-coder-32b-instruct:free
  • Qwen QWQ 32B: qwen/qwq-32b:free
  • DeepSeek R1: deepseek/deepseek-r1:free
  • Gemma 3 (27B Italian): google/gemma-3-27b-it:free
  • Gemini 2.5 Pro Experimental: google/gemini-2.5-pro-exp-03-25:free

Interactive Commands

During an interactive session, you can use these commands:

  • /exit: Exit the session.
  • /help: Display help information.

How It Works

LM Code uses native tools to enhance your coding experience. For instance:

  1. You ask: "What files are in the current directory?"
  2. LM Code uses the ls tool to fetch directory contents.
  3. The assistant formats and presents the response.

This seamless integration of tools and AI makes LM Code a powerful coding partner.


Development

LM Code is under active development. Contributions, feature requests, and feedback are welcome!

Recent Changes

v0.1.0

  • Rebranded from Gemini to LM Code.
  • Integrated OpenRouter's Qwen model as the default.
  • Added multi-model support for Qwen, DeepSeek, and Gemini.
  • Overhauled CLI commands (geminilmcode).
  • Enhanced configuration to support multiple API providers.

Known Issues

  • If you used earlier versions, you might need to delete your old configuration:
    rm -rf ~/.config/gemini-code
    

License

MIT License

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

code_lm-0.1.2.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

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

code_lm-0.1.2-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

Details for the file code_lm-0.1.2.tar.gz.

File metadata

  • Download URL: code_lm-0.1.2.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for code_lm-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d263fa61d36ba22b45eddf76c3aa212d8585a2c7c1f69d3e7a8f332d4259db75
MD5 0e9eaf3ceb8f2f6d2adcd2c6d9a5e5eb
BLAKE2b-256 c49a341a6a151cb5999365eefb3b5a25884ef01a27b0f2e48aa3ef25c8905340

See more details on using hashes here.

File details

Details for the file code_lm-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: code_lm-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 35.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for code_lm-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 00351e5a04c90045666d35ebc00c7b046a424535a1b1de8168b26e5239faf191
MD5 bc995028e3584fa06587de234002ea5e
BLAKE2b-256 464f5123806d6e403272b1c4b09a7943bbbc4447334e2aee8e3bf1cff3f69c4e

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