How haidra-org/ai-horde works
AI Horde is a community-powered REST service that brokers image and text generation across volunteer workers. A client submits a request; API handling validates it, accounts for user priority and kudos, and queues work for compatible workers. Workers check in, advertise capabilities, and claim jobs; generation results return through the request lifecycle. The tree and README establish the product’s image/text, worker, and kudos domains. Some internal dispatch details are unsampled, so the graph omits uncertain links rather than inferring a complete pipeline.
Main entry points: base.py Shared API · flask.py Flask application · stable.py Image API · kudos_reservations.py Kudos reservations
Components 22
API and service
- Flask application
horde/flask.py - Shared API
horde/apis/v2/base.py - Image API
horde/apis/v2/stable.py - Text API
horde/apis/v2/kobold.py - Request models
horde/apis/models/v2.py - Image request models
horde/apis/models/stable_v2.py
Generation and workers
- Image queue
horde/classes/stable/waiting_prompt.py - Text queue
horde/classes/kobold/waiting_prompt.py - Image interrogation
horde/classes/stable/interrogation.py - Image workers
horde/classes/stable/worker.py - Text workers
horde/classes/kobold/worker.py - Interrogation workers
horde/classes/stable/interrogation_worker.py - Request scheduling
horde/request_scheduling.py
Users and kudos
- User accounts
horde/classes/base/user.py - Kudos ledger
horde/classes/base/kudos.py - Kudos reservations
horde/database/kudos_reservations.py
State and operations
- Domain persistence
horde/database/functions.py - Background processing
horde/database/threads.py - Redis coordination
horde/horde_redis.py - Model reference
horde/model_reference.py - Metrics and telemetry
horde/metrics.py
Other components
- API client
Connections 28
- API client → Flask application: sends requests
README.md - Flask application → Shared API: registers API
horde/flask.py - Flask application → Background processing: starts workers
horde/flask.py - Shared API → Request models: validates with
horde/apis/v2/base.py - Image API → Shared API: uses shared API
horde/apis/v2/stable.py - Text API → Shared API: uses shared API
- Image API → Image request models: parses with
horde/apis/v2/stable.py - Image API → Image queue: uses queue
horde/apis/v2/stable.py - Text API → Text queue: uses queue
- Shared API → User accounts: handles accounts
horde/apis/v2/base.py - Shared API → Domain persistence: calls persistence
horde/apis/v2/base.py - Image API → Kudos reservations: reserves kudos
horde/apis/v2/stable.py - Image queue → Request scheduling: scheduling support
- Image workers → Image queue: claims compatible work
- Text workers → Text queue: claims compatible work
- Interrogation workers → Image interrogation: processes tasks
horde/classes/stable/interrogation.py - Image workers → Model reference: validates models
horde/classes/stable/worker.py - Text workers → Model reference: checks model reference
horde/classes/kobold/worker.py - Image workers → Domain persistence: persists worker state
horde/database/functions.py - Text workers → Domain persistence: persists worker state
horde/database/functions.py - Interrogation workers → Kudos reservations: uses reservations
horde/classes/stable/interrogation_worker.py - User accounts → Kudos ledger: records movements
horde/classes/base/user.py - Kudos ledger → Kudos reservations: checks reserved balance
horde/database/kudos_reservations.py - Background processing → Domain persistence: calls persistence
horde/database/threads.py - Background processing → Kudos reservations: uses reservations
horde/database/threads.py - Flask application → Redis coordination: connects Redis
horde/flask.py - Flask application → Metrics and telemetry: initializes metrics
horde/flask.py - Request scheduling → Metrics and telemetry: records scheduling
horde/request_scheduling.py