Skip to main content

Log Detective

PyPI - Version

A tool, service and RHEL process integration to analyze logs using Large Language Model (LLM) and a Drain template miner within BeeAI agentic framework.

Service explaining logs is available at: https://logdetective.com/explain

Note: code of the logdetective.com website is at github.com/fedora-copr/logdetective-website.

Note: Log Detective used to be developed as both a CLI tool and a FastAPI server. The CLI tool is now deprecated and has been removed from this repository since 5.0 release. Please keep in mind that there still might be traces and references to it.

Server

For locally setting up the FastAPI server, you would need a postgresql and some inference server.

Log Detective has been built as inference agnostic service. The only requirement, is that the inference server must provide OpenAI API.

We provide two example deployment configurations. The development configuration is intended for local testing of changes, and uses own llama.cpp server image.

The sample production configuration, uses 4 load balanced vLLM servers.

Use the make targets from the project root directory to start and stop either deployment. The development and production files extend containers/docker-compose.yaml. The installed podman-compose mishandles their relative bind mounts when invoked with a containers/... file path. The Make targets avoid this by running Compose from containers/.

The basic setup:

  1. Make sure your MODELS_PATH environment variable points to a directory with your local LLM files. You can either edit the value in env_file, create a symlink ln -s /directory/with/your/llms ./models, or:
    $ export MODELS_PATH=/path/to/models/
    $ ll $MODELS_PATH
    -rw-r--r--. 1 tt tt 3.9G apr 10 17:18  granite-4.0-h-tiny-Q8_0.gguf
    
  2. Start the development stack with make dev-up, or the production stack with make prod-up. Both run in the background. Stop them with make dev-down or make prod-down. For direct Podman Compose commands, change to containers/ first and use the Compose filename there, see make targets.
  3. When encountering timeout errors (you can check what happens in containers with podman logs), If you get nginx timeouts, try setting/increasing timeouts in server/nginx_dev.conf.template:
        server {
        listen ${INFERENCE_PROXY_PORT};
    +   proxy_connect_timeout 300s;
    +   proxy_send_timeout 300s;
    +   proxy_read_timeout 300s;
        location / {
            proxy_pass http://inference_backend;
            proxy_set_header Host $host;
        }
    

If the MODELS_PATH variable is not set, ./models is mounted inside by default.

Models can be downloaded from our Hugging Space.

Usage

Submit a log for analysis:

curl --header "Content-Type: application/json" --request POST \
     --data '{"files":[{"name":"build.log","content":"ERROR: missing dependency"}]}' \
     http://localhost:8080/analyze

The request returns 202 Accepted with a Location header for polling. Endpoint schemas are available from the running server at /docs and /openapi.json.

Documentation

  • API guide: API structure and operation
  • Agents: general and Testing Farm analysis workflows
  • Tools: tool operation
  • Workers: worker architecture and task processing
  • Database: generating migrations and table ownership

Production instance

Our FastAPI server and model inference server run through podman-compose on an Amazon AWS instance. The VM is provisioned by an ansible playbook.

You can control the server through:

cd /root/logdetective/containers
podman-compose --project-name logdetective -f docker-compose-prod.yaml ...

The /root directory contains valuable data. If moving to a new instance, please backup the whole directory and transfer it to the new instance.

In order to run containers with Nvidia GPU support, you need to have generate a CDI specification, which can be done through:

nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml

HTTPS certificate generated through:

certbot certonly --standalone -d logdetective01.fedorainfracloud.org

Certificates need to be be placed into location specified by the LOGDETECTIVE_CERTDIR env var and the service should be restarted.

Using with Vertex AI

To be able to use Log Detective with Vertex AI:

  1. You will need to have access to the Service account ADC (Application Default Credentials) JSON file
    • To use our (Log Detective project) Vertex AI Service account credentials, you will need access to our Bitwarden vault.
    • Alternatively, you can use Google Cloud Platform in order to generate a new credential file.
  2. Put the credentials JSON file into the project directory as log-detective-vertex.json. Without this file, container creation will fail.
  3. Update server/config.yml:
    • Change inference.model to vertexai:model-name, such that model-name is a valid model provided by Vertex AI.
    • Set the related inference.provider_settings values in the same file.
  4. Mount the Vertex credentials JSON at the path configured by inference.provider_settings.vertex_credentials.

The server and worker intentionally use the same application configuration and are therefore in the same configuration trust domain. The separate API bearer token file selected by LOGDETECTIVE_TOKENS_FILE remains server-specific. Set general.sentry_dsn in server/config.yml to enable Sentry in both the API server and worker containers. When it is unset, Sentry is disabled in both.

Choice of LLM

The build agent's extractor, database lookup, and snippet annotation workflow is described in Build analysis agent.

Log Detective requires an instruction tuned model with tool calling to function properly.

Whether or not the model has been trained to work with instructions can be determined by examining the model card, or simply by checking if it has instruct in its name.

Log Detective uses /chat/completions API as defined by OpenAI. The API must support both system and user roles, in order to properly work with a system prompt. The system role defaults to developer

Configuration field system_role can be used to set role name for APIs with non-standard roles. However, proper function of Log Detective can not be guaranteed in such cases.

License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.

Metadata

Release files for logdetective 5.2.0

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

Source distribution (sdist)

Source distribution for logdetective 5.2.0
File Size Uploaded Provenance Actions
logdetective-5.2.0.tar.gz 91.2 kB With provenance Details for logdetective-5.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for logdetective 5.2.0
File Interpreter ABI Platform Actions
logdetective-5.2.0-py3-none-any.whl Python 3 none any Details for logdetective-5.2.0-py3-none-any.whl

Total release size: 200.0 kB

Release files / logdetective-5.2.0.tar.gz

Download URL logdetective-5.2.0.tar.gz
Size 91.2 kB
Tags Source
SHA-256 checksum
How to use checksums
08d278b5243d2f344d4c645d119a2dcb43478bee84aa7c250896a82090a504d9
BLAKE2b-256 checksum
How to use checksums
db301c8aeea00067c7e92371420c141cb74bad476bae4c330f91830785c6775b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / logdetective-5.2.0-py3-none-any.whl

Download URL logdetective-5.2.0-py3-none-any.whl
Size 108.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e36335d5a37be93685300b0d6270a0c8043524956b92410ac4f87df1bc92003f
BLAKE2b-256 checksum
How to use checksums
239bbc6d149bb2fd26e1654979cb4cb508e024388f56728adaa72d42c4957b97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for logdetective 5.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for logdetective-5.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

5.2.0 This release

2 release files Full provenance

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