Skip to main content

Core library for LLM chatbot integration with multi-provider support (OpenAI, Anthropic, LangDock, OpenRouter, Mammouth, Azure, Vertex AI, Local)

Project description

eq-chatbot-core

License Python PyPI

Core library for LLM chatbot integration with multi-provider support.

Language / Sprache: DE | EN


English

Overview

eq-chatbot-core is a Python library for integrating Large Language Models (LLMs) into your applications. It provides a unified interface across cloud and local providers, security primitives, an MCP client, a RAG pipeline, and an optional HTTP/SSE sidecar — usable from any language.

Originally extracted from an Odoo 18 chatbot integration; works standalone without any Odoo dependency.

Key Features

  • Multi-Provider Support — OpenAI, Anthropic, Azure AI, Google Vertex AI, LangDock, OpenRouter, Mammouth AI, Local (LM Studio/Ollama)
  • Unified API — same interface regardless of provider
  • Temperature Safety — automatic model-specific temperature clamping
  • Security — Fernet encryption, prompt-injection detection, file-upload validation, token-bucket rate limiting
  • RAG Pipeline — chunking, embeddings, Qdrant-backed retrieval, context-window management
  • MCP Client — HTTP/SSE and stdio transports, hardened against DNS rebinding and SSRF
  • CLI Tool — provider testing, model discovery, programmatic JSON I/O chat
  • HTTP/SSE Server Mode (v1.7.0) — run as a local sidecar (eq-chatbot serve) for cross-language integrations (Avalonia/.NET, Electron, native mobile)

Installation

# Basic installation
uv pip install eq-chatbot-core
# (or: pip install eq-chatbot-core)

# With optional extras
uv pip install eq-chatbot-core[pdf]       # PDF→image conversion (vision)
uv pip install eq-chatbot-core[security]  # MIME-type file validation
uv pip install eq-chatbot-core[azure]     # Azure AI Foundry
uv pip install eq-chatbot-core[vertex]    # Google Vertex AI
uv pip install eq-chatbot-core[server]    # HTTP/SSE sidecar (FastAPI + uvicorn)
uv pip install eq-chatbot-core[local]     # Local sentence-transformers embeddings

# All optional dependencies
uv pip install eq-chatbot-core[pdf,security,azure,vertex,server,local,dev]

Quick Start

from eq_chatbot_core.providers import get_provider

provider = get_provider("openai", api_key="sk-...")

response = provider.chat_completion(
    messages=[{"role": "user", "content": "Hello!"}],
    model="gpt-4o",
)
print(response.content)

For more — streaming, other providers, ADC for Vertex, error handling — see docs/providers.md.

Documentation

Topic Docs
Multi-provider integration docs/providers.md
CLI commands docs/cli.md
HTTP/SSE server mode docs/server-mode.md
Security (encryption, injection, files, rate limit) docs/security.md
MCP client (HTTP/SSE + stdio) docs/mcp.md
RAG pipeline (chunking, embedding, retrieval) docs/rag.md
Testing (markers, integration setup, cost-aware patterns) docs/testing.md

Realtime Providers

ElevenLabs (Recommended GDPR Provider)

ElevenLabs Conversational AI ("elevenlabs") is the recommended provider for EU/GDPR deployments.

from eq_chatbot_core.realtime import get_realtime_provider

provider = get_realtime_provider(
    "elevenlabs",
    api_key="xi-...",
    agent_id="YOUR_AGENT_ID",
)

OpenAI Realtime and Gemini Live remain supported providers. ElevenLabs is recommended for EU-regulated deployments because it offers an enterprise-grade EU data residency path.

Full EU Compliance Checklist

Four conditions must ALL be met for complete data residency compliance:

  1. Enterprise plan — EU data residency is available on the Enterprise plan only. Standard and Creator plans route data through US infrastructure.

  2. Zero Retention Mode — Enable Zero Retention Mode in the ElevenLabs Enterprise dashboard and confirm it via the Zero Retention API. Covers TTS, STT, and Conversational AI sessions. Voice cloning models are excluded (see caveat below).

  3. EU-hosted Custom LLM backend — ElevenLabs Agents orchestrate an LLM under the hood. For full EU residency, configure a Custom LLM endpoint hosted in the EU (e.g. Azure OpenAI EU region, or a self-hosted model in an EU data centre). Configure this in the ElevenLabs dashboard, not in the adapter.

  4. EU data-residency endpoint — Pass the EU base URL as base_url:

    from eq_chatbot_core.realtime import get_realtime_provider
    
    provider = get_realtime_provider(
        "elevenlabs",
        api_key="YOUR_EU_API_KEY",   # EU key — different from global key
        agent_id="YOUR_AGENT_ID",
        base_url="wss://api.eu.residency.elevenlabs.io",
    )
    

    Important: The EU API key is a separate key provisioned by ElevenLabs Enterprise support. Your global xi-api-key will return 403 Forbidden on the EU endpoint.

Voice Cloning Caveat

Voice cloning models are not eligible for Zero Retention Mode — cloned voice model data persists in ElevenLabs infrastructure. If your use case requires voice cloning, assess whether that data qualifies as personal data under GDPR before deploying in an EU-regulated context.


Deutsch

Überblick

eq-chatbot-core ist eine Python-Bibliothek zur Integration von Large Language Models (LLMs) in Anwendungen. Bietet eine einheitliche Schnittstelle über Cloud- und lokale Provider, Security-Primitives, einen MCP-Client, eine RAG-Pipeline und einen optionalen HTTP/SSE-Sidecar — aus jeder Sprache nutzbar.

Ursprünglich aus einer Odoo-18-Chatbot-Integration extrahiert; funktioniert standalone ohne Odoo-Abhängigkeit.

Hauptfunktionen

  • Multi-Provider-Unterstützung — OpenAI, Anthropic, Azure AI, Google Vertex AI, LangDock, OpenRouter, Mammouth AI, Local (LM Studio/Ollama)
  • Einheitliche API — gleiche Schnittstelle unabhängig vom Provider
  • Temperature-Sicherheit — automatisches modellspezifisches Temperature-Clamping
  • Sicherheit — Fernet-Verschlüsselung, Prompt-Injection-Erkennung, File-Upload-Validierung, Token-Bucket-Rate-Limiting
  • RAG-Pipeline — Chunking, Embeddings, Qdrant-basiertes Retrieval, Context-Window-Management
  • MCP-Client — HTTP/SSE und stdio Transports, gehärtet gegen DNS-Rebinding und SSRF
  • CLI-Tool — Provider-Tests, Modell-Discovery, programmatische JSON-I/O-Chat-Calls
  • HTTP/SSE-Server-Mode (v1.7.0) — lokaler Sidecar (eq-chatbot serve) für Cross-Language-Integrationen (Avalonia/.NET, Electron, native Mobile)

Installation

# Basis-Installation
uv pip install eq-chatbot-core
# (oder: pip install eq-chatbot-core)

# Mit optionalen Extras
uv pip install eq-chatbot-core[pdf]       # PDF→Bild-Konvertierung (Vision)
uv pip install eq-chatbot-core[security]  # MIME-Type-File-Validation
uv pip install eq-chatbot-core[azure]     # Azure AI Foundry
uv pip install eq-chatbot-core[vertex]    # Google Vertex AI
uv pip install eq-chatbot-core[server]    # HTTP/SSE-Sidecar (FastAPI + uvicorn)
uv pip install eq-chatbot-core[local]     # Lokale sentence-transformers-Embeddings

# Alle optionalen Abhängigkeiten
uv pip install eq-chatbot-core[pdf,security,azure,vertex,server,local,dev]

Quick Start

from eq_chatbot_core.providers import get_provider

provider = get_provider("openai", api_key="sk-...")

response = provider.chat_completion(
    messages=[{"role": "user", "content": "Hallo!"}],
    model="gpt-4o",
)
print(response.content)

Für mehr — Streaming, andere Provider, ADC für Vertex, Error-Handling — siehe docs/providers.md.

Dokumentation

Thema Docs
Multi-Provider-Integration docs/providers.md
CLI-Befehle docs/cli.md
HTTP/SSE-Server-Mode docs/server-mode.md
Security (Verschlüsselung, Injection, Files, Rate-Limit) docs/security.md
MCP-Client (HTTP/SSE + stdio) docs/mcp.md
RAG-Pipeline (Chunking, Embedding, Retrieval) docs/rag.md
Testing (Marker, Integration-Setup, Cost-Aware-Patterns) docs/testing.md

Technical Information

Field Value
Package Name eq-chatbot-core
Version 1.7.4
Author Equitania Software GmbH
Contact info@ownerp.com
License MIT
Python >=3.10
Homepage https://www.ownerp.com
Repository https://github.com/equitania/eq-chatbot-core

Contributing

Contributions are welcome. Please open an issue or submit a pull request.

License

MIT — see LICENSE.

Project details


Download files

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

Source Distribution

eq_chatbot_core-1.7.5.tar.gz (810.9 kB view details)

Uploaded Source

Built Distribution

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

eq_chatbot_core-1.7.5-py3-none-any.whl (141.6 kB view details)

Uploaded Python 3

File details

Details for the file eq_chatbot_core-1.7.5.tar.gz.

File metadata

  • Download URL: eq_chatbot_core-1.7.5.tar.gz
  • Upload date:
  • Size: 810.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for eq_chatbot_core-1.7.5.tar.gz
Algorithm Hash digest
SHA256 eda6edf539f8e2c748bf9978f43e1a49eeaccc5fcfe2cae2293db7ce3f853c0d
MD5 d35f4a67a879c146bc9ad6ff03e95de3
BLAKE2b-256 13b0cc501ca0cb525a5b91cb1011ce548748e8a3840048ac082e04319a3b7016

See more details on using hashes here.

File details

Details for the file eq_chatbot_core-1.7.5-py3-none-any.whl.

File metadata

  • Download URL: eq_chatbot_core-1.7.5-py3-none-any.whl
  • Upload date:
  • Size: 141.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for eq_chatbot_core-1.7.5-py3-none-any.whl
Algorithm Hash digest
SHA256 97beb41a563ebc1f48859156d0e153583f03ebdf86c1eae95ef19584adff7574
MD5 5b9be61714f12a1705fa5c65d150a272
BLAKE2b-256 a4c94b1de7fee45bc660ba5cf7c99d44a3a8e2d4d3f2623d263830b70ca76ea7

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