Repository navigation
Replies: 5 comments
|
Short answers, from the server README ( Does it save memory or data? Not by default.
RAG isn't built in. You run your own retrieval: a vector store in your app, with embeddings from a separate Multiple users It handles concurrent requests with slots (
Configured like that, it's a reasonable shared inference backend. Keep users' data and the RAG documents in your application layer, and treat llama-server as a component that only sees one prompt at a time. |
|
Thank you for your reply. I will try to understand. |
|
Short answer: What it does not have
What it does haveFrom
The KV cache and cross-user leakageThis is the part worth being precise about. The server keeps a KV cache so repeated prompts do not recompute. With default settings and multiple concurrent users, the cache holds recently processed prompt prefixes. It does not return another user's output — there is no mechanism where user B receives user A's continuation. What it can do is retain prompt text in memory for the cache's lifetime. If you are worried about residual data in RAM, the mitigations are:
For a shared deployment the honest framing is: the KV cache is a performance feature, not an isolation mechanism, and you should not rely on it for tenant separation. The architecture that actually works for multi-userPut the server behind something that owns identity: Concretely:
One more boundary
|
|
Short answer: the server itself is not multi-user, so whether it is safe depends on what you put in front of it. A few things worth adding to the answers above. There are no user accounts, but you can give each user their own key. --api-key takes a comma-separated list, and --api-key-file takes one key per line. A key is still just a shared secret though. The server has no user accounts, so it cannot tell users apart or give each one a quota. Real per-user auth and rate limits need a reverse proxy in front. On saving data: nothing is stored by default. Conversations are stateless, the client sends the full history each time, and slot KV is only written to disk if you set --slot-save-path, which is disabled by default. What does stay in memory is the prompt cache. --cache-prompt is on by default, and the README says it reuses KV from a previous request when the prompt shares a prefix. Slots are shared across callers, so one user's cached prefix can be reused for another user's request. It does not expose the cached text through the API, but the cache is shared state between users. If that bothers you, run with --no-cache-prompt or give each user their own server instance. On RAG: llama-server has no RAG feature. It has embedding endpoints, /v1/embeddings and /embedding, but no document store and no retrieval. Chunking, the vector store, and keeping one user's documents away from another's are all your application's job. The server just runs the model. So the practical setup is llama-server behind a proxy that does per-user auth and rate limiting, one --api-key per user or per app, TLS with --ssl-key-file and --ssl-cert-file, and --no-cache-prompt if you care about the shared cache. If you need strict isolation between users, separate server processes per user is the simple answer. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Is llama-server secure to use from multiple users and rag from multiple users as service? Do it save the memory and data?
All reactions