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.2.tar.gz (16.9 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.2-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zen_completions-0.1.2.tar.gz
  • Upload date:
  • Size: 16.9 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.2.tar.gz
Algorithm Hash digest
SHA256 81d0839e4891c04f284875af9b64eac580225983653f2069bb662b5a69efffdb
MD5 ed0751e3d0d5d479f1352fee5a852046
BLAKE2b-256 4ce792116331e6ea60414f1015bdfe961d0cb2300be3fb4003c4eb66c232df9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zen_completions-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a49cbe337016713b8d4c86a43a8158faf0e9a90a5ef2f713d17d44deb3178d49
MD5 6755b8a384acf9b48ede9f87371db23e
BLAKE2b-256 79a094fcc4a45a5bf4278549473cf03aea452c79b886a8e7a3ed5d37f3f5a9da

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