Skip to main content

Python SDK for interacting with the Project David Platform Assistant API.

Project description

projectdavid — Python SDK

PyPI Downloads License: PolyForm Noncommercial Python 3.10+ Lint, Test, Tag, Publish Status


The Python SDK for Project David — the open source, GDPR compliant successor to the OpenAI Assistants API.

Same primitives. Every model. Your infrastructure.


What is Project David?

Project David is a full-scale, containerized LLM orchestration platform built around the same primitives as the OpenAI Assistants API — Assistants, Threads, Messages, Runs, and Tools — but without the lock-in.

  • Provider agnostic — Hyperbolic, TogetherAI, Ollama, or any OpenAI-compatible endpoint. Point at any inference provider and the platform normalizes the stream.
  • Every model — hosted APIs today, raw local weights tomorrow. Bring your own model.
  • Your infrastructure — fully self-hostable, open source, GDPR compliant, security audited.
  • Production grade — sandboxed code execution (FireJail), multi-agent delegation, file serving with signed URLs, real-time streaming frontend.

Project Uni5 — the next milestone. transformers, GGUF, and vLLM adapters that mean a model straight off a training run has a full orchestration platform in minutes. From the lab to enterprise grade orchestration — instantly.


Project Activity & Reach

Metric Status
Total Downloads Total Downloads
Monthly Reach Monthly
Open Source Activity GitHub last commit
Analytics View Live Download Trends on ClickPy →

Installation

pip install projectdavid

Requirements: Python 3.10+ · A running Project David platform instance


Quick Start

import os
from dotenv import load_dotenv
from projectdavid import Entity

load_dotenv()

client = Entity(
    base_url=os.getenv("BASE_URL"),        # default: http://localhost:80
    api_key=os.getenv("ENTITIES_API_KEY"),
)

# Create an assistant
assistant = client.assistants.create_assistant(
    name="my_assistant",
    instructions="You are a helpful AI assistant.",
)

# Create a thread and send a message
thread = client.threads.create_thread()

message = client.messages.create_message(
    thread_id=thread.id,
    role="user",
    content="Tell me about the latest trends in AI.",
    assistant_id=assistant.id,
)

# Create a run
run = client.runs.create_run(
    assistant_id=assistant.id,
    thread_id=thread.id,
)

# Stream the response
stream = client.synchronous_inference_stream
stream.setup(
    user_id=os.getenv("ENTITIES_USER_ID"),
    thread_id=thread.id,
    assistant_id=assistant.id,
    message_id=message.id,
    run_id=run.id,
    api_key=os.getenv("PROVIDER_API_KEY"),
)

for chunk in stream.stream_chunks(
    model="hyperbolic/deepseek-ai/DeepSeek-V3-0324",
    timeout_per_chunk=15.0,
):
    content = chunk.get("content", "")
    if content:
        print(content, end="", flush=True)

See the Quick Start guide for the event-driven interface, tool calling, and advanced usage.


Why Project David?

OpenAI Assistants API LangChain Project David
Assistants / Threads / Runs primitives
Provider agnostic Partial
Local model support Partial
Raw weights → orchestration (Uni5)
Sandboxed code execution ✅ Black box ✅ FireJail PTY
Multi-agent delegation Limited
Self-hostable
GDPR compliant N/A
Security audited N/A N/A
Open source
Community Adoption Proprietary High Total Downloads

Supported Inference Providers

Full list of supported providers and endpoints →

Works with any OpenAI-compatible endpoint out of the box — including Ollama for fully local inference.


Environment Variables

Variable Description
ENTITIES_API_KEY Your Entities API key
ENTITIES_USER_ID Your user ID
BASE_URL Platform base URL (default: http://localhost:80)
PROVIDER_API_KEY Your inference provider API key

Documentation

Documentation

Topic Link
Full Documentation docs.projectdavid.co.uk
Quick Start docs.projectdavid.co.uk/docs/sdk-quick-start
Assistants docs.projectdavid.co.uk/docs/sdk-assistants
Threads docs.projectdavid.co.uk/docs/sdk-threads
Messages docs.projectdavid.co.uk/docs/sdk-messages
Runs docs.projectdavid.co.uk/docs/sdk-runs
Inference docs.projectdavid.co.uk/docs/sdk-inference
Tools docs.projectdavid.co.uk/docs/sdk-tools
Function Calls docs.projectdavid.co.uk/docs/sdk-function-calls
Code Interpreter docs.projectdavid.co.uk/docs/sdk-code-interpreter
Files docs.projectdavid.co.uk/docs/sdk-files
Vector Store docs.projectdavid.co.uk/docs/sdk-vector-store
Stream Contract docs.projectdavid.co.uk/docs/sdk-stream-contract
Providers docs.projectdavid.co.uk/docs/providers

Full SDK documentation →

Full hosted docs coming at docs.projectdavid.co.uk


Related Repositories

Repo Description
projectdavid-core Runtime API engine
projectdavid-platform Docker orchestration layer
projectdavid-common Shared utilities and validation
projectdavid-docs Documentation site
entities_cook_book Minimal tested examples


License

PolyForm Noncommercial 1.0.0

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

projectdavid-1.99.0.tar.gz (99.7 kB view details)

Uploaded Source

Built Distribution

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

projectdavid-1.99.0-py3-none-any.whl (80.2 kB view details)

Uploaded Python 3

File details

Details for the file projectdavid-1.99.0.tar.gz.

File metadata

  • Download URL: projectdavid-1.99.0.tar.gz
  • Upload date:
  • Size: 99.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for projectdavid-1.99.0.tar.gz
Algorithm Hash digest
SHA256 157f17b9e2a865b83fbbf6f11e20ff9e032abb3d7e4c23088c40466df2b2ea8a
MD5 1fc02b54e3a2b41cc17d4a2b8cc06d6e
BLAKE2b-256 4cecdba8d43346a1a04c06f68a756eac199f6547dfe15c642349a5d5e9aad0b2

See more details on using hashes here.

File details

Details for the file projectdavid-1.99.0-py3-none-any.whl.

File metadata

  • Download URL: projectdavid-1.99.0-py3-none-any.whl
  • Upload date:
  • Size: 80.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for projectdavid-1.99.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a85bcb14d5f5eb8f0a9e34d334046546fb14cd7895d1d7fc46c28000991bf1fd
MD5 19c6df13f489c5e10fa87781c83809fd
BLAKE2b-256 5bbe454c7c4391caf91826dd569a7a7056cdc12690fe35cd0e8ea4b91e479819

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