Skip to main content

llm-bot

Async Python library and LLM-backed bot service.

The current implementation exposes embeddings, stateless chat and grounded HRAG answering, sentiment analysis, title generation, summary, named entity recognition, entity relationship extraction, structured graph retrieval planning, translation, linking, clustering, and classification endpoints backed by OpenAI-compatible APIs and a decisions API.

Requirements

  • uv
  • Python 3.13 or newer

Python library

Install a published release into a Python 3.13+ project with uv add "taranis-llm-bot[inference]". The PyPI distribution is taranis-llm-bot; Python imports use llm_bot. The base install supports prepared HRAG tasks with an injected transport. Install taranis-llm-bot[inference] for the bundled HTTP clients; [server] adds the HTTP service. Before publishing, install a locally built wheel with uv add /absolute/path/to/taranis_llm_bot-VERSION-py3-none-any.whl.

Set LLM_BASE_URL, LLM_API_KEY, and optionally LLM_MODEL and LLM_API_MODE in the environment or .env before importing the library. Call the async task functions directly; no bot HTTP server is needed:

import asyncio

from llm_bot.schemas import SummarizeRequest
from llm_bot.tasks.summarize import summarize


async def main():
    result = await summarize(SummarizeRequest(text="Text to summarize", language="en", max_words=80))
    print(result.summary)
    # result.model_dump() returns a dictionary.


asyncio.run(main())

In an existing async application, use await summarize(...) directly. Other tasks follow the same pattern: request models in llm_bot.schemas, async functions in llm_bot.tasks (for example, ner.extract_entities and translate.translate_text). Generative tasks accept an optional client=LLMClient(...) to override the connection; import it from llm_bot.client. Inputs and outputs are Pydantic models, and errors propagate to the caller. Linking also needs the LOOKUP_* configuration. Cybersecurity classification uses the independent DECISIONS_* connection when DECISIONS_URL is set; you can inject a DecisionsClient from llm_bot.decisions_client or an LLMClient to explicitly select either transport. Fine-grained classification uses ClassifyRequest and llm_bot.tasks.classify.classify_text, always with a DecisionsClient and the DECISIONS_* connection. Sentiment analysis also requires this connection and accepts an optional DecisionsClient override.

For the HTTP service, install the server extra with uv add "taranis-llm-bot[server]". Then import create_app from llm_bot.app and expose app = create_app() in your ASGI entry point.

Setup

uv sync --locked --extra dev --extra server
./scripts/check.sh
cp .env.example .env

Configure the following values in .env:

  • LLM_BASE_URL
  • LLM_API_KEY
  • LLM_MODEL (optional if your OpenAI-compatible backend provides a default model)
  • LLM_API_MODE: responses (default) or chat_completions

See Configuration for optional settings.

To route /cybersec-classification to a decision model, also set DECISIONS_URL to the full endpoint URL, DECISIONS_MODEL, and DECISIONS_API_KEY if required. DECISIONS_API_MODE=systemone (default) supports OpenRouter's https://openrouter.ai/api/alpha/decisions and llama.cpp/vLLM /v1/systemone; use openai for /v1/decisions. The public classification response stays unchanged.

POST /classify requires the same decisions configuration. Send {"text":"Article text"} to receive probabilities for disinformation, security incident, vulnerability, threat intelligence, security policy, security news, general news, and other. These describe the main topic; disinformation is a topic label, not a truth verdict. See the classification API for category definitions. The live evaluation records 24 examples and how to rerun them.

POST /sentiment also requires decisions configuration. Its response keeps the sentiment.label and sentiment.score fields, with the score taken from the winning label's probability. Set include_emotions: true for compatible Plutchik emotions, assessed independently in the same decisions request. Existing sentiment reasoning fields are accepted but ignored. There is no generative fallback.

Run

uv sync --locked --extra server
uv run granian --interface asgi app:app --port 5500

API

See the API reference for endpoint examples. Interactive Swagger docs are available at GET /docs; the OpenAPI document is at GET /openapi.yaml.

Guides

Development checks

uv sync --locked --extra dev --extra server
uv run pre-commit install
./scripts/check.sh

The script installs development dependencies, checks lint and formatting (including Python examples in Markdown), and runs the full test suite. The installed pre-commit hook, pull request CI, and release validation all run this same script. Run uv run pre-commit run --all-files to check manually.

Metadata

Release files for taranis-llm-bot 0.1.8

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

Source distribution (sdist)

Source distribution for taranis-llm-bot 0.1.8
File Size Uploaded Provenance Actions
taranis_llm_bot-0.1.8.tar.gz 176.7 kB Without provenance Details for taranis_llm_bot-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for taranis-llm-bot 0.1.8
File Interpreter ABI Platform Actions
taranis_llm_bot-0.1.8-py3-none-any.whl Python 3 none any Details for taranis_llm_bot-0.1.8-py3-none-any.whl

Total release size: 247.4 kB

Release files / taranis_llm_bot-0.1.8.tar.gz

Download URL taranis_llm_bot-0.1.8.tar.gz
Size 176.7 kB
Tags Source
SHA-256 checksum
How to use checksums
aaea3eede90a8a1b774888d199fc05c9c9f0c882ed7a084d62461324dbbabf92
BLAKE2b-256 checksum
How to use checksums
34845ffef9acdfd5efd669f505129a0969d8f1a2c8fe3773e5f397b2b85bd53b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / taranis_llm_bot-0.1.8-py3-none-any.whl

Download URL taranis_llm_bot-0.1.8-py3-none-any.whl
Size 70.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fda8ab9c99a0293d38a55d033948db9f73d29409f400594f3e5cbecc7b562325
BLAKE2b-256 checksum
How to use checksums
cb8069113cdea2c32746f4c4787fa2c263e6a5277e31a6e0d45de3c861d1fd81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 taranis-llm-bot 0.1.8

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.

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