Skip to content

Sort json payload for determinstic key#21

Merged
jph00 merged 1 commit intomainfrom
fix/sort-json-payload
Apr 20, 2026
Merged

Sort json payload for determinstic key#21
jph00 merged 1 commit intomainfrom
fix/sort-json-payload

Conversation

@KeremTurgutlu
Copy link
Copy Markdown
Contributor

Currently the following payloads result in different keys/cache entries:

{"model":"kimi-k2.5","messages":[{"content":"Say hello in French","role":"user"}],"max_tokens":64,"temperature":1.0}

{"messages":[{"role":"user","content":"Say hello in French"}],"model":"kimi-k2.5","max_tokens":64,"temperature":1.0}

This PR sorts json payload so we get deterministic results for the same request bodies.

@KeremTurgutlu KeremTurgutlu requested review from comhar and jph00 and removed request for comhar April 19, 2026 10:10
@jph00 jph00 merged commit 43b0783 into main Apr 20, 2026
2 checks passed
@jph00 jph00 added the enhancement New feature or request label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants