Metadata-Version: 2.4
Name: zst1
Version: 0.0.4
Summary: Tangy 1-line Hugging Face & OpenRouter inference wrapper
Author: Cheeky AI Dev
Author-email: dev@example.com
Description-Content-Type: text/markdown
Requires-Dist: transformers
Requires-Dist: torch
Requires-Dist: requests
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: summary

# 🍋 Zest (zst1)

**The Tangiest 1-Line AI Inference Wrapper for Python.**

Why write 20 lines of boilerplate when you can just squeeze a model into one? `zest` provides a unified interface for local Hugging Face pipelines and cloud-based OpenRouter LLMs.

## 🚀 Quick Start

```python
import zest

# Local Hugging Face (Sentiment Analysis)
print(zest.run("hf/distilbert-base-uncased-finetuned-sst-2-english", "I love this!"))

# Cloud OpenRouter (GPT-4o)
# Requires os.environ['OPENROUTER_API_KEY']
print(zest.run("or/openai/gpt-4o", "Explain quantum physics in one sentence."))
```

## 🛠 Available Routes

### 1. Hugging Face (`hf/` prefix)
Uses the `transformers` library to run models locally on your CPU/GPU.
*   **Usage**: `zest.run("hf/your-model-id", "input")` 
*   **Restricted Models**: If you need to access gated models (like Llama), set your token:
    ```python
    import os
    os.environ['HUGGINGFACE_TOKEN'] = 'your_token'
    # OR pass it directly:
    zest.run("hf/meta-llama/Llama-2-7b", "Hi", hf_token="your_token")
    ```

### 2. OpenRouter (`or/` prefix)
Access 200+ LLMs via the OpenRouter API.
*   **Usage**: `zest.run("or/google/gemini-pro-1.5", "Hello world")` 
*   **Requirement**: Set `os.environ['OPENROUTER_API_KEY']`.

## 🛡️ Error Handling (The 'Damn' Level)
`zest` doesn't just crash. It catches:
- **Prefix Errors**: Forgot `hf/` or `or/`? It'll tell you.
- **Auth Errors**: Missing API keys for cloud or restricted models are clearly reported.
- **Network Errors**: Timeouts and HTTP errors from OpenRouter are intercepted.
- **Model Errors**: Invalid Hugging Face model IDs return specific config errors.

## 🧪 Snippets

**Multi-turn Logic (Simplified):**
```python
model = "or/anthropic/claude-3-opus"
prompt = "Tell me a joke."
result = zest.run(model, prompt)
print(f"AI: {result}")
```

**Batch Processing (Local):**
```python
inputs = ["Bad product", "Best ever! "]
results = [zest.run("hf/distilbert-base-uncased-finetuned-sst-2-english", x) for x in inputs]
```

---
*Stay Tangy.* 🍋
