Skip to main content

LM Code

LM Code is a powerful AI coding assistant for your terminal supporting 17 free models via OpenRouter. Chat with AI models, automate file operations, and boost 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.
  • 17 Free Models via OpenRouter:
    • NVIDIA Nemotron, Qwen, OpenAI, Meta Llama, Mistral, and more.
  • Automated Tool Usage:
    • File operations: view, edit, 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

pip install code-lm

Method 2: Install from Source

git clone https://github.com/Panagiotis897/lm-code.git
cd lm-code
pip install -e .

Setup

Before using LM Code, set up your API key for OpenRouter.

lmcode setup YOUR_OPENROUTER_API_KEY

This saves your API key in ~/.config/lm-code/config.yaml.


Usage

Start an Interactive Session

# Start with the default model (NVIDIA Nemotron 3 Super 120B)
lmcode

# Start with a specific model
lmcode --model qwen/qwen3-coder:free

Manage Models

# Set a default model
lmcode set-default-model qwen/qwen3-coder:free

# List all available models
lmcode list-models

Supported Models

Model ID Context Strength
NVIDIA Nemotron 3 Super 120B nvidia/nemotron-3-super-120b-a12b:free 262K Default
Qwen3 Coder 480B qwen/qwen3-coder:free 262K Best coding
OpenAI GPT-OSS 120B openai/gpt-oss-120b:free 131K Open source
Llama 3.3 70B meta-llama/llama-3.3-70b-instruct:free 66K General purpose
Mistral Small 3.1 24B mistralai/mistral-small-3.1-24b-instruct:free 128K Vision + tools
Qwen3 Next 80B A3B qwen/qwen3-next-80b-a3b-instruct:free 262K Tool calling
NVIDIA Nemotron Nano 9B v2 nvidia/nemotron-nano-9b-v2:free 128K Fast
Trinity Large Preview arcee-ai/trinity-large-preview:free 131K Reasoning
Trinity Mini arcee-ai/trinity-mini:free 131K Fast & efficient
GLM 4.5 Air z-ai/glm-4.5-air:free 131K Tool calling
Step 3.5 Flash stepfun/step-3.5-flash:free 256K Tool calling
MiniMax M2.5 minimax/minimax-m2.5:free 197K Tool calling
OpenAI GPT-OSS 20B openai/gpt-oss-20b:free 131K Lightweight
Gemma 3 27B google/gemma-3-27b-it:free 131K Vision
Qwen3 4B qwen/qwen3-4b:free 41K Ultra lightweight
Hermes 3 Llama 3.1 405B nousresearch/hermes-3-llama-3.1-405b:free 131K Large Llama
Llama 3.2 3B meta-llama/llama-3.2-3b-instruct:free 131K Tiny & fast

Interactive Commands

During an interactive session:

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

How It Works

LM Code uses native tools to enhance your coding experience:

  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.

Development

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

Changelog

v0.3.0

  • Updated default model to NVIDIA Nemotron 3 Super 120B.
  • Added 17 free models from OpenRouter (previously 6).
  • Fixed ModuleNotFoundError: No module named 'gemini_cli' from stale entry point.
  • Fixed UnicodeDecodeError on Windows (cp1253) for all subprocess commands.
  • Fixed API URL (/chat/completions was missing) causing HTML response errors.
  • Improved API error handling for empty/invalid responses.
  • Added API key validation on startup.
  • Tool parameter descriptions now use args_schema when available.
  • Removed conflicting logging.basicConfig from openrouter module.
  • Added UTF-8 encoding with fallback to all subprocess calls.

v0.2.5

  • Added more models to the model list.
  • Fixed crucial bugs from previous versions.
  • Removed Gemini models.
  • Updated models to latest versions.

v0.1.0

  • Rebranded from Gemini to LM Code.
  • Integrated OpenRouter as the default provider.
  • Added multi-model support.
  • Overhauled CLI commands (gemini -> lmcode).

Future Plans

  • Pricing with appropriate rate limits.
  • Non-free model support.
  • MCP Server integration.
  • Additional providers.

Known Issues

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

License

MIT License

Metadata

Release files for code-lm 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for code-lm 0.3.0
File Size Uploaded
code_lm-0.3.0.tar.gz 30.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for code-lm 0.3.0
File Interpreter ABI Platform
code_lm-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 66.8 kB

Release files / code_lm-0.3.0.tar.gz

Download URL code_lm-0.3.0.tar.gz
Size 30.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a08d41ff0e317ff90daf8e818349b00fbdcdb6b79300d581f4b23fd949a5799c
BLAKE2b-256 checksum
How to use checksums
a8340d91ae0e71decc82b9ec46c4acbb04d0a047afc1465f92cbdd8ba2fb3326
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Release files / code_lm-0.3.0-py3-none-any.whl

Download URL code_lm-0.3.0-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aec96b8295a016de5d67fc6486f4c4fdafd9e06d687159a5f305f46c4e6abc67
BLAKE2b-256 checksum
How to use checksums
17b0558cd99e69d2b900b7e6f685338d1fa723faedc0518dd58df17ec0788803
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page