Skip to main content

CLI for Lunar API - chat completions and semantic routing

Project description

Lunar CLI

Command-line interface for the Lunar API - chat completions and semantic routing.

Install

pip install -e .

Quick Start

# Configure authentication
lunar config set api-key YOUR_API_KEY

# Chat completion
lunar chat "Hello world" -m gpt-4o-mini

# Streaming
lunar chat "Explain recursion" -m claude-3-5-sonnet --stream

# Semantic routing - picks the best model for your prompt
lunar router route "Explain quantum computing" -m gpt-4o-mini,claude-3-5-sonnet

# Routing with cost optimization
lunar router route "Write a poem" -m gpt-4o-mini,claude-3-5-sonnet -c 0.5

# Dry run - see routing decision without executing
lunar router route "Hello" -m gpt-4o-mini,claude-3-5-sonnet --dry-run

# List models and providers
lunar models
lunar providers -m gpt-4o-mini

Commands

Command Description
lunar chat Send a chat completion request
lunar router route Route a prompt to the best model
lunar router profiles List semantic routing profiles
lunar models List available models
lunar providers List available providers
lunar config show Show current configuration
lunar config set Set a config value
lunar config get Get a config value
lunar config delete Delete a config value

Configuration

Config is stored in ~/.lunar/config.json. Environment variables are used as fallbacks:

Config Key Env Variable Description
api-key LUNAR_API_KEY API key
jwt LUNAR_JWT JWT token
environment LUNAR_ENV dev or prod (default: prod)
base-url - Custom API base URL
timeout - Request timeout in seconds

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

lunar_cli-0.1.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

lunar_cli-0.1.0-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file lunar_cli-0.1.0.tar.gz.

File metadata

  • Download URL: lunar_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for lunar_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f4da6f9eaba0fa01c78e793e6972a30758ddfce9b9b4c20badd50145d034c6fe
MD5 6b6a4c45d25edd906a4435671529d091
BLAKE2b-256 68392a122c017bae68b091c4b72df7fb7a974274e67bf958c97432b347fd0e0d

See more details on using hashes here.

File details

Details for the file lunar_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lunar_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for lunar_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 983dbcbab779cb31e4ff54efb27b10bd63f79df80781283d9aa2c6aaace26fc3
MD5 d23f41167c404d993a6c33c1056357f3
BLAKE2b-256 06a1ac5633d84117eddfb51bdbb571364d926552a15846f5dc8bc3d129bca41b

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