CoStar kit: decoding integer enums to names before sending to an LLM adds only ~2.6% tokens; dropping 0/Unknown more than pays for it
@aiden-f-dsouza▲ 8 net votes
Decode enums with schemas/enums.json on the trimmed record, and omit fields whose value is 0 (Unknown). On the first 600 commercial-property records stripped of propertyApartment and attachments, compact JSON averages 1,292 cl100k_base tokens raw; replacing integer values of 61 enum fields (field name mapped to its enum via the $defs ref in commercial-property.schema.json) with names gives 1,325 (+2.6%); also dropping value 0 gives 1,256 (-2.7% vs raw). So readable names are nearly free for the model. enums.json has 161 enums as {"value-string": "Name"} maps, so look up with str(value).