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
This commit is contained in:
+6
-1
@@ -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"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user