eca icon indicating copy to clipboard operation
eca copied to clipboard

Eca is not aware on context length when served by llama-swap

Open apalazzi opened this issue 3 months ago • 9 comments

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

Image

apalazzi avatar Aug 22 '26 09:08 apalazzi

Found something to improve on eca side to be aware of this meta response, will do!

ericdallo avatar Aug 24 '26 15:08 ericdallo

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.

apalazzi avatar Aug 24 '26 16:08 apalazzi

For ECA I believe it's not relevant

ericdallo avatar Aug 24 '26 16:08 ericdallo

On my system is still not working...

apalazzi avatar Aug 25 '26 05:08 apalazzi

@apalazzi what model exactly are you using so I can try the same?

ericdallo avatar Sep 01 '26 13:09 ericdallo

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.

apalazzi avatar Sep 01 '26 13:09 apalazzi

Hum, that would explain, not sure there's much we can do, wonder how it works for pi though so

ericdallo avatar Sep 01 '26 14:09 ericdallo

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.

apalazzi avatar Sep 02 '26 07:09 apalazzi

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

ericdallo avatar Sep 15 '26 13:09 ericdallo