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.0.tar.gz (11.7 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.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zen_completions-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 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.0.tar.gz
Algorithm Hash digest
SHA256 d2d3b19aea72c4f004c2247c0c6e932b8fbb5b5634ddc013515029b363241b9c
MD5 6436c0d89e9bb4d65faa4331ca73a187
BLAKE2b-256 44fdbda17b2997b5e4e2d4e31c205b4b3557d61043580956165446157d7f8086

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zen_completions-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70af385bddf5b0fa42e92478117c0f0d3f876d829fca03b060da0aff82312e57
MD5 90490286aa5f0dced51edc1ecf6fb734
BLAKE2b-256 0367dd9c40507b329e96e62eb0c1c4070711864de6b9002a6038935829227c75

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