Python SDK for interacting with the Entities Assistant API.
Project description
projectdavid — Python SDK
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.
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:9000
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 | ❌ | ✅ | ✅ |
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:9000) |
PROVIDER_API_KEY |
Your inference provider API key |
Documentation
| Topic | Link |
|---|---|
| Quick Start | sdk-quick-start.md |
| Assistants | sdk-assistants.md |
| Threads | sdk-threads.md |
| Messages | sdk-messages.md |
| Runs | sdk-runs.md |
| Inference | sdk-inference.md |
| Tools | sdk-tools.md |
| Function Calls | function-calling-and-tool-execution.md |
| Code Interpreter | sdk-code-interpreter.md |
| Files | sdk-files.md |
| Vector Store | sdk-vector-store.md |
Full hosted docs coming at
docs.projectdavid.co.uk
Related Repositories
| Repo | Description |
|---|---|
| platform | Core orchestration engine |
| entities-common | Shared utilities and validation |
| david-core | Docker orchestration layer |
| reference-frontend | Reference streaming frontend |
| entities_cook_book | Minimal tested examples — streaming, tools, search, stateful logic |
Project Uni5 — Roadmap
The next major milestone extends Project David to every model deployment scenario:
Got freshly trained weights? → transformers adapter (Phase 1)
Got a quantized GGUF model? → GGUF / llama.cpp adapter (Phase 2)
Got a GPU cluster? → vLLM adapter (Phase 3)
Want a hosted provider? → already works
Running Ollama locally? → already works
Five scenarios. One platform. From the lab to enterprise grade orchestration — instantly.
License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file projectdavid-1.76.0.tar.gz.
File metadata
- Download URL: projectdavid-1.76.0.tar.gz
- Upload date:
- Size: 90.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
103e57825b9284e43624662131f58c92609efeed44138fd5be24c089b3c6084c
|
|
| MD5 |
9346b0e48e5de86fc37d80fd2a464657
|
|
| BLAKE2b-256 |
d4644724e2a323a4c4eaf2c0630d43eca1cc33f6f9023a346eda20525de3f9db
|
File details
Details for the file projectdavid-1.76.0-py3-none-any.whl.
File metadata
- Download URL: projectdavid-1.76.0-py3-none-any.whl
- Upload date:
- Size: 73.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64f5c0591794ba21c91a0e85fa85b38822b30f3d67e85388555f3b150c262c27
|
|
| MD5 |
7a361d285674622893fd76f2d5d00467
|
|
| BLAKE2b-256 |
5d59ad01363459bd59b83391b9c449e8b1b95535645697e0c8e72b458b7733ce
|