Ai Proxy
CodBi / AI Proxy — Authenticated reverse proxy to local LLAMA-server, Whisper-server, and
Tesseract OCR.
Servlet that proxies HTTP requests from authenticated external clients to local AI servers managed by LLAMA and Whisper, and to the in-process TesseractAction OCR engine. Provides IP-based access control, multi-user Basic Auth, and anonymised request logging into the Formcycle database.
Exposes the following endpoints through Formcycle's HTTP stack:
POST /plugin?name=CodBi_AI_Proxy&endpoint=/v1/chat/completions
POST /plugin?name=CodBi_AI_Proxy&endpoint=/completion
POST /plugin?name=CodBi_AI_Proxy&endpoint=/v1/audio/transcriptions
POST /plugin?name=CodBi_AI_Proxy&endpoint=/v1/ocrLLAMA and Whisper requests are forwarded via HTTP to their respective local server processes. Tesseract requests are handled in-process via JNI (no external server) through TesseractAction.performOcr.
Security is enforced via:
IP whitelist → plugin property
AI_Proxy_AllowedIPsHTTP Basic Auth → plugin property
AI_Proxy_Users
Every request is logged to the Formcycle database table codbi_ai_proxy with anonymised caller information (SHA-256 of username, first two octets of IP).
Plugin properties
| Property | Format | Example |
|---|---|---|
AI_Proxy_AllowedIPs | Comma-separated IPs / CIDRs | 192.168.1.0/24,10.0.0.5 |
AI_Proxy_Users | Comma-separated user:pass | alice:secret1,bob:secret2 |
Database
The audit table codbi_ai_proxy is managed by CodbiEntities using Formcycle's IPluginEntities API — the audit table schema is managed by Liquibase and data access uses JPA.
Functions
Reads plugin properties for IP whitelist and user credentials. Database setup is handled separately by CodbiEntities.
Initiates a task that removes unused images that're expired (msExpirationIDedImages) from the cache (cacheIDedImages).
Rejects tenant-level installation. CodBi must be installed as a system plugin because its AI services (Whisper, LLAMA) bind local server ports and manage heavyweight processes that would conflict when instantiated once per tenant.