Skip to content

DO NOT MERGE: Testing Typescript LLM Functions - #2327

Draft
Mephistic wants to merge 6 commits into
codeforboston:mainfrom
Mephistic:ts-summaries-v2
Draft

Mephistic wants to merge 6 commits into
codeforboston:mainfrom
Mephistic:ts-summaries-v2

Conversation

@Mephistic

Copy link
Copy Markdown
Collaborator

Summary

This PR is a second attempt at moving the currently running Python-based LLM bill summary/tag generation into TypeScript (to avoid maintaining a second Firebase deploy pipeline for one function) - the older PR had some parity issues based around tokenization, so this one focuses on matching the existing behavior exactly.

Open issues for a follow-up PR include:

  • Removing the old Python firebase functions in LLM (I'll pause the functions on deploying this to dev to ensure no double-processing) and the maple-llm codebase from firebase.json
    • This should simplify the process of splitting out our existing TS functions into multiple codebases to speed up deploys
  • Updating to use more idiomatic TypeScript (excluded for the initial deploy to ensure we don't break any expected functionality in the Python -> TS cutover)
  • Renaming the OPENAI_DEV/OPENAI_PROD secrets (we can configure these by env, we shouldn't need to split them if we're not working around
    • And possibly, based on another issue, cutting over from 4o-mini to a more recent model (likely a Google-developed one, given the rest of our infra is already on Google Cloud)
  • Integrating the Large Bill Document Text processing into the LLM workflow. We have an open PR or two with attempts to address the Large Bill case - hopefully, we can simplify the fetch process by building on that effort.
  • Consider disabling this for the start of the new session?
    • Near the start of a session, thousands of bills are uploaded in quick succession - depending on API costs, it may be better to summarize/tag these bills with the backfill script in DEV and then migrate those summaries to PROD.

Deploy Notes

  • Create the OPENAI_API_KEY Firebase Functions Secret on DEV and PROD
    • Can use the existing values in OPENAI_DEV and OPENAI_PROD, and can delete those older secrets once the new ones are live
  • Pause the existing bill_on_document_created function (to avoid double processing)

@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
maple-dev Ready Ready Preview Oct 31, 2026 9:04pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview – maple-dev — 0701d4e7 Deployed Oct 31, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant