Skip to main content

🏎️ 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-5.5"), # 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

Draive requires Python 3.15 or newer.

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]'
  • AWS:

Use AWS services client, including S3, SQS and CloudWatch observability.

pip install 'draive[aws]'
  • MCP:

Use Model Context Protocol integrations.

pip install 'draive[mcp]'
  • OpenTelemetry:

Export traces/metrics to your observability stack.

pip install 'draive[opentelemetry]'

Events and exception details are exported as OpenTelemetry log records correlated with the active span, not as span events. Make sure your collector and backend ingest the logs signal, and move any dashboards or queries based on span events to logs.

  • Postgres:

Use Postgres-backed persistence helpers.

pip install 'draive[postgres]'
  • Qdrant:

Use Qdrant vector database integration.

pip install 'draive[qdrant]'
  • SurrealDB:

Use SurrealDB integration, including vector index, templates and conversation memory.

pip install 'draive[surrealdb]'

For in-process connections (mem://, file://, surrealkv://) install the embedded engine as well with pip install 'draive[surrealdb_embedded]'. When no url is given, SurrealClient uses mem:// if the embedded engine is installed and requires an explicit url otherwise.

Remote connections require a SurrealDB 3.x or newer server (verified with 3.2 and 4.0) - the session handling relies on RPC methods older servers do not provide. Namespaces and databases are not created implicitly, they have to be defined before use.

  • RabbitMQ:

Use RabbitMQ messaging client.

pip install 'draive[rabbitmq]'

Variant extras are available for provider-specific setups: openai_realtime (OpenAI Realtime API), anthropic_bedrock and cohere_bedrock (those providers accessed through AWS Bedrock), and httpx (shared HTTP client).

🤖 Coding agents

The repository ships an Agent Skill teaching coding agents how to write Draive code - its patterns, APIs and gotchas, verified against the framework. Copy skills/draive into the skills directory of your agent (for example .claude/skills/draive in your project) to make it available.

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

Metadata

Release files for draive 0.120.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for draive 0.120.0
File Size Uploaded Provenance Actions
draive-0.120.0.tar.gz 324.6 kB Without provenance Details for draive-0.120.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for draive 0.120.0
File Interpreter ABI Platform Actions
draive-0.120.0-py3-none-any.whl Python 3 none any Details for draive-0.120.0-py3-none-any.whl

Total release size: 760.5 kB

Release files / draive-0.120.0.tar.gz

Download URL draive-0.120.0.tar.gz
Size 324.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7993fe58e1305b0174a4f9315feef2cefff3be0680ecb2a630c39cbc7e20678a
BLAKE2b-256 checksum
How to use checksums
4c7b4725d5059ff4e66370b7299ba5ac13cbf13c1c8d664a1bfe0744be1b7a2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / draive-0.120.0-py3-none-any.whl

Download URL draive-0.120.0-py3-none-any.whl
Size 435.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cffa6eb74065fa5404db793a21675c8267f98233bc35c70276f14fb32c39eda6
BLAKE2b-256 checksum
How to use checksums
5f5981e053e6a84d525d5933c705f04e9120f1849cd44785ad6665ee50d423be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for draive 0.120.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.120.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page