Built a custom Open WebUI Pipe Function that registers as a “model” in the UI, encapsulating a full persona-and-survey workflow behind a single selectable model. Open WebUI
Exposed runtime controls as Valves (top-N categories, respondent/page limits), so analysts can tweak behavior from the model’s sidebar without code changes. Open WebUI
Implemented an async streaming generator compatible with Open WebUI’s streaming pipeline, ensuring responsive, SSE-friendly updates during long persona runs. Open WebUI+1
Integrated OpenAI APIs end-to-end: text-embedding-3-small for similarity features and chat completions for extraction, follow-ups, and persona JSON output. OpenAI Platform+1
Added a pause/resume follow-up loop that asks targeted clarifiers once, merges answers back into the state, and then continues generation automatically.
Wired PostgreSQL via psycopg2 with RealDictCursor and sensible statement_timeout, making queries reliable and results easy to shape for downstream JSON. Psycopg+1
Implemented vector-driven category similarity and a respondent finder (LATERAL joins + paging) to pull the most representative purchase cohorts.
Mapped user or GPT-selected templates into seven finalized survey questions, auto-filling [brand] and [category] placeholders, and persisted both questions and persona responses with stable IDs.
Generated inline, base64 matplotlib histograms for answers and demographics, so insights arrive visually in the same streamed response.
Wrapped everything with robust error handling, audit-friendly logs, and deterministic state keys—turning the Pipe into a production-ready, self-serve “custom model” for insights.