Metadata-Version: 2.4
Name: yllm-chat
Version: 0.1.0
Summary: A simple CLI tool for chatting with OpenAI-compatible APIs
Project-URL: Homepage, https://github.com/yashdesai/yllm-chat
Project-URL: Repository, https://github.com/yashdesai/yllm-chat
Project-URL: Issues, https://github.com/yashdesai/yllm-chat/issues
Author: Yash Desai
License-Expression: MIT
License-File: LICENSE
Keywords: ai,chatgpt,cli,llm,openai
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: openai>=1.0.0
Requires-Dist: python-dotenv>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# yllm-chat

A simple CLI tool for chatting with OpenAI-compatible APIs.

## Installation

```bash
pip install yllm-chat
```

## Usage

### Command Line

```bash
# Direct message
yllm "Explain Python decorators"

# With custom system prompt
yllm -s "You are a Python expert" "What are generators?"

# Pipe input
echo "Summarize this" | yllm

# Disable streaming
yllm --no-stream "Hello"
```

### As a Library

```python
from yllm import chat_with_openai

# Streaming (prints to stdout)
chat_with_openai("Hello, world!")

# Non-streaming (returns string)
response = chat_with_openai("Hello", stream=False)
print(response)
```

## Configuration

Set these environment variables (or use a `.env` file):

| Variable          | Required | Description                                      |
| ----------------- | -------- | ------------------------------------------------ |
| `OPENAI_API_KEY`  | Yes      | Your API key                                     |
| `OPENAI_BASE_URL` | No       | Custom API endpoint (for OpenAI-compatible APIs) |
| `OPENAI_MODEL`    | No       | Model to use (default: `gpt-4o-mini`)            |

## Development

```bash
# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

# Lint
ruff check .
```

## License

MIT
