Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Aixtrade/LLMTrigger

Repository files navigation

LLMTrigger

English | 中文

Hybrid intelligent event trigger system that combines a traditional rules engine with LLM-based reasoning to monitor events and send notifications.

Overview

  • FastAPI API for rule management, testing, and history.
  • Hybrid rule engine: expression-based filters + LLM validation.
  • RabbitMQ for event ingestion; Redis for state, context, and throttling.
  • Notification channels for email, Telegram, and WeCom (extensible).
  • Observability hooks for metrics and tracing.

Quick Start

Prerequisites

  • Python 3.12+
  • Docker (for Redis + RabbitMQ)
  • uv (recommended) or another Python environment manager

Setup

cp .env.example .env
docker-compose up -d
uv sync --dev

Run API

uv run uvicorn llmtrigger.api.app:app --reload --port 8203

API docs: http://localhost:8203/docs

Configuration

Settings are loaded from environment variables and .env. Common options:

  • REDIS_URL, RABBITMQ_URL, RABBITMQ_QUEUE
  • OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_MODEL
  • NOTIFICATION_MAX_RETRY, NOTIFICATION_DEFAULT_COOLDOWN

Keep secrets out of version control and use .env locally.

Project Structure

  • llmtrigger/api/: FastAPI app, dependencies, and routes
  • llmtrigger/engine/: rule engine and LLM logic
  • llmtrigger/messaging/: RabbitMQ consumer and handlers
  • llmtrigger/storage/: Redis clients and stores
  • llmtrigger/notification/: notification dispatcher, worker, channels
  • llmtrigger/core/: config and logging
  • tests/: unit and integration tests
  • docs/: architecture and design notes

Testing

uv run pytest

Tests use pytest + pytest-asyncio and live under tests/.

Contributing

See AGENTS.md for contributor guidelines, style, and PR expectations.

License

MIT License. See LICENSE.

About

基于规则引擎 + LLM 的智能事件监控和通知服务 Hybrid intelligent event trigger system that combines a traditional rules engine with LLM-based reasoning to monitor events and send notifications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /