Skip to main content

A micro framework for bootstrapping AI applications with prompt engineering

Project description

PromptBoot

Vibe coding results. A micro framework for bootstrapping AI applications with prompt engineering, inspired by SpringBoot.

Features

  • Configuration-driven (based on config.yaml)
  • System/User Prompt + Schema
  • Direct list[dict] messages support (fully compatible with OpenAI's messages)
  • Logging & local record
  • Pydantic validation + automatic retry
  • Reusable with pip install -e . (SpringBoot-style startup)
  • Both synchronous and asynchronous clients

Installation

First install the required dependencies:

pip install openai tenacity pydantic pyyaml

Then install the package in development mode:

git clone <your-repo>
cd promptboot
pip install -e .

Configuration

Create a config.yaml file in your project root:

model_client:
  base_url: "https://api.openai.com/v1"
  api_key: "YOUR_API_KEY"
  model: "gpt-4o-mini"
  temperature: 0.3
  max_retries: 3
  retry_wait: 2

logging:
  dir: "./logs"
  level: "INFO"

Usage

Basic usage with synchronous client:

from promptboot import PromptClient

client = PromptClient()
result = client.call(system_prompt="...", user_prompt="...")
print(result)

With schema validation:

from pydantic import BaseModel
from typing import List
from promptboot import PromptClient

class FruitsResponse(BaseModel):
    fruits: List[str]

client = PromptClient()
result = client.call(
    system_prompt="You are a helpful assistant.",
    user_prompt="Give me 3 fruits as JSON in format {\"fruits\": [..]}",
    schema=FruitsResponse
)
print(result)  # Returns validated Pydantic model

Asynchronous usage:

import asyncio
from pydantic import BaseModel
from typing import List
from promptboot import AsyncPromptClient


class FruitsResponse(BaseModel):
    fruits: List[str]


async def main():
    prompt_client = AsyncPromptClient()

    result = await prompt_client.call(
        system_prompt="You are a helpful assistant.",
        user_prompt="Give me 3 fruits as JSON in format {\"fruits\": [..]}",
        schema=FruitsResponse,
    )

    print("Validated Result:", result)


if __name__ == "__main__":
    asyncio.run(main())

Project Structure

promptboot/
├── promptboot/
│   ├── __init__.py
│   ├── client.py
│   ├── async_client.py
│   ├── config.py
│   └── logs/
│       ├── __init__.py
│       ├── logger.py
│       └── log_manager.py
├── config.yaml
├── setup.py
├── pyproject.toml
└── examples/
    └── demo.py

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

promptboot-0.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

promptboot-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file promptboot-0.1.1.tar.gz.

File metadata

  • Download URL: promptboot-0.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for promptboot-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e07764fdd7e1d3356ddb621bbee9690007fab8de9d4a2e607892063a8a7e6c4d
MD5 81ac94335bdd51d4e94f0656a2c07552
BLAKE2b-256 9f77f2fb1e2dc3bf9d600d880c94f49ee417ebee964677245d6d3cf2ce788035

See more details on using hashes here.

File details

Details for the file promptboot-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: promptboot-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for promptboot-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8efb09765cba71064cf95dac826a491bfc004c7711994c3f7a4a1ce6b00556c4
MD5 a62438df08de8c30a20361e822e547ef
BLAKE2b-256 32f60ba01148f2027c7bb50060f77158464e78f6d42564a84f4e38da730311ce

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