Back-end proposals and patches
The model side is largely done; the next gains are small back-end changes, data fixes and a native-speaker review. None of the proposals is applied and every one needs Peach's review before anything in CoreAPI (the hotel's back-end code) is edited. This is the back-end document, part of OKR 2 (the objective "AI service: performance, packaging, monitoring"). It is on Card 3 of the card list, together with the gateway document. The full table with file names is in serving/BACKEND_PROPOSALS.md.
Each proposal in plain words, with the example that led to it¶
The tests in the model-choice document (answer quality) and the speed document show where the hotel back-end, the program on 172.25.25.15 that talks to the model, loses quality or speed. This document lists what to change there. Nothing here is a test and nothing is applied. Each item below says what happens today, what to change, and the number that supports it. Words: the order reader is the back-end step that turns a sentence into an order or request (model-choice document, Test 2); a warm-up is a small request that keeps the hotel prompt stored in the model's cache; the callbot is the Korean phone bot that shares the Mac mini; Peach reviews and applies changes in the back-end, and Pin owns the guest clients and the test scenarios. The row numbers are those of the table further down.
Fix the data and the wording¶
- Row 2. Put opening hours in the facility records. Today: the question "What time does the gym open?" got "I am not certain about the specific hours for the fitness centre" in all 3 runs without the record (runs g1v-variant-v1-r1, g1v-variant-v1-r2 and g1v-veranda-qat, The Veranda), because the hours were only in a policy text. With the hours in the facility record the same question passed in both later rounds (runs g1v-facilities-r1 and r2). Change: copy opening hours into the facility records of gym, pools and spa.
- Row 3. Reword one intent row. Today: the front-desk row says to use it for anything that fits no other tile, so the model opened the front-desk tile for "what time is breakfast", "is there a pool" and "how much is the spa". Change: add "NOT for questions about the hotel (opening hours, prices, facilities)". Result on 75 sentences: 68 right with 6 false hits before, 73 right with 0 false hits after.
- Row 4. Strip quantities from item titles. Today: for the Thai sentence "two bottles of water, one pillow, the TV will not turn on" the local model wrote the item title "two bottles of water" with quantity 2 (Haiku wrote "Water bottles"). Both models missed that sentence for a different reason: they filed the water as a housekeeping request, where a kitchen order was expected. The test accepts "water" inside "two bottles of water", so this change would not fix that miss. It is the only line in the order tests where a title starts with a quantity, so treat it as a precaution, not a measured fix. Change: when the title starts with its own quantity, remove it, so the title is "water" and the quantity 2.
- Row 9. Fix the hotel data. Today (real export): the dish "Pad Thai goong" is listed twice with two prices (฿280 and ฿48), so the answer depends on which row the model picks (in the Hilbert run it quoted ฿48); the currency field is empty for every hotel; some hotels have no policies or dishes; some dishes have no description. Change: keep one entry, fill the currency, complete the data.
Rules in the code, not in the model¶
- Row 5. Keep information questions away from the order reader. Today: "what time does breakfast start" and "what is the wifi password" came back as a request (
front|request|Breakfast time|1|) instead of "no order". 5 of the local model's 6 misses on the 52 order sentences are of this kind. Change: route questions to the guide before the order reader, or send a lone front-desk "question" item to the guide. - Row 8. Let the code decide order or request for off-menu dishes. Today: "a margarita please" came back as a request instead of an order (3 dishes were filed this way: the Thai sushi set, the margarita and the Vietnamese beef pho). Change: the code compares the dish with the menu and decides.
Speed¶
- Row 10. Warm the guide prompt. Today: only the order-reader and reviser prompts are kept warm; the guide warm-up is off. A cold guide read takes about 16 s, a warm one 1.7 to 2.7 s (speed document). Change: switch the guide warm-up on for the live hotels only, with a long interval (for example 300 s), and warm once after every LLM restart.
Keep as is (rows 1, 6, 7, 11)¶
- Row 1. Keep the local model, the callbot add-on and the current guide prompt. Q3 was 148 against 181 right with corrupted text; the shorter prompt v3 was 7 lines worse.
- Row 6. Keep
LLM_MAX_CONCURRENTat 1. With the real guide prompt, 4 lanes were 11.09 s against 4.07 s for one lane at 30 questions per minute. - Row 7. Keep tests and the callbot replay off slot 3, and one big prompt in flight at a time: every slow request overlapped another.
- Row 11. Do not add "never send the guest to the front desk for something listed" to the guide prompt: 178 against 177.5, it fixed one answer and broke another.
The two patches, the data request and the teacher examples¶
- Row 12. Two patches are the changes of rows 3 and 4 written as small code changes (
serving/backend_patch/), so Peach can review the exact lines. They are not applied and not compiled. - Data request (
serving/DATA_REQUEST.md): SQL queries that export one hotel's facts, with no guest text, so the guide prompt can be rebuilt exactly and tested with real hotel data. - Teacher examples: 126 questions and answers that Claude Haiku wrote from hotel facts only (97 for training, 29 held out). They are material for a possible own add-on later; 126 is far too few to train anything now.
Proposals (nothing applied): 7 changes, 4 keep-as-is, 2 patches¶
What this table is for. It is the complete list of the 13 rows, one line each, with the evidence behind it; the section "Each proposal in plain words" above explains the main ones with examples. The columns are: the number of the row, what to change (or keep), and the evidence, which is the test result that led to it. Numbers such as "148 against 181" are right answers out of 188 questions (local model against today's), and numbers of seconds are the time until 9 of 10 answers were ready. A difference of less than about 5 questions is not proof, because the same test differs by that much on its own (see the quality-gate document).
| # | Change | Evidence |
|---|---|---|
| 1 | Keep the local QAT model, the callbot adapter and the current guide prompt; do not switch to Q3 or shorten the prompt | Q3: corrupted answers; shorter prompts up to 7 lines worse (v2 within the noise) |
| 2 | Put opening hours in the facility records (gym, pools, spa), not only in policy text | The gym question failed in every run without them and passed in both with them |
| 3 | Reword the front_desk intent row so it is not used for hotel questions |
Intent step 68 to 73 of 75; false hits 6 to 0 |
| 4 | Strip quantities from item titles ("two bottles of water" becomes "water", 2) | A precaution: one Thai sentence where the local model wrote the quantity in the title (not the cause of its miss) |
| 5 | Keep information questions away from the order reader, or send a lone front-desk "question" item to the guide | Both models filed "what time is breakfast" as a request |
| 6 | Keep LLM_MAX_CONCURRENT at 1 |
2 to 4 lanes were not faster than 1 on the real guide prompt (25 Nov); 3 slots gave 25 to 30% more only on a short prompt |
| 7 | Keep other clients (tests, callbot replay) off slot 3; keep one big prompt in flight | every slow request overlapped 1 to 8 other requests |
| 8 | Let the code, not the model, decide order against request for off-menu dishes | Three off-menu dishes filed as request |
| 9 | Fix the hotel data: the duplicate Pad Thai (฿280 and ฿48), the empty currency, the hotels with no policies or dishes, dishes with no description | Real export |
| 10 | Enable the guide warm-up for the live hotels only (ASSISTANT_GUIDE_WARM_HOTELS, long interval); warm the guide prompt after every LLM restart; shorter answers are faster |
Cold read 15 s, warm reply 1.7 to 2.7 s, writing 19 tokens per second |
| 11 | Do not add "never send the guest to the front desk for something listed" to the guide prompt | 178 against 177.5; fixed one answer, broke another |
| 12 | Two small code patches ready for review (not applied, not compiled): reword the front_desk intent row; strip a leading count from item titles |
In serving/backend_patch/; both pass git apply --check against the current CoreAPI files, but they are not compiled or tested (Go is not installed on this Mac) |
| 13 | Gateway changes are in their own file and in the gateway document | serving/GATEWAY_PROPOSAL.md |
Data request, teacher examples and what is needed from people¶
Data request (serving/DATA_REQUEST.md, read only, hotel facts only, no guest text), four parts:
- Sizes first (aggregates, safe to paste back).
- Real latency of the model (aggregates, no text).
- The rows of one hotel (hotel facts, JSON or CSV) so the guide prompt can be rebuilt exactly.
- Optional: one real prompt, captured once.
Teacher examples: Haiku wrote 126 questions and answers from each hotel's facts only, my checks filtered them, and all 126 were kept (97 train, 29 holdout). Review sheets for Thai, Korean and Vietnamese are in testsets/real/teacher_v1/review_*.csv. Nothing was trained: 126 examples are far too few.
What is needed from people
| Who | What I need |
|---|---|
| Non | Revoke the Haiku key; decide which proposals go ahead; approve a staging pilot of local-first routing; confirm what "site vocabulary" means; say whether to train an own adapter |
| Peach | Review and apply the back-end changes (proposals 3, 4, 5, 8, 10); answer the policy questions P1 to P8 with Pin; log prompt tokens per call |
| Pin | Agree the test set scenarios S1 to S10 and the scoring rules |
| Callbot owner | Approve keeping tests and the replay off slot 3; approve a first real run of local-llm.sh; allow a restart window if one is needed; narrow the monitoring access; say what uses ports 8099 and 8096 |
| Hotel data owner and native speakers | Fix the data (proposal 9); mark about 20 Thai, Korean and Vietnamese answers each |
Who is who. Non owns this work. The callbot owner decides about the callbot and about the LLM server and gateway on the Mac mini (the person is not named in our files). Peach reviews and applies back-end changes; Pin owns the guest clients and the test scenarios. The Haiku key is the Anthropic API key that was pasted into the chat during the tests; it is in the chat transcript, not in any file, and should be revoked.
Names used. Policy questions P1 to P8 are in testsets/POLICY_QUESTIONS.md; scenarios S1 to S10 are in testsets/SCENARIOS.md; local-llm.sh is the script that starts, switches and checks the LLM (/Users/non/wall-q4/local-llm.sh); ports 8099 and 8096 on the Mac mini are a reranker and an embeddings server whose use is not known to me; local-first routing means the back-end tries the local model first and uses a cloud model only on failure; site vocabulary is a term from the objective that still needs to be defined by Non.
How the proposals and patches were checked¶
- What the 13 rows are: 7 changes (rows 2, 3, 4, 5, 8, 9, 10), 4 keep-as-is recommendations (rows 1, 6, 7, 11), the 2 patches (row 12) and a pointer to the gateway file (row 13). Row 6 says keep
LLM_MAX_CONCURRENTat 1, from the 25 Nov lanes test. - Evidence for each row: the test that backs it is in the model-choice document (guide, order reader, intent, off-menu) or the speed document (lanes, warm-up) and the gateway document (gateway); the commands are there.
- The patches:
serving/backend_patch/intent_catalogue.patchrewords the front-desk intent row;assistant.patchwithassistant_title_qty_test.go.newstrips a leading count from an item title when it equals the item's quantity. Written against/Users/non/CoreAPI/domain/concierge/(read only; CoreAPI was not edited). Check:cd /Users/non/CoreAPI && git apply --check /Users/non/hotel-concierge/serving/backend_patch/*.patchpasses. Not done: compile and test, because Go is not installed on this Mac; rungo vet ./... && go test -count=1 ./domain/concierge/first. - Does not show: how the changes behave with the real back-end routing and real guests; that needs a staging run with Peach.