Running the server

The agent server is a FastAPI application served by Uvicorn. The search2o command starts it and passes any further options to Uvicorn.

Start

$ export SEARCH2O_LICENSE_KEY=your-license-key
$ search2o                                     # 127.0.0.1:9020
$ search2o --host 0.0.0.0 --port 8080

$ SEARCH2O_LICENSE_KEY=... ANTHROPIC_API_KEY=... search2o   # key, one LLM key, start

Other command line options go to Uvicorn. The --reload family, --factory and --workers are refused: the server always runs one worker, and capacity comes from more servers rather than more workers. See Agent servers.

LLM keys

A new account comes with LLM profiles for OpenAI, Anthropic and Gemini, and three more for models served on the agent server's own machine by Ollama, vLLM and SGLang. A vendor profile reads its API key from an environment variable on the server. Set the variable for the vendor you use before starting:

$ export OPENAI_API_KEY=sk-...
$ export ANTHROPIC_API_KEY=sk-ant-...
$ export GEMINI_API_KEY=...

One key is enough. A model served by Ollama, vLLM or SGLang needs no key, so the server can start without one; see LLM vendors. For other LLMs, see Connecting to other LLMs. Secrets can come from a vault instead of environment variables; see Secret vault.

What starts up

At startup the server validates the license and downloads the account's configuration from Search2o Cloud. It checks every entry of the expression allowlist against its own Python environment and builds its connection pools. Then it serves:

  • the UI at /ui,
  • the OpenAPI schema at /openapi.json, Swagger UI at /docs and ReDoc at /redoc,
  • the REST API under /api/.

The three documentation paths, the UI path and the allowed CORS origins are settings in the Agent servers configuration. Each path can be removed, so a server can run with no UI and no interactive API documentation.

Running in production

The server holds no state. Moving from a laptop to a shared server, or from one server to a cluster, changes nothing in the agents or the configuration. Start as many servers as you need with the same license key and put them behind any load balancer. Each server brings itself up to date with the account's configuration on every agent run.

To let colleagues try Search2o, add them to the account and start one server where they can reach it. The APIs and databases your agents call must be reachable from wherever the server runs.