# ZePrompter ๐
A powerful and intuitive Python library for managing AI prompt templates and model configurations with built-in versioning, web dashboard, and seamless API.
## Why ZePrompter?
โจ **Simple API**: One-line setup, intuitive manager interface
๐ **Smart Versioning**: Automatic prompt template versioning
๐ค **Model Management**: Centralized AI model configuration storage
๐ **Web Dashboard**: Beautiful built-in interface with authentication
๐พ **Database Agnostic**: SQLite by default, PostgreSQL/MySQL support
๐ **Secure**: Login-protected dashboard and API endpoints
๐ **Rich Metadata**: Descriptions, extra fields, timestamps, and more
## Quick Start
### Installation
```bash
pip install ze-prompter
```
### Basic Usage (The Easy Way!)
```python
from ze_prompter import get_manager
# Get the manager - this handles everything for you!
manager = get_manager()
# Create a prompt template
template = manager.prompt_manager.create_prompt_template(
name="greeting",
content="Hello {name}, welcome to {platform}! How can I help you today?"
)
# Create a model configuration
model = manager.model_manager.create_model(
name="gpt-4",
description="OpenAI GPT-4 model",
extra_fields={
"provider": "openai",
"max_tokens": 4096,
"temperature": 0.7,
"api_key": "your-api-key-here"
}
)
print(f"Created template: {template.name} (v{template.version})")
print(f"Created model: {model.name}")
```
That's it! No database setup, no session management, no boilerplate code. ZePrompter handles everything automatically.
## Core Features
### ๐ฏ Prompt Template Management
```python
from ze_prompter import get_manager
manager = get_manager()
pm = manager.prompt_manager # Shorthand
# Create templates
email_template = pm.create_prompt_template(
name="customer_email",
content="Dear {customer_name},\n\nThank you for {action}. {message}\n\nBest regards,\n{sender_name}",
description="Customer service email template"
)
# Update templates (automatically creates new version)
updated_template = pm.update_prompt_template(
template_id=email_template.id,
content="Hi {customer_name}! ๐\n\nThanks for {action}! {message}\n\nCheers,\n{sender_name}",
description="More friendly customer service email"
)
# Get latest version
latest = pm.get_latest_template("customer_email")
print(f"Latest version: {latest.version}")
# Get all versions by name (much cleaner!)
versions = pm.get_template_versions("customer_email")
print(f"Total versions: {len(versions)}")
# Get specific version by name and version number
specific_version = pm.get_template_by_name_and_version("customer_email", 1)
print(f"Version 1 content: {specific_version.content}")
# You can also work with IDs if needed (methods with _by_id suffix)
versions_by_id = pm.get_template_versions_by_id(template_id)
template_by_id = pm.get_prompt_template_by_id(template_id)
# List all templates
all_templates = pm.list_templates()
```
### ๐ค Model Configuration Management
```python
from ze_prompter import get_manager
manager = get_manager()
mm = manager.model_manager # Shorthand
# Create different model configurations
openai_model = mm.create_model(
name="gpt-4-turbo",
description="Latest OpenAI GPT-4 Turbo",
extra_fields={
"provider": "openai",
"model_id": "gpt-4-turbo-preview",
"max_tokens": 4096,
"temperature": 0.7,
"top_p": 1.0,
"api_base": "https://api.openai.com/v1"
}
)
anthropic_model = mm.create_model(
name="claude-3-opus",
description="Anthropic Claude 3 Opus",
extra_fields={
"provider": "anthropic",
"model_id": "claude-3-opus-20240229",
"max_tokens": 4096,
"temperature": 0.3
}
)
# Get models by name
gpt4 = mm.get_model_by_name("gpt-4-turbo")
print(f"Model config: {gpt4.extra_fields}")
# List all models
models = mm.list_models()
for model in models:
provider = model.extra_fields.get('provider', 'unknown')
print(f"{model.name} ({provider})")
```
### ๐ Web Dashboard
Launch the beautiful web interface:
```python
# Option 1: Using the included runner
from ze_prompter.api.main import app
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)
```
```bash
# Option 2: Using the CLI
python -m ze_prompter.cli serve --port 8000
```
#### Creating User Accounts
Before accessing the web dashboard, you need to create a user account:
```bash
# Create a new user account interactively
python -m ze_prompter.cli create-account
```
This command will prompt you for:
- Username
- Email
- Password (with confirmation)
- Whether to make the user a superuser (admin)
Example:
```bash
$ python -m ze_prompter.cli create-account
๐ง Creating a new user account...
Username: admin
Email: admin@example.com
Password:
Repeat for confirmation:
Make this user a superuser (admin)? [y/N]: y
โ
Successfully created superuser: admin
```
Then visit `http://localhost:8000` and login with your created account.
The dashboard provides:
- ๐ Create, edit, and delete prompt templates
- ๐ค Manage model configurations
- ๐ Browse template version history
- ๐ Search and filter functionality
- ๐ Usage statistics and analytics
- ๐ Secure authentication
### โก Advanced Usage
#### Context Manager (Recommended for Scripts)
```python
from ze_prompter import get_manager
with get_manager() as manager:
# Create a bunch of templates
templates = [
("welcome", "Welcome {name} to our {service}!"),
("goodbye", "Thanks for using {service}, {name}!"),
("error", "Sorry {name}, we encountered an error: {error_message}")
]
for name, content in templates:
manager.prompt_manager.create_prompt_template(
name=name,
content=content
)
print("Created all templates!")
# Database connection is automatically closed here
```
#### Custom Database Session
```python
from ze_prompter import get_manager
from ze_prompter.models.database import SessionLocal
# Use your own session
db_session = SessionLocal()
manager = get_manager(db_session)
# Now use the manager...
template = manager.prompt_manager.create_prompt_template(
name="custom_session_template",
content="This uses a custom database session!"
)
# Don't forget to close when done
db_session.close()
```
#### Batch Operations
Batch import functionality is coming soon! This will allow you to efficiently import multiple templates at once.
## Configuration
ZePrompter supports configuration through environment variables for easy deployment and security.
### Core Configuration Variables
| Variable | Description | Default | Example |
|----------|-------------|---------|---------|
| `ZE_PROMPTER_DB` | Database connection string | `sqlite:///./prompt_library.db` | `postgresql://user:pass@localhost/zeprompter` |
| `ZE_PROMPTER_SECRET` | JWT secret key for authentication | `ZEPROMPTER-UNSECURE-KEY` | `your-super-secret-jwt-key-here` |
### Setting Environment Variables
Create a `.env` file in your project root:
```bash
# Database Configuration
ZE_PROMPTER_DB=sqlite:///./prompt_library.db
# For PostgreSQL: ZE_PROMPTER_DB=postgresql://user:pass@localhost/zeprompter
# For MySQL: ZE_PROMPTER_DB=mysql://user:pass@localhost/zeprompter
# Security Configuration
ZE_PROMPTER_SECRET=your-super-secret-jwt-key-here
```
### Using Environment Variables
```python
import os
from ze_prompter import get_manager
# Set configuration via environment variables
os.environ["ZE_PROMPTER_DB"] = "postgresql://user:pass@localhost/zeprompter"
os.environ["ZE_PROMPTER_SECRET"] = "my-super-secret-key"
# Manager will automatically use these settings
manager = get_manager()
```
**Security Note**: Always use a strong, unique secret key for `ZE_PROMPTER_SECRET` in production environments. The default value is insecure and should only be used for development.
## ๐ Quick Deploy
Deploy Ze Prompter instantly with ngrok for easy sharing and testing!
### Prerequisites
1. **Install ngrok**: Download from [ngrok.com](https://ngrok.com/download) and ensure it's in your PATH
2. **Clone the repository**:
```bash
git clone https://github.com/olsihoxha/zeprompter
cd zeprompter
pip install -r requirements.txt
```
### One-Command Deploy
```bash
# Deploy with ngrok tunnel (recommended for testing)
python -m ze_prompter.cli deploy
# Deploy without ngrok (local only)
python -m ze_prompter.cli deploy --no-ngrok
# Deploy on custom port
python -m ze_prompter.cli deploy --port 3000
```
### What happens when you deploy:
1. ๐ง **Initializes database** - Sets up SQLite database automatically
2. ๐ **Creates ngrok tunnel** - Generates public HTTPS URL for sharing
3. ๐ **Updates .env file** - Automatically saves the public URL to `ZE_PROMPTER_URL`
4. โ ๏ธ **Validates configuration** - Warns about potential SQLite issues with public URLs
5. ๐ **Starts the server** - Your app is ready to share!
### Example Output
```bash
$ python -m ze_prompter.cli deploy
๐ Deploying Ze Prompter...
Initializing database...
Starting ngrok tunnel...
โ
ngrok tunnel created: https://abc123.ngrok.io
โ
Updated .env file with ZE_PROMPTER_URL=https://abc123.ngrok.io
๐ Ze Prompter is now running!
๐ Local URL: http://localhost:8000
๐ Public URL: https://abc123.ngrok.io
๐ Create an account first with: python -m ze_prompter.cli create-account
๐ Press Ctrl+C to stop the server
```
### Production Considerations
When deploying with a public URL, consider upgrading your database:
```bash
# Example with PostgreSQL
export ZE_PROMPTER_DB="postgresql://user:pass@your-db-host/zeprompter"
export ZE_PROMPTER_SECRET="your-super-secure-secret-key"
python -m ze_prompter.cli deploy
```
**Note**: The CLI will warn you if you're using SQLite with a public URL, as it may cause issues with concurrent users.
## REST API
When you run the web server, you get a full REST API. This section provides context about the available endpoints - these are automatically created when you start the server and can be used for programmatic access to your templates and models.
### Prompt Templates
- `GET /api/prompts` - List all templates
- `POST /api/prompts` - Create new template
- `GET /api/prompts/{id}` - Get specific template
- `PUT /api/prompts/{id}` - Update template (creates new version)
- `DELETE /api/prompts/{id}` - Delete template
- `GET /api/prompts/{id}/versions` - Get all versions of template
### Models
- `GET /api/models` - List all models
- `POST /api/models` - Create new model
- `GET /api/models/{id}` - Get specific model
- `PUT /api/models/{id}` - Update model
- `DELETE /api/models/{id}` - Delete model
### Authentication
- `POST /auth/login` - Login to get access token
- `POST /auth/logout` - Logout
## Real-World Examples
### AI Chatbot with Multiple Models
```python
from ze_prompter import get_manager
def setup_chatbot_system():
manager = get_manager()
# Create prompt templates for different scenarios
templates = [
("greeting", "Hello! I'm {bot_name}, your AI assistant. How can I help you today?"),
("help_request", "I understand you need help with {topic}. Let me {action} for you."),
("error_handling", "I apologize, but I encountered an issue: {error}. Let me try a different approach."),
("farewell", "Thank you for chatting with me! Have a great {time_of_day}!")
]
for name, content in templates:
manager.prompt_manager.create_prompt_template(name=name, content=content)
# Configure different AI models for different use cases
models = [
("fast_responses", "GPT-3.5 Turbo for quick responses", {
"provider": "openai",
"model": "gpt-3.5-turbo",
"temperature": 0.7,
"max_tokens": 150
}),
("complex_tasks", "GPT-4 for complex reasoning", {
"provider": "openai",
"model": "gpt-4",
"temperature": 0.3,
"max_tokens": 1000
}),
("creative_writing", "Claude for creative tasks", {
"provider": "anthropic",
"model": "claude-3-opus",
"temperature": 0.9,
"max_tokens": 2000
})
]
for name, desc, config in models:
manager.model_manager.create_model(
name=name,
description=desc,
extra_fields=config
)
print("Chatbot system configured!")
return manager
# Use the configured system
manager = setup_chatbot_system()
# Get a template and model for a user interaction
greeting_template = manager.prompt_manager.get_latest_template("greeting")
fast_model = manager.model_manager.get_model_by_name("fast_responses")
# Format the prompt
prompt = greeting_template.content.format(bot_name="ZeBot")
model_config = fast_model.extra_fields
print(f"Prompt: {prompt}")
print(f"Model: {model_config['model']} (temp: {model_config['temperature']})")
```
### Email Template System
```python
from ze_prompter import get_manager
def setup_email_templates():
"""Set up basic email templates"""
with get_manager() as manager:
templates = [
("welcome_email", "Welcome to {company}, {first_name}! Here's what happens next..."),
("newsletter", "๐ง {topic} Weekly Digest - {date}"),
("promotional", "๐ Save {discount}% on {product} - Limited time!")
]
for name, content in templates:
manager.prompt_manager.create_prompt_template(name=name, content=content)
print(f"Created {len(templates)} email templates!")
setup_email_templates()
```
## Development & Contributing
### Development Setup
```bash
# Clone the repository
git clone https://github.com/olsihoxha/zeprompter
cd zeprompter
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install in development mode
pip install -e .
# Install development dependencies
pip install pytest black flake8 mypy
# Run tests
pytest
# Format code
black ze_prompter/
# Type checking
mypy ze_prompter/
```
## Support & Community
- ๐ Issues: Create an issue for bug reports and feature requests
## License
MIT License
---
**Made with ๐งก๏ธ by Claude & Me**
*ZePrompter - Making AI prompt management simple and powerful* ๐
Raw data
{
"_id": null,
"home_page": "https://github.com/olsihoxha/zeprompter",
"name": "ze-prompter",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "prompt templates, ai, machine learning, versioning, fastapi, web interface",
"author": "Olsi Hoxha",
"author_email": "olsihoxha824@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/80/5a/9f192b5d0fd7415cdc5fd9f31de59a9219fed269741597ce339f588bf3b1/ze_prompter-0.1.0.tar.gz",
"platform": null,
"description": "# ZePrompter \ud83d\ude80\n\nA powerful and intuitive Python library for managing AI prompt templates and model configurations with built-in versioning, web dashboard, and seamless API.\n\n## Why ZePrompter?\n\n\u2728 **Simple API**: One-line setup, intuitive manager interface \n\ud83d\udd04 **Smart Versioning**: Automatic prompt template versioning \n\ud83e\udd16 **Model Management**: Centralized AI model configuration storage \n\ud83c\udf10 **Web Dashboard**: Beautiful built-in interface with authentication \n\ud83d\udcbe **Database Agnostic**: SQLite by default, PostgreSQL/MySQL support \n\ud83d\udd10 **Secure**: Login-protected dashboard and API endpoints \n\ud83d\udcdd **Rich Metadata**: Descriptions, extra fields, timestamps, and more \n\n## Quick Start\n\n### Installation\n\n```bash\npip install ze-prompter\n```\n\n### Basic Usage (The Easy Way!)\n\n```python\nfrom ze_prompter import get_manager\n\n# Get the manager - this handles everything for you!\nmanager = get_manager()\n\n# Create a prompt template\ntemplate = manager.prompt_manager.create_prompt_template(\n name=\"greeting\",\n content=\"Hello {name}, welcome to {platform}! How can I help you today?\"\n)\n\n# Create a model configuration\nmodel = manager.model_manager.create_model(\n name=\"gpt-4\",\n description=\"OpenAI GPT-4 model\",\n extra_fields={\n \"provider\": \"openai\",\n \"max_tokens\": 4096,\n \"temperature\": 0.7,\n \"api_key\": \"your-api-key-here\"\n }\n)\n\nprint(f\"Created template: {template.name} (v{template.version})\")\nprint(f\"Created model: {model.name}\")\n```\n\nThat's it! No database setup, no session management, no boilerplate code. ZePrompter handles everything automatically.\n\n## Core Features\n\n### \ud83c\udfaf Prompt Template Management\n\n```python\nfrom ze_prompter import get_manager\n\nmanager = get_manager()\npm = manager.prompt_manager # Shorthand\n\n# Create templates\nemail_template = pm.create_prompt_template(\n name=\"customer_email\",\n content=\"Dear {customer_name},\\n\\nThank you for {action}. {message}\\n\\nBest regards,\\n{sender_name}\",\n description=\"Customer service email template\"\n)\n\n# Update templates (automatically creates new version)\nupdated_template = pm.update_prompt_template(\n template_id=email_template.id,\n content=\"Hi {customer_name}! \ud83d\udc4b\\n\\nThanks for {action}! {message}\\n\\nCheers,\\n{sender_name}\",\n description=\"More friendly customer service email\"\n)\n\n# Get latest version\nlatest = pm.get_latest_template(\"customer_email\")\nprint(f\"Latest version: {latest.version}\")\n\n# Get all versions by name (much cleaner!)\nversions = pm.get_template_versions(\"customer_email\")\nprint(f\"Total versions: {len(versions)}\")\n\n# Get specific version by name and version number\nspecific_version = pm.get_template_by_name_and_version(\"customer_email\", 1)\nprint(f\"Version 1 content: {specific_version.content}\")\n\n# You can also work with IDs if needed (methods with _by_id suffix)\nversions_by_id = pm.get_template_versions_by_id(template_id)\ntemplate_by_id = pm.get_prompt_template_by_id(template_id)\n\n# List all templates\nall_templates = pm.list_templates()\n```\n\n### \ud83e\udd16 Model Configuration Management\n\n```python\nfrom ze_prompter import get_manager\nmanager = get_manager()\nmm = manager.model_manager # Shorthand\n\n# Create different model configurations\nopenai_model = mm.create_model(\n name=\"gpt-4-turbo\",\n description=\"Latest OpenAI GPT-4 Turbo\",\n extra_fields={\n \"provider\": \"openai\",\n \"model_id\": \"gpt-4-turbo-preview\",\n \"max_tokens\": 4096,\n \"temperature\": 0.7,\n \"top_p\": 1.0,\n \"api_base\": \"https://api.openai.com/v1\"\n }\n)\n\nanthropic_model = mm.create_model(\n name=\"claude-3-opus\",\n description=\"Anthropic Claude 3 Opus\",\n extra_fields={\n \"provider\": \"anthropic\",\n \"model_id\": \"claude-3-opus-20240229\",\n \"max_tokens\": 4096,\n \"temperature\": 0.3\n }\n)\n\n# Get models by name\ngpt4 = mm.get_model_by_name(\"gpt-4-turbo\")\nprint(f\"Model config: {gpt4.extra_fields}\")\n\n# List all models\nmodels = mm.list_models()\nfor model in models:\n provider = model.extra_fields.get('provider', 'unknown')\n print(f\"{model.name} ({provider})\")\n```\n\n### \ud83c\udf10 Web Dashboard\n\nLaunch the beautiful web interface:\n\n```python\n# Option 1: Using the included runner\nfrom ze_prompter.api.main import app\nimport uvicorn\n\nuvicorn.run(app, host=\"0.0.0.0\", port=8000)\n```\n\n```bash\n# Option 2: Using the CLI \npython -m ze_prompter.cli serve --port 8000\n```\n\n#### Creating User Accounts\n\nBefore accessing the web dashboard, you need to create a user account:\n\n```bash\n# Create a new user account interactively\npython -m ze_prompter.cli create-account\n```\n\nThis command will prompt you for:\n- Username\n- Email\n- Password (with confirmation)\n- Whether to make the user a superuser (admin)\n\nExample:\n```bash\n$ python -m ze_prompter.cli create-account\n\ud83d\udd27 Creating a new user account...\nUsername: admin\nEmail: admin@example.com\nPassword: \nRepeat for confirmation: \nMake this user a superuser (admin)? [y/N]: y\n\u2705 Successfully created superuser: admin\n```\n\nThen visit `http://localhost:8000` and login with your created account.\n\nThe dashboard provides:\n- \ud83d\udcdd Create, edit, and delete prompt templates\n- \ud83e\udd16 Manage model configurations\n- \ud83d\udcda Browse template version history\n- \ud83d\udd0d Search and filter functionality\n- \ud83d\udcca Usage statistics and analytics\n- \ud83d\udd10 Secure authentication\n\n### \u26a1 Advanced Usage\n\n#### Context Manager (Recommended for Scripts)\n\n```python\nfrom ze_prompter import get_manager\n\nwith get_manager() as manager:\n # Create a bunch of templates\n templates = [\n (\"welcome\", \"Welcome {name} to our {service}!\"),\n (\"goodbye\", \"Thanks for using {service}, {name}!\"),\n (\"error\", \"Sorry {name}, we encountered an error: {error_message}\")\n ]\n \n for name, content in templates:\n manager.prompt_manager.create_prompt_template(\n name=name,\n content=content\n )\n \n print(\"Created all templates!\")\n# Database connection is automatically closed here\n```\n\n#### Custom Database Session\n\n```python\nfrom ze_prompter import get_manager\nfrom ze_prompter.models.database import SessionLocal\n\n# Use your own session\ndb_session = SessionLocal()\nmanager = get_manager(db_session)\n\n# Now use the manager...\ntemplate = manager.prompt_manager.create_prompt_template(\n name=\"custom_session_template\",\n content=\"This uses a custom database session!\"\n)\n\n# Don't forget to close when done\ndb_session.close()\n```\n\n#### Batch Operations\n\nBatch import functionality is coming soon! This will allow you to efficiently import multiple templates at once.\n\n## Configuration\n\nZePrompter supports configuration through environment variables for easy deployment and security.\n\n### Core Configuration Variables\n\n| Variable | Description | Default | Example |\n|----------|-------------|---------|---------|\n| `ZE_PROMPTER_DB` | Database connection string | `sqlite:///./prompt_library.db` | `postgresql://user:pass@localhost/zeprompter` |\n| `ZE_PROMPTER_SECRET` | JWT secret key for authentication | `ZEPROMPTER-UNSECURE-KEY` | `your-super-secret-jwt-key-here` |\n\n### Setting Environment Variables\n\nCreate a `.env` file in your project root:\n\n```bash\n# Database Configuration\nZE_PROMPTER_DB=sqlite:///./prompt_library.db\n# For PostgreSQL: ZE_PROMPTER_DB=postgresql://user:pass@localhost/zeprompter\n# For MySQL: ZE_PROMPTER_DB=mysql://user:pass@localhost/zeprompter\n\n# Security Configuration \nZE_PROMPTER_SECRET=your-super-secret-jwt-key-here\n```\n\n### Using Environment Variables\n\n```python\nimport os\nfrom ze_prompter import get_manager\n\n# Set configuration via environment variables\nos.environ[\"ZE_PROMPTER_DB\"] = \"postgresql://user:pass@localhost/zeprompter\"\nos.environ[\"ZE_PROMPTER_SECRET\"] = \"my-super-secret-key\"\n\n# Manager will automatically use these settings\nmanager = get_manager()\n```\n\n**Security Note**: Always use a strong, unique secret key for `ZE_PROMPTER_SECRET` in production environments. The default value is insecure and should only be used for development.\n\n## \ud83d\ude80 Quick Deploy\n\nDeploy Ze Prompter instantly with ngrok for easy sharing and testing!\n\n### Prerequisites\n\n1. **Install ngrok**: Download from [ngrok.com](https://ngrok.com/download) and ensure it's in your PATH\n2. **Clone the repository**:\n ```bash \n git clone https://github.com/olsihoxha/zeprompter\n cd zeprompter\n pip install -r requirements.txt\n ```\n\n### One-Command Deploy\n\n```bash\n# Deploy with ngrok tunnel (recommended for testing)\npython -m ze_prompter.cli deploy\n\n# Deploy without ngrok (local only)\npython -m ze_prompter.cli deploy --no-ngrok\n\n# Deploy on custom port\npython -m ze_prompter.cli deploy --port 3000\n```\n\n### What happens when you deploy:\n\n1. \ud83d\udd27 **Initializes database** - Sets up SQLite database automatically\n2. \ud83c\udf10 **Creates ngrok tunnel** - Generates public HTTPS URL for sharing\n3. \ud83d\udcdd **Updates .env file** - Automatically saves the public URL to `ZE_PROMPTER_URL`\n4. \u26a0\ufe0f **Validates configuration** - Warns about potential SQLite issues with public URLs\n5. \ud83c\udf89 **Starts the server** - Your app is ready to share!\n\n### Example Output\n\n```bash\n$ python -m ze_prompter.cli deploy\n\n\ud83d\ude80 Deploying Ze Prompter...\nInitializing database...\nStarting ngrok tunnel...\n\u2705 ngrok tunnel created: https://abc123.ngrok.io\n\u2705 Updated .env file with ZE_PROMPTER_URL=https://abc123.ngrok.io\n\n\ud83c\udf1f Ze Prompter is now running!\n\ud83d\udccd Local URL: http://localhost:8000\n\ud83c\udf0d Public URL: https://abc123.ngrok.io\n\ud83d\udd10 Create an account first with: python -m ze_prompter.cli create-account\n\ud83d\udcd6 Press Ctrl+C to stop the server\n```\n\n### Production Considerations\n\nWhen deploying with a public URL, consider upgrading your database:\n\n```bash\n# Example with PostgreSQL\nexport ZE_PROMPTER_DB=\"postgresql://user:pass@your-db-host/zeprompter\"\nexport ZE_PROMPTER_SECRET=\"your-super-secure-secret-key\"\npython -m ze_prompter.cli deploy\n```\n\n**Note**: The CLI will warn you if you're using SQLite with a public URL, as it may cause issues with concurrent users.\n\n## REST API\n\nWhen you run the web server, you get a full REST API. This section provides context about the available endpoints - these are automatically created when you start the server and can be used for programmatic access to your templates and models.\n\n### Prompt Templates\n- `GET /api/prompts` - List all templates\n- `POST /api/prompts` - Create new template \n- `GET /api/prompts/{id}` - Get specific template\n- `PUT /api/prompts/{id}` - Update template (creates new version)\n- `DELETE /api/prompts/{id}` - Delete template\n- `GET /api/prompts/{id}/versions` - Get all versions of template\n\n### Models\n- `GET /api/models` - List all models\n- `POST /api/models` - Create new model\n- `GET /api/models/{id}` - Get specific model \n- `PUT /api/models/{id}` - Update model\n- `DELETE /api/models/{id}` - Delete model\n\n### Authentication\n- `POST /auth/login` - Login to get access token\n- `POST /auth/logout` - Logout\n\n## Real-World Examples\n\n### AI Chatbot with Multiple Models\n\n```python\nfrom ze_prompter import get_manager\n\ndef setup_chatbot_system():\n manager = get_manager()\n \n # Create prompt templates for different scenarios\n templates = [\n (\"greeting\", \"Hello! I'm {bot_name}, your AI assistant. How can I help you today?\"),\n (\"help_request\", \"I understand you need help with {topic}. Let me {action} for you.\"),\n (\"error_handling\", \"I apologize, but I encountered an issue: {error}. Let me try a different approach.\"),\n (\"farewell\", \"Thank you for chatting with me! Have a great {time_of_day}!\")\n ]\n \n for name, content in templates:\n manager.prompt_manager.create_prompt_template(name=name, content=content)\n \n # Configure different AI models for different use cases\n models = [\n (\"fast_responses\", \"GPT-3.5 Turbo for quick responses\", {\n \"provider\": \"openai\",\n \"model\": \"gpt-3.5-turbo\",\n \"temperature\": 0.7,\n \"max_tokens\": 150\n }),\n (\"complex_tasks\", \"GPT-4 for complex reasoning\", {\n \"provider\": \"openai\", \n \"model\": \"gpt-4\",\n \"temperature\": 0.3,\n \"max_tokens\": 1000\n }),\n (\"creative_writing\", \"Claude for creative tasks\", {\n \"provider\": \"anthropic\",\n \"model\": \"claude-3-opus\",\n \"temperature\": 0.9,\n \"max_tokens\": 2000\n })\n ]\n \n for name, desc, config in models:\n manager.model_manager.create_model(\n name=name,\n description=desc,\n extra_fields=config\n )\n \n print(\"Chatbot system configured!\")\n return manager\n\n# Use the configured system\nmanager = setup_chatbot_system()\n\n# Get a template and model for a user interaction\ngreeting_template = manager.prompt_manager.get_latest_template(\"greeting\")\nfast_model = manager.model_manager.get_model_by_name(\"fast_responses\")\n\n# Format the prompt\nprompt = greeting_template.content.format(bot_name=\"ZeBot\")\nmodel_config = fast_model.extra_fields\n\nprint(f\"Prompt: {prompt}\")\nprint(f\"Model: {model_config['model']} (temp: {model_config['temperature']})\")\n```\n\n### Email Template System\n\n```python\nfrom ze_prompter import get_manager\n\ndef setup_email_templates():\n \"\"\"Set up basic email templates\"\"\"\n with get_manager() as manager:\n templates = [\n (\"welcome_email\", \"Welcome to {company}, {first_name}! Here's what happens next...\"),\n (\"newsletter\", \"\ud83d\udce7 {topic} Weekly Digest - {date}\"),\n (\"promotional\", \"\ud83c\udf89 Save {discount}% on {product} - Limited time!\")\n ]\n \n for name, content in templates:\n manager.prompt_manager.create_prompt_template(name=name, content=content)\n \n print(f\"Created {len(templates)} email templates!\")\n\nsetup_email_templates()\n```\n\n## Development & Contributing\n\n### Development Setup\n\n```bash\n# Clone the repository \ngit clone https://github.com/olsihoxha/zeprompter\ncd zeprompter\n\n# Create virtual environment\npython -m venv .venv\nsource .venv/bin/activate # On Windows: .venv\\Scripts\\activate\n\n# Install in development mode\npip install -e .\n\n# Install development dependencies\npip install pytest black flake8 mypy\n\n# Run tests\npytest\n\n# Format code\nblack ze_prompter/\n\n# Type checking\nmypy ze_prompter/\n```\n\n\n## Support & Community\n\n- \ud83d\udc1b Issues: Create an issue for bug reports and feature requests\n\n## License\n\n\nMIT License\n\n---\n\n**Made with \ud83e\udde1\ufe0f by Claude & Me**\n\n*ZePrompter - Making AI prompt management simple and powerful* \ud83d\ude80\n",
"bugtrack_url": null,
"license": null,
"summary": "A library for managing prompt templates with versioning and AI models",
"version": "0.1.0",
"project_urls": {
"Bug Reports": "https://github.com/olsihoxha/zeprompter/issues",
"Homepage": "https://github.com/olsihoxha/zeprompter",
"Source": "https://github.com/olsihoxha/zeprompter"
},
"split_keywords": [
"prompt templates",
" ai",
" machine learning",
" versioning",
" fastapi",
" web interface"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "7d042610c68de34fc2522ebd38e2169d73ef63bbc1bcf640ed33f81003985862",
"md5": "1a16d75bcf958ac9066e461b55ac63fa",
"sha256": "3928766e7b75b818e02cca08420379c1f4776712c36086d7f41b8b4fe9ddba77"
},
"downloads": -1,
"filename": "ze_prompter-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1a16d75bcf958ac9066e461b55ac63fa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 32658,
"upload_time": "2025-07-25T14:10:17",
"upload_time_iso_8601": "2025-07-25T14:10:17.570771Z",
"url": "https://files.pythonhosted.org/packages/7d/04/2610c68de34fc2522ebd38e2169d73ef63bbc1bcf640ed33f81003985862/ze_prompter-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "805a9f192b5d0fd7415cdc5fd9f31de59a9219fed269741597ce339f588bf3b1",
"md5": "01909ca8e1c91b0fc0038e351d4323e6",
"sha256": "e61fb9f0c548ff3ffc4ab0f0eadb2af3245c3f2675eb79e57d1be4dcbd82a1de"
},
"downloads": -1,
"filename": "ze_prompter-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "01909ca8e1c91b0fc0038e351d4323e6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 29742,
"upload_time": "2025-07-25T14:10:18",
"upload_time_iso_8601": "2025-07-25T14:10:18.779254Z",
"url": "https://files.pythonhosted.org/packages/80/5a/9f192b5d0fd7415cdc5fd9f31de59a9219fed269741597ce339f588bf3b1/ze_prompter-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-25 14:10:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "olsihoxha",
"github_project": "zeprompter",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "annotated-types",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "anyio",
"specs": [
[
"==",
"4.9.0"
]
]
},
{
"name": "bcrypt",
"specs": [
[
"==",
"4.3.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2025.7.14"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.4.2"
]
]
},
{
"name": "click",
"specs": [
[
"==",
"8.2.1"
]
]
},
{
"name": "ecdsa",
"specs": [
[
"==",
"0.19.1"
]
]
},
{
"name": "fastapi",
"specs": [
[
"==",
"0.116.1"
]
]
},
{
"name": "h11",
"specs": [
[
"==",
"0.16.0"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.10"
]
]
},
{
"name": "Jinja2",
"specs": [
[
"==",
"3.1.6"
]
]
},
{
"name": "MarkupSafe",
"specs": [
[
"==",
"3.0.2"
]
]
},
{
"name": "passlib",
"specs": [
[
"==",
"1.7.4"
]
]
},
{
"name": "pyasn1",
"specs": [
[
"==",
"0.6.1"
]
]
},
{
"name": "pydantic",
"specs": [
[
"==",
"2.11.7"
]
]
},
{
"name": "pydantic_core",
"specs": [
[
"==",
"2.33.2"
]
]
},
{
"name": "python-jose",
"specs": [
[
"==",
"3.5.0"
]
]
},
{
"name": "python-multipart",
"specs": [
[
"==",
"0.0.20"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.4"
]
]
},
{
"name": "rsa",
"specs": [
[
"==",
"4.9.1"
]
]
},
{
"name": "setuptools",
"specs": [
[
"==",
"80.9.0"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.17.0"
]
]
},
{
"name": "sniffio",
"specs": [
[
"==",
"1.3.1"
]
]
},
{
"name": "SQLAlchemy",
"specs": [
[
"==",
"2.0.41"
]
]
},
{
"name": "starlette",
"specs": [
[
"==",
"0.47.2"
]
]
},
{
"name": "typing-inspection",
"specs": [
[
"==",
"0.4.1"
]
]
},
{
"name": "typing_extensions",
"specs": [
[
"==",
"4.14.1"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.5.0"
]
]
},
{
"name": "uvicorn",
"specs": [
[
"==",
"0.35.0"
]
]
}
],
"lcname": "ze-prompter"
}