Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llama.cpp model not staying in memory with llm chat #15

Open
m0nac0 opened this issue Sep 14, 2023 · 0 comments
Open

llama.cpp model not staying in memory with llm chat #15

m0nac0 opened this issue Sep 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@m0nac0
Copy link

m0nac0 commented Sep 14, 2023

When I use llm chat with a llama.cpp model, it generally works good, but is pretty slow because the model seems to be loaded into memory for every response and is unloaded after the response (judging from the memory usage seen in Windows Task Manager).

Is there an option to keep the model in memory with llm chat and llm-llama-cpp?

If someone else experiences this, my current workaround is starting llama-cpp-python in the openai-compatible server mode with python -m llama_cpp.server --model path/to/model, and adding that model in the extra-openai-models.yaml file as described in https://llm.datasette.io/en/stable/other-models.html#openai-compatible-models. When using the model with llm prompt or llm chat I pass -o "max_tokens" 200, because the default number of max_tokens seems to be set at the very low amount of 16 tokens.
This is more performant, as the model stays in memory, but probably not ideal since I think the llama2-specific prompt template logic is not used anymore.

@simonw simonw added the bug Something isn't working label Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants