Log Detective
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:
- Make sure your
MODELS_PATHenvironment variable points to a directory with your local LLM files. You can either edit the value in env_file, create a symlinkln -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
- Start the development stack with
make dev-up, or the production stack withmake prod-up. Both run in the background. Stop them withmake dev-downormake prod-down. For direct Podman Compose commands, change tocontainers/first and use the Compose filename there, see make targets. - When encountering timeout errors (you can check what happens in containers with
podman logs), If you getnginxtimeouts, 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:
- 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.
- Put the credentials JSON file into the project directory as
log-detective-vertex.json. Without this file, container creation will fail. - Update
server/config.yml:- Change
inference.modeltovertexai:model-name, such thatmodel-nameis a valid model provided by Vertex AI. - Set the related
inference.provider_settingsvalues in the same file.
- Change
- 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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| logdetective-5.2.1.tar.gz | 91.7 kB | With provenance | Details for logdetective-5.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| logdetective-5.2.1-py3-none-any.whl | Python 3 | none | any | Details for logdetective-5.2.1-py3-none-any.whl |
Total release size: 201.1 kB
Release files / logdetective-5.2.1.tar.gz
| Download URL | logdetective-5.2.1.tar.gz |
|---|---|
| Size | 91.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70c2132fc7437417bc6c89c7bfd33fd514b32e8395603cf4bc37d379953235c8
|
|
BLAKE2b-256 checksum How to use checksums |
795cdea77a142c305097ae8818b1316224a4e884468c8ee1c123d249be52d477
|
| 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 Dec 1, 2026.
Transparency logRelease files / logdetective-5.2.1-py3-none-any.whl
| Download URL | logdetective-5.2.1-py3-none-any.whl |
|---|---|
| Size | 109.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc3f01f873e860068297a81eab3e7b81fe6fbaf758705e2a7d811dd20077fcdb
|
|
BLAKE2b-256 checksum How to use checksums |
64abd71ee3ee216203cb7acf5bd5f20836e7c97de5174cc28c01b0fd8ae2ee1c
|
| 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 Dec 1, 2026.
Transparency logSecurity for logdetective 5.2.1
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.
Attestation for logdetective-5.2.1.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 Dec 1, 2026.
Transparency logA 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.