metadata
title: NegOptim AI Service
emoji: π€
colorFrom: green
colorTo: blue
sdk: docker
app_port: 7860
pinned: false
NegOptim AI Service
Stateless FastAPI backend for the negOptimChatExternal Salesforce LWC. It wraps
Groq and OpenRouter LLMs with a schema-grounded NegOptim catalog, an embedding
router, three Salesforce tools (executed by Apex, not here), a per-query usage
report and a canned-response cache for small talk.
Endpoints
GET /healthβ liveness, active models, router modeGET /modelsβ selectable models (Groq + OpenRouter)GET /usage?model=<id>β daily usage for the selected modelPOST /chatβ one agent step (final answer or tool calls for Salesforce)
Configuration (Space secrets β Settings β Variables and secrets)
OPENROUTER_API_KEYβ required for OpenRouter modelsGROQ_API_KEYβ required for Groq models (preferred)SERVICE_API_KEYβ shared secret; must match the Salesforce custom settingOPENROUTER_MODEL/GROQ_MODELβ optional primary-model overrides
No Salesforce credentials live here β the org calls this service via a Named Credential, and the LLM's tool requests are executed inside Salesforce.