Eca is not aware on context length when served by llama-swap
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Describe the bug
I serve my local models through llama-swap https://github.com/mostlygeek/llama-swap but ECA doesn't detect context available in the model, so auto compaction and any hook based on relative context length does not work.
Oh-My-Pi correctly shows maximum context available, and eca-emacs connected to OpenRouter correctly shows maximum context available.
To Reproduce
- Setup a local llama-swap server
- connect to it
- see that max context is not returned.
Expected behavior
ECA should know about max context available to trigger events based on relative context usage, eg autocompaction.
Doctor
ECA version: 0.155.1
Server cmd: /home/andrea_palazzi/.emacs.d/eca/eca server
Workspaces: /home/andrea_palazzi/src/microplm
Default model: delfi/Gemma-4-26B-A4B-It-UD-Q6_K_XL (API key (****))
Logged providers: None Relevant env vars: XDG_ACTIVATION_TOKEN=kwi*****130
Credential files: None found
Screenshots
Found something to improve on eca side to be aware of this meta response, will do!
Thanks for the fix, this was a bit annoying on sessions that dragged on long context. Just a note, don't know if it's relevant or not: n_ctx is be the maximum context configured in llama.cpp to be used for the model, while n_ctx_train is the maximum context the model supports... not sure if the latter is meaningful to monitor.
For ECA I believe it's not relevant
On my system is still not working...
@apalazzi what model exactly are you using so I can try the same?
I use a variety of models, if you want a name Qwen3.8-27B. I had a LLM investigate the issue and apparently is related more to llama-swap not reporting back the available context than to eca itself.
Hum, that would explain, not sure there's much we can do, wonder how it works for pi though so
I haven't saved the chat, but IIRC pi defaults to 128k context if it can't retrieve the maximum available context, which happens to be the default context length for my local models. Another suggested solution was a llama-swap specific workaround and look under a model-specific endpoint ( /proc? ) but this might be available only after the model is loaded. If you're open to implement a llama-swap specific workaround I can run the analysis once again and report with more details, let me know.
we already maintain big providers: Openai, Anthropic, ollama and bedrock, all of them are enough for most if not all models, llama-swap is used byt openai compatible endpoint for example, I'd avoid adding specific check for llama-swap to be honest