Skip to content
github-actions[bot] edited this page Aug 31, 2026 · 2 revisions

ThemisDB LLM Python SDK

Python client library for ThemisDB LLM operations with Bearer Token authentication.

Installation

pip install themis-llm

Quick Start

from themis_llm import ThemisLLMClient

# Initialize client with bearer token
client = ThemisLLMClient(
    base_url="http://localhost:8080",
    bearer_token="your-jwt-token"
)

# Simple inference
response = client.infer(
    prompt="What is ThemisDB?",
    model="mistral-7b",
    max_tokens=512
)
print(response.text)

# RAG inference
rag_response = client.rag(
    query="Explain legal clause",
    collection="legal_docs",
    top_k=5,
    lora="legal-qa"
)

# Streaming
for token in client.stream_infer(prompt="Tell me a story", model="mistral-7b"):
    print(token, end="", flush=True)

# Model management
client.load_model("mistral-7b", "/models/mistral-7b.gguf")
models = client.list_models()

Features

  • βœ… Bearer Token (JWT) authentication
  • βœ… Inference, RAG, and embedding generation
  • βœ… Real-time streaming with Server-Sent Events
  • βœ… Model and LoRA management
  • βœ… Statistics and health checks
  • βœ… Comprehensive error handling
  • βœ… Context manager support

License

Apache 2.0


ThemisDB 1.9.0-beta Β· Home Β· Module-Index Β· GitHub Β· Issues

ThemisDB Wiki

🏠 Overview

πŸš€ Getting Started

πŸ“– Tutorials

πŸ“— User Guide

βš™οΈ Operations & Security

πŸ“Ÿ Ops Runbooks

πŸ—οΈ Architecture

πŸ“ ADRs

πŸ”§ Contributing

πŸ“‹ Governance

πŸ” Audit

🧩 Plugins

πŸ”Œ Adapters

πŸ’‘ Examples

πŸ“¦ Client SDKs

πŸŽ“ Training

πŸ› οΈ Tools

πŸ€– Developer LLM Wiki

Clone this wiki locally