Metadata-Version: 2.3
Name: draive
Version: 0.89.4
Summary: Framework designed to simplify and accelerate the development of LLM-based applications.
License: MIT License
         
         Copyright (c) 2024 Miquido
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Classifier: Topic :: Software Development
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Dist: numpy~=2.3
Requires-Dist: haiway~=0.35.3
Requires-Dist: anthropic~=0.69 ; extra == 'anthropic'
Requires-Dist: anthropic[bedrock]~=0.69 ; extra == 'anthropic-bedrock'
Requires-Dist: boto3~=1.40 ; extra == 'bedrock'
Requires-Dist: cohere~=5.18 ; extra == 'cohere'
Requires-Dist: cohere~=5.18 ; extra == 'cohere-bedrock'
Requires-Dist: boto3~=1.40 ; extra == 'cohere-bedrock'
Requires-Dist: bandit~=1.8 ; extra == 'dev'
Requires-Dist: pyright~=1.1 ; extra == 'dev'
Requires-Dist: pytest~=8.4 ; extra == 'dev'
Requires-Dist: pytest-asyncio~=1.2 ; extra == 'dev'
Requires-Dist: pytest-cov~=7.0 ; extra == 'dev'
Requires-Dist: ruff~=0.14 ; extra == 'dev'
Requires-Dist: mkdocs~=1.6 ; extra == 'docs'
Requires-Dist: mkdocs-material~=9.6 ; extra == 'docs'
Requires-Dist: mkdocstrings[python]~=0.30 ; extra == 'docs'
Requires-Dist: mdformat~=0.7 ; extra == 'docs'
Requires-Dist: mdformat-gfm~=0.4 ; extra == 'docs'
Requires-Dist: pymarkdownlnt~=0.9 ; extra == 'docs'
Requires-Dist: google-genai~=1.41 ; extra == 'gemini'
Requires-Dist: google-api-core ; extra == 'gemini'
Requires-Dist: haiway[httpx] ; extra == 'httpx'
Requires-Dist: httpx ; extra == 'httpx'
Requires-Dist: mcp~=1.16 ; extra == 'mcp'
Requires-Dist: mistralai~=1.9 ; extra == 'mistral'
Requires-Dist: ollama~=0.6.0 ; extra == 'ollama'
Requires-Dist: openai~=2.1 ; extra == 'openai'
Requires-Dist: openai[realtime]~=2.1 ; extra == 'openai-realtime'
Requires-Dist: haiway[opentelemetry] ; extra == 'opentelemetry'
Requires-Dist: opentelemetry-api ; extra == 'opentelemetry'
Requires-Dist: opentelemetry-sdk ; extra == 'opentelemetry'
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc ; extra == 'opentelemetry'
Requires-Dist: haiway[postgres] ; extra == 'postgres'
Requires-Dist: asyncpg ; extra == 'postgres'
Requires-Dist: openai~=2.1 ; extra == 'vllm'
Maintainer: Kacper Kaliński
Maintainer-email: Kacper Kaliński <kacper.kalinski@miquido.com>
Requires-Python: >=3.13
Project-URL: Homepage, https://miquido.com
Project-URL: Repository, https://github.com/miquido/draive.git
Provides-Extra: anthropic
Provides-Extra: anthropic-bedrock
Provides-Extra: bedrock
Provides-Extra: cohere
Provides-Extra: cohere-bedrock
Provides-Extra: dev
Provides-Extra: docs
Provides-Extra: gemini
Provides-Extra: httpx
Provides-Extra: mcp
Provides-Extra: mistral
Provides-Extra: ollama
Provides-Extra: openai
Provides-Extra: openai-realtime
Provides-Extra: opentelemetry
Provides-Extra: postgres
Provides-Extra: vllm
Description-Content-Type: text/markdown

# 🏎️ draive 🏁

[![PyPI](https://img.shields.io/pypi/v/draive)](https://pypi.org/project/draive/)
![Python Version](https://img.shields.io/badge/Python-3.13+-blue)
![License](https://img.shields.io/badge/License-MIT-green)
[![Docs](https://img.shields.io/badge/Documentation-yellow)](https://miquido.github.io/draive/)
![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/miquido/draive?utm_source=oss&utm_medium=github&utm_campaign=miquido%2Fdraive&labelColor=171717&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews)

🏎️ An all-in-one, flexible Python library for building powerful LLM workflows and AI apps. 🏎️

Draive gives you everything you need to turn large language models into production-ready software:
agents, structured workflows, tool use, instruction refinement, guardrails, observability, and
seamless multi-model integration — all in one clean, composable package.

If you've ever felt like you’re stitching together glue code and hoping for the best — Draive is
what you wish you'd started with!

## 🚀 Quick start

Here’s what a simple Draive setup looks like:

```python
from draive import ctx, TextGeneration, tool
from draive.openai import OpenAI, OpenAIResponsesConfig

@tool # simply annotate a function as a tool
async def current_time(location: str) -> str:
    return f"Time in {location} is 9:53:22"

async with  ctx.scope( # create execution context
    "example", # give it a name
    OpenAIResponsesConfig(model="gpt-4o-mini"), # prepare configuration
    disposables=(OpenAI(),), # define resources and service clients available
):
    result: str = await TextGeneration.generate( # choose a right generation abstraction
        instructions="You are a helpful assistant", # provide clear instructions
        input="What is the time in Kraków?", # give it some input (including multimodal)
        tools=[current_time], # and select any tools you like
    )

    print(result) # to finally get the result!
    # output: The current time in Kraków is 9:53:22.
```

Read the [Draive Documentation](https://miquido.github.io/draive/) for all required knowledge.

For full examples, head over to the [Draive Examples](https://github.com/miquido/draive-examples)
repository.

## ❓ What is Draive good for

Draive is built for developers who want clarity, flexibility, and control when working with LLMs.

Whether you’re building an autonomous agent, automating data flow, extracting information from
documents, handling audio or images — Draive has your back.

### What you can do with Draive

- **🔁 Start with evaluation** - make sure your app behaves as expected, right from the start
- **🛠 Turn any Python function into a tool** that LLMs can call
- **🔄 Switch between providers** like OpenAI, Claude, Gemini, or Mistral in seconds
- **🧱 Design structured workflows** with reusable stages
- **🛡 Enforce output quality using guardrails** including moderation and runtime evaluation
- **📊 Monitor with ease** - plug into any OpenTelemetry-compatible services
- **⚙️ Control your context** - use on-the-fly LLM context modifications for best results

### Why you'll like it

- **Instruction Optimization**: Draive gives you clean ways to write and refine prompts, including
  metaprompts, instruction helpers, and optimizers. You can go from raw prompt text to a reusable,
  structured config in no time.
- **Composable Workflows**: Build modular flows using Stages and Tools. Every piece is reusable,
  testable, and fits together seamlessly.
- **Tooling = Just Python**: Define a tool by writing a function. Annotate it. That’s it. Draive
  handles the rest — serialization, context, and integration with LLMs.
- **Structured Outputs** - use Python classes for JSON outputs and flexible multimodal XML parser
  for custom results transformations.
- **Telemetry + Evaluators**: Draive logs everything you care about: timing, output shape, tool
  usage, error cases. Evaluators let you benchmark or regression-test LLM behavior like a normal
  part of your CI.
- **Model-Agnostic by Design**: Built-in support for most major providers.

## 🖥️ Install

With pip:

```bash
pip install draive
```

### Optional dependencies

Draive library comes with optional integrations to 3rd party services:

- OpenAI:

Use OpenAI services client, including GPT, dall-e and embedding. Allows to use Azure services as
well.

```bash
pip install 'draive[openai]'
```

- Anthropic:

Use Anthropic services client, including Claude.

```bash
pip install 'draive[anthropic]'
```

- Gemini:

Use Google AIStudio services client, including Gemini.

```bash
pip install 'draive[gemini]'
```

- Mistral:

Use Mistral services client. Allows to use Azure services as well.

```bash
pip install 'draive[mistral]'
```

- Cohere:

Use Cohere services client.

```bash
pip install 'draive[cohere]'
```

- Ollama:

Use Ollama services client.

```bash
pip install 'draive[ollama]'
```

- VLLM:

Use VLLM services through OpenAI client.

```bash
pip install 'draive[vllm]'
```

## 👷 Contributing

Draive is open-source and always growing — and we’d love your help.

Got an idea for a new feature? Spotted a bug? Want to improve the docs or share an example? Awesome.
Open a PR or start a discussion — no contribution is too small!

Whether you're fixing typos, building new integrations, or just testing things out and giving
feedback — you're welcome here.

## License

MIT License

Copyright (c) 2024-2025 Miquido

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
