Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ every change; they are enforced by this list.
7. `serving/config.pbtxt` and `serving/model.py` in this tree *are* the deployed files — the trainer
overwrites them in S3 on every run. A bad import in `serving/model.py` breaks every model in the
bucket, including ones that were not retrained.
`config.pbtxt` declares an optional `context` input that `model.py` does not read: the feed API
sends it on every SERP with a country/region/type filter, and Triton rejects a request naming an
undeclared input, so removing the declaration fails every filtered feed request (it did, between
2026-08-14 and this note). Drop it only after the API stops sending it.
8. `Strategy` declares what a model MAY emit; `api/docs/DEBUG_INFO_CODEC.md` owns the published
vocabulary and its numeric ids, which are append-only and never renumbered. The two are NOT the
same set: the codec has rows with no member here (`popular`/8, `random`/9, and since 2026-08-25
Expand Down
6 changes: 4 additions & 2 deletions smartrec-client/smartrec_client/triton_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ def recommendations_triton_with_client(
:param filter_viewed: Whether to filter viewed items.
:param items_to_recommend: Optional list of items to restrict recommendations to.
:param history: Optional list of item IDs from user's interaction history (for warm/new users).
:param context: Optional request context (e.g. {"country": ...}); only consumed by
models whose Triton config declares a "context" input (the orchestrator).
:param context: Optional request context (e.g. {"country": ...}). Sent as a
"context" input when non-empty. No served model reads it today; the input
stays declared in serving/config.pbtxt because Triton rejects a request
naming an input the model config does not declare.

:return: Dictionary with model version, data, and strategy.
"""
Expand Down
10 changes: 10 additions & 0 deletions smartrec-lib/smartrec_lib/serving/config.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ input [
dims: [ -1 ]
optional: true
},
{
# Declared but not read by model.py. The feed API sends it whenever a SERP
# carries a country/region/type filter, and Triton rejects a request that
# names an input the config does not declare - so dropping this line fails
# every filtered feed request. Keep it until the API stops sending it.
name: "context"
data_type: TYPE_STRING
dims: [ 1 ]
optional: true
},
{
name: "top_n"
data_type: TYPE_INT32
Expand Down
Loading