Metadata-Version: 2.4
Name: draive
Version: 0.53.0
Summary: Framework designed to simplify and accelerate the development of LLM-based applications.
Project-URL: Homepage, https://miquido.com
Project-URL: Repository, https://github.com/miquido/draive.git
Maintainer-email: Kacper Kaliński <kacper.kalinski@miquido.com>
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.
License-File: LICENSE
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: haiway~=0.13.1
Requires-Dist: numpy~=1.26
Provides-Extra: anthropic
Requires-Dist: anthropic~=0.47; extra == 'anthropic'
Requires-Dist: tokenizers~=0.21; extra == 'anthropic'
Provides-Extra: bedrock
Requires-Dist: boto3~=1.37; extra == 'bedrock'
Provides-Extra: cohere
Requires-Dist: cohere~=5.13; extra == 'cohere'
Provides-Extra: dev
Requires-Dist: anthropic~=0.47; extra == 'dev'
Requires-Dist: bandit~=1.7; extra == 'dev'
Requires-Dist: boto3~=1.37; extra == 'dev'
Requires-Dist: cohere~=5.13; extra == 'dev'
Requires-Dist: fastembed~=0.4; extra == 'dev'
Requires-Dist: google-genai~=1.3; extra == 'dev'
Requires-Dist: mcp~=1.3.0; extra == 'dev'
Requires-Dist: mistralai~=1.5; extra == 'dev'
Requires-Dist: ollama~=0.4; extra == 'dev'
Requires-Dist: openai~=1.64; extra == 'dev'
Requires-Dist: pyright~=1.1; extra == 'dev'
Requires-Dist: pytest-asyncio~=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov~=4.1; extra == 'dev'
Requires-Dist: pytest~=7.4; extra == 'dev'
Requires-Dist: ruff~=0.9; extra == 'dev'
Requires-Dist: sentencepiece~=0.2; extra == 'dev'
Requires-Dist: tiktoken~=0.8; extra == 'dev'
Requires-Dist: tokenizers~=0.21; extra == 'dev'
Provides-Extra: fastembed
Requires-Dist: fastembed~=0.4; extra == 'fastembed'
Provides-Extra: gemini
Requires-Dist: google-genai~=1.3; extra == 'gemini'
Requires-Dist: sentencepiece~=0.2; extra == 'gemini'
Provides-Extra: mcp
Requires-Dist: mcp~=1.3.0; extra == 'mcp'
Provides-Extra: mistral
Requires-Dist: mistralai~=1.5; extra == 'mistral'
Requires-Dist: sentencepiece~=0.2; extra == 'mistral'
Provides-Extra: ollama
Requires-Dist: ollama~=0.4; extra == 'ollama'
Provides-Extra: openai
Requires-Dist: openai~=1.64; extra == 'openai'
Requires-Dist: tiktoken~=0.8; extra == 'openai'
Provides-Extra: sentencepiece
Requires-Dist: sentencepiece~=0.2; extra == 'sentencepiece'
Provides-Extra: vllm
Requires-Dist: openai~=1.64; extra == 'vllm'
Description-Content-Type: text/markdown

# 🏎️ draive 🏁

🏎️ Fast-track your LLM-based apps with an accessible, production-ready library. 🏎️

Are you looking for maximum flexibility and efficiency in your next Python library? Tired of unnecessary complexities and inefficient token usage?

👉 Introducing **draive** - an open-source Python library under the Miquido AI Kickstarter framework, designed to simplify and accelerate the development of LLM-based applications. Get started with draive to streamline your workflow and build powerful, efficient apps with ease.

## 🚀 Quick start

Dive straight into the code and learn how to use draive with our interactive [guides](https://github.com/miquido/draive/tree/main/guides). Check out [Draive AI Course on YouTube](https://www.youtube.com/watch?v=C257Y7-y3ok&list=PLbS8Yksu3iAoRpDOGwP_UmK5s6B3SDz8T) to understand our unique architecture and see real-world applications of Draive in action. For quick solutions to common problems, explore our [cookbooks](https://github.com/miquido/draive/tree/main/cookbooks).

Great, but how it looks like?

```python
from draive import ctx, generate_text, tool
from draive.openai import OpenAI, OpenAIChatConfig


@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
    OpenAI().lmm_invoking(), # define services provider
    OpenAIChatConfig(model="gpt-4o-mini") # and its configuration
):
    result: str = await generate_text( # choose the right abstraction
        instruction="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.
```

Fully functional examples of using the Draive library are also available in [Draive Examples](https://github.com/miquido/draive-examples) repository.

## ❓ What is draive?

**draive** is an open-source Python library for developing apps powered by large language models. It stands out for its simplicity, consistent behavior, and transparency.

### Key Features:

- **🧱 Abstract building blocks**: Easily connect multiple functionalities with LLMs and link various LLMs together.
- **🧩 Flexible integration**: Supports any LLM, external service, and other AI solutions.
- **🧒 User-friendly framework**: Designed to build scalable and composable data processing pipelines with ease.
- **⚙️ Function-oriented design**: Utilizes basic programming concepts, allowing you to represent complex programs as simple functions.
- **🏗️ Composable and reusable**: Combine functions to create complex programs, while retaining the ability to use them individually.
- **📊 Diagnostics and metrics**: Offers extensive tools for measuring and debugging complex functionalities.
- **🔄 Fully typed and asynchronous**: Ensures type safety and efficient asynchronous operations for modern Python apps.

## 🧱 What can you build with draive?

### 🦾 RAG applications

RAG enhances model capabilities and personalizes the outputs.

- **Examples**: Question answering, custom knowledge bases.

### 🧹 Extracting structured output

Simplified data extraction and structuring.

- **Examples**: Data parsing, report generation.

### 🤖 Chatbots

Sophisticated conversational agents.

- **Examples**: Customer service bots, virtual assistants.

… and much more!

## 🖥️ 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

As an open-source project in a rapidly evolving field, we welcome all contributions. Whether you can add a new feature, enhance our infrastructure, or improve our documentation, your input is valuable to us.

We welcome any feedback and suggestions! Feel free to open an issue or pull request.

## 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.
