llm-openrouter  by simonw

Access OpenRouter LLMs via CLI

Created 2 years ago
277 stars

Top 93.5% on SourcePulse

GitHubView on GitHub
Project Summary

This plugin integrates the LLM command-line utility with models hosted on OpenRouter, providing a unified interface to a vast array of LLMs. It targets developers and power users seeking efficient access to diverse AI models, including multimodal and structured output capabilities, directly from their terminal. The primary benefit is streamlined interaction with numerous LLMs without needing individual API integrations for each.

How It Works

The llm-openrouter plugin installs directly into the LLM environment. Users authenticate via an OpenRouter API key, which can be configured as an environment variable or stored using LLM's key management. This allows users to list, select, and prompt any model available through OpenRouter using standard LLM commands, abstracting away the complexities of different model providers.

Quick Start & Requirements

  • Installation: llm install llm-openrouter
  • Prerequisites: The LLM command-line utility must be installed. An OpenRouter API key is required, obtainable from OpenRouter. Set the key via the OPENROUTER_KEY environment variable or llm keys set openrouter.
  • Links: OpenRouter API key: https://openrouter.ai/

Highlighted Details

  • Broad Model Access: Supports listing and interacting with numerous models from various providers via OpenRouter.
  • Multimodal Capabilities: Enables image input for vision-aware models (e.g., Claude 3.5 Sonnet, Gemini Flash 1.5).
  • Structured Output: Facilitates schema-based JSON output generation for compatible models.
  • Tool Integration: Allows models to utilize external tools through LLM's tool-calling framework.
  • Advanced Configuration: Offers control over reasoning effort, enabling reasoning features, and specific provider routing (e.g., quantization).
  • RAG Augmentation: Integrates with Exa search results for RAG-like functionality using the -o online 1 option.
  • Model Discovery: Provides commands (llm models -q openrouter, llm openrouter models) to view model details including context length, architecture, and pricing.

Maintenance & Community

The plugin is developed by Simon Willison. Specific details regarding community channels, roadmap, or active maintenance beyond the provided README were not present in the documentation snippet.

Licensing & Compatibility

The license type is not specified in the provided README content.

Limitations & Caveats

The quality of schema support varies significantly between models, necessitating careful testing. The availability of features like multimodality or tool use is dependent on the specific OpenRouter-hosted model being utilized.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
2
Star History
7 stars in the last 30 days

Explore Similar Projects

Starred by Patrick von Platen Patrick von Platen(Author of Hugging Face Diffusers; Research Engineer at Mistral), David Cournapeau David Cournapeau(Author of scikit-learn), and
3 more.

codecompanion.nvim by olimorris

0.8%
6k
Neovim plugin for AI-powered coding assistance
Created 1 year ago
Updated 13 hours ago
Feedback? Help us improve.