diff --git a/main.py b/main.py index 2713399..1e371fc 100644 --- a/main.py +++ b/main.py @@ -242,14 +242,17 @@ async def ollama_show(request: Request): for p in profiles: if p.get("id") == model_name: + # Extract actual context size from the profile's flags + flags = p.get("flags", {}) + ctx_size = str(flags.get("ctx-size", flags.get("n_ctx", "4096"))) return { "modelfile": "", - "parameters": "num_ctx 4096", + "parameters": f"num_ctx {ctx_size}", "template": "", "details": { "format": "gguf", "family": p.get("name", "llm"), - "parameter_size": p.get("flags", {}).get("--num-ctx", "4096"), + "parameter_size": ctx_size, }, "model_info": {"id": p.get("id", "")}, }