The OpenScenes Agent is the local-inference companion to OpenScenes. It serves local GGUF models over HTTP, so your chats can run entirely on your own GPU or CPU. With the agent, you depend on no cloud provider at all: your models, your machine, your data, zero outside calls.
OpenScenes talks to it exactly the way it talks to any cloud provider — the agent is just one more backend you can pick per chat. It knows nothing about characters, personas, or styles; it consumes a ready-made messages payload and returns a reply.
The whole agent/ folder is relocatable — every path resolves relative to agent.py, so you can move it to another drive or machine and it boots without code edits.
The agent needs Python 3.12 (the version llama-cpp-python==0.3.4 ships wheels for). Run the setup script from inside agent/:
cd agent
python setup.py
It creates a virtualenv, installs Flask, then installs llama-cpp-python. If an Nvidia GPU is detected, it offers the CUDA build for GPU-accelerated inference; otherwise it installs the CPU build. (Detection means a GPU driver is present — the CUDA wheel bundles its own runtime libraries.)
python agent.py
Drop your .gguf files into agent/llm/ — the agent treats that folder as the source of truth. Each file is registered automatically (under its filename), and removing a file removes its model. Then, in OpenScenes, set the agent's address in Settings → Connections and register a model whose Model matches one the agent lists.
setup.py creates config.ini from the committed config.ini.example template, so it's ready after install. The live file holds your API_KEY and is gitignored — never commit it. Edit it as needed (flat key=value):
HOST=127.0.0.1
PORT=8090
API_KEY=
HOST— bind address. Keep127.0.0.1for single-machine use. Only set0.0.0.0to allow other hosts on your LAN after you set anAPI_KEY— otherwise you expose an unauthenticated inference server.PORT— TCP port.API_KEY— Bearer token required on every request when set. Empty means no authentication — safe only on127.0.0.1.
Keep
config.inifree of real secrets in anything you commit or share.
All requests require Authorization: Bearer <API_KEY> when an API key is configured.
POST /v1/complete — run a completion against a registered model.
{ "name": "model-name", "messages": [ ... ], "max_tokens": 1024, "temperature": 0.8, "top_p": 0.95 }
→ 200 { "content": "..." }
GET /v1/llms — list registered models (synced to the llm/ folder on each call).
POST /v1/llms — register a model ({name, filename}) against a GGUF already in llm/.
DELETE /v1/llms/<id> — deregister a model and delete its GGUF.
Errors come back as {"error": "..."} with an appropriate status code (400 malformed/unknown model, 401 bad key, 500 generation failure).