Run Several Personas on One Server¶
Alpha channel only
The prerelease channel carries this content. A stable or testing install
does not have it, and a plain pip install does not get it: the install
needs --pre. Read Release Channels before you
mix channels.
This page serves several personas from one ovos-persona-server process, with a separate memory for each user. You want to reach your personas over HTTP, from apps that speak the OpenAI or Ollama API.
What the setup includes¶
- The
modelfield of each request selects the persona. - With
CHAT_MEMORY=transparent, theuserfield selects the memory of one person. - Each persona keeps its own memory, so a user has a separate history with each persona.
Steps¶
Community servers are best-effort demos
The public OVOS servers exist for easy onboarding and demos only. They are best-effort, not optimized, carry no uptime guarantees, and may vanish at any time. OVOS will be slow and unreliable if you rely on them. The official recommendation is to self-host — or skip servers entirely: fully offline plugins exist for everything.
-
Install the packages:
-
Save two personas,
~/personas/ada.jsonand~/personas/bo.json. This isada.json:{ "name": "ada", "handlers": ["ovos-chat-openai-plugin"], "ovos-chat-openai-plugin": { "api_url": "https://llama.smartgic.io/v1", "key": "sk-none", "model": "qwen2.5:7b", "system_prompt": "Your name is Ada. You answer in at most fifteen words. When asked your name, say Ada." } }For
bo.json, change the name toboand change the system prompt to the name Bo. -
Start the server. It loads every
*.jsonfile in the directory: -
List the personas:
-
Send requests to both personas for one user:
ask() { curl -s localhost:8337/openai/v1/chat/completions \ -H 'content-type: application/json' \ -d "{\"model\":\"$1\",\"user\":\"$2\",\"messages\":[{\"role\":\"user\",\"content\":\"$3\"}]}" | python3 -c 'import sys,json; print(json.load(sys.stdin)["choices"][0]["message"]["content"])' } ask ada alice "What is your name? Answer with your name only." ask bo alice "What is your name? Answer with your name only." ask ada alice "Remember this: my cat is called Pixel. Reply only with OK." ask ada alice "What is my cat called? Answer with the name only." ask bo alice "What is my cat called? If you do not know, say UNKNOWN."
Output of a run:
bo does not see what Alice told ada. An unknown model value gets HTTP 404 with the list of available personas.
The server trusts the user value and does not check it, so this setup fits trusted clients only. On a server that untrusted clients share, keep CHAT_MEMORY off. See Memory, RAG & embeddings.
Troubleshooting¶
| Problem | Cause | Fix |
|---|---|---|
| The server does not start | Two persona files have the same name | Give each persona a unique name |
| All users share one history | The client sends no user field |
Send a different user value for each person |
| The server forgets between requests | CHAT_MEMORY is not transparent |
Start the server with CHAT_MEMORY=transparent |