Skip to main content

Framework designed to simplify and accelerate the development of LLM-based applications.

Project description

🏎️ draive 🏁

PyPI Python Version License Docs CodeRabbit Pull Request Reviews

🏎️ Build production-ready GenAI systems with strict typing, clean architecture, and fast iteration.

Draive helps teams move from prompt experiments to dependable AI features: typed outputs, tool orchestration, multimodal workflows, evaluation, guardrails, and observability in one cohesive framework.

If you want AI code that stays maintainable as your product grows, Draive is built for that.

✨ Why teams pick Draive

  • Typed by default: generate validated State objects, not fragile string blobs.
  • Reliable execution model: ctx.scope(...) gives explicit state, dependency lifecycle, and structured concurrency.
  • Model portability: swap providers without rewriting your business workflow.
  • Real-world coverage: tools, multimodal content, retrieval, evaluators, and guardrails are first-class building blocks.
  • Production visibility: built-in hooks for logs, metrics, traces, and quality checks.

🚀 Quick start

Here’s what a simple Draive setup looks like:

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 for all required knowledge.

For full examples, head over to the 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 build 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 Step and StepState pipelines
  • 🛡 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

What makes Draive stand out

  • 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 reusable, structured config in no time.
  • Composable Workflows: Build modular flows using Step, tools, and context-scoped state. Every piece is reusable, testable, and fits together cleanly.
  • 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 - decode to typed Python State models with schema-aware generation.
  • Multimodal + Resource-Native: Work with text, images, audio, files, and artifacts through one content model.
  • RAG Ready: Built-in embeddings and VectorIndex utilities support retrieval-heavy workflows.
  • Telemetry + Evaluators: Measure timing, quality, tool usage, and regressions as part of CI.
  • Model-Agnostic by Design: Built-in support for major hosted and self-hosted providers.

🖥️ Install

With pip:

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.

pip install 'draive[openai]'
  • Anthropic:

Use Anthropic services client, including Claude.

pip install 'draive[anthropic]'
  • Gemini:

Use Google AIStudio services client, including Gemini.

pip install 'draive[gemini]'
  • Mistral:

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

pip install 'draive[mistral]'
  • Cohere:

Use Cohere services client.

pip install 'draive[cohere]'
  • Ollama:

Use Ollama services client.

pip install 'draive[ollama]'
  • VLLM:

Use VLLM services through OpenAI client.

pip install 'draive[vllm]'
  • Bedrock:

Use AWS Bedrock-backed models.

pip install 'draive[bedrock]'
  • MCP:

Use Model Context Protocol integrations.

pip install 'draive[mcp]'
  • OpenTelemetry:

Export traces/metrics to your observability stack.

pip install 'draive[opentelemetry]'
  • Postgres:

Use Postgres-backed persistence helpers.

pip install 'draive[postgres]'
  • Qdrant:

Use Qdrant vector database integration.

pip install 'draive[qdrant]'

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

Community & Support

  • Report issues and discuss ideas on GitHub.
  • Learn more about the team behind Draive at Miquido.

Built by Miquido

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

draive-0.100.0.tar.gz (189.0 kB view details)

Uploaded Source

Built Distribution

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

draive-0.100.0-py3-none-any.whl (286.8 kB view details)

Uploaded Python 3

File details

Details for the file draive-0.100.0.tar.gz.

File metadata

  • Download URL: draive-0.100.0.tar.gz
  • Upload date:
  • Size: 189.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for draive-0.100.0.tar.gz
Algorithm Hash digest
SHA256 a16aed36b45b69bc8f25f460bad0dd15dd67034a036889681edc3d948aea4445
MD5 68312bf0107590330f6805d40f1dd93b
BLAKE2b-256 51fb70378c1cb2281fc84cf8f2a09afc0e1a1cec65403c321f92c6d6413dbaae

See more details on using hashes here.

File details

Details for the file draive-0.100.0-py3-none-any.whl.

File metadata

  • Download URL: draive-0.100.0-py3-none-any.whl
  • Upload date:
  • Size: 286.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for draive-0.100.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f56f996695c816c09aedfa4d66f7d34660581933d66d944577df09702d1eb7b
MD5 61e0bbab745574abcd9b975580579b6a
BLAKE2b-256 d4e5864ba21883854d5895b56d3a938bf517a8b9c26e8da336777c1a8e98e763

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