awaescher/OllamaSharp

How do you get the context length of the currently loaded model?

Bardo-Konrad opened this issue · 2 comments

How do you get the context length of the currently loaded model?

This project only simplifies the usage of the Ollama API. You can check their API docs by yourself:

Now it is possible:

var info = (await ollamaClient.ShowModelInformation("qwen2:7b")).Info;
Console.WriteLine(info.ExtraInfo[$"{info.Architecture}.context_length"]);
Console.WriteLine(info.ExtraInfo[$"{info.Architecture}.embedding_length"]);