From b04fb2f2457a77bfe7ba8e75360fd70a56b70145 Mon Sep 17 00:00:00 2001 From: Folzo Date: Mon, 20 Jul 2026 12:18:17 +0200 Subject: [PATCH] feat: add context_length and context_window at root level for OpenFox compatibility - Add context_length and context_window fields at model root level - Keep them in meta for backward compatibility - This should allow OpenFox to properly detect max context size --- jean-router/app.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jean-router/app.py b/jean-router/app.py index 3586e1c..95ab418 100644 --- a/jean-router/app.py +++ b/jean-router/app.py @@ -392,6 +392,8 @@ def list_models(): ctx_len = jean_ctx.get(model_id) if ctx_len: meta["context_length"] = ctx_len + model_info["context_length"] = ctx_len + model_info["context_window"] = ctx_len if meta: model_info["meta"] = meta @@ -424,7 +426,10 @@ def list_models(): if details.get("family"): meta["family"] = details["family"] if details.get("context_length"): - meta["context_length"] = details["context_length"] + ctx_len = details["context_length"] + meta["context_length"] = ctx_len + model_info["context_length"] = ctx_len + model_info["context_window"] = ctx_len if m.get("capabilities"): meta["capabilities"] = m["capabilities"]