Skip to main content

A CLI tool for interacting with LLMs through a model router

Project description

Zen Completions

A command-line interface for interacting with various LLM providers through a unified model router.

Features

  • Support for multiple LLM providers (OpenAI, Azure OpenAI)
  • Interactive chat mode
  • Single completion mode with system prompt support
  • Consistent interface across different models

Installation

Using pip

pip install git+https://github.com/zenafide/zen-completions.git

Using poetry

poetry add git+https://github.com/zenafide/zen-completions.git

Environment Variables

Configure your API keys using environment variables:

# For OpenAI
export OPENAI_API_KEY=your_openai_api_key

# For Azure OpenAI
export AZURE_OPENAI_API_KEY=your_azure_api_key
export AZURE_OPENAI_API_VERSION=2024-02-15-preview  # Optional
export AZURE_OPENAI_API_BASE=your_base_url  # Optional
export AZURE_OPENAI_DEPLOYMENT_NAME=your_deployment  # Optional
export AZURE_OPENAI_MODEL_NAME=your_model_name  # Optional

Usage

Interactive Chat

Start an interactive chat session:

zen chat

With a system prompt:

zen chat system "You are a coding assistant specialized in Python"

Single Completion

Get a single completion:

zen complete "What is the capital of France?"

With a system prompt:

zen complete "What is the capital of France?" system "You are a geographical expert"

Models and Options

Both commands support these options:

  • --model or -m: Select the model to use
  • --temperature or -t: Set the temperature for generation
  • --max-tokens or -mt: Set the maximum tokens for the response

Example:

zen complete "Write a Python function to calculate factorial" --model gpt-4o --temperature 0.7 --max-tokens 500

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

zen_completions-0.1.1.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

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

zen_completions-0.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file zen_completions-0.1.1.tar.gz.

File metadata

  • Download URL: zen_completions-0.1.1.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for zen_completions-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9b873fb3f5eba0ea90e170eabb7150cd0937d9a09c46e7a4af9b28169351af9e
MD5 853ab191abe0468e98ca12708d575640
BLAKE2b-256 abe7e1f69cd84d222a1dc73f78f67cd96648cdac6ea41f683287c104d86c0f48

See more details on using hashes here.

File details

Details for the file zen_completions-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for zen_completions-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66a7ee8733ae27920c42eee56ff3999c575c5a9208c559b782ba8393043f5674
MD5 f44c341abf02decbce191643a705f7e9
BLAKE2b-256 f7e1ce378abe3a327e14ecea01bb78176dc7f49ca3cca5b311f8105e52441bea

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