summaryrefslogtreecommitdiff
path: root/src/ollama_web/main.py
blob: 68ad8b8d31a23acaeb7c936e6385fb6dbada7fb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Main entry point for the ollama-web application."""

from __future__ import annotations

import sys

import uvicorn

from .config import settings


def main() -> int:
    """Run the application."""
    print(f"ollama-web starting on http://{settings.host}:{settings.port}")
    print(f"Ollama host: {settings.ollama_host}")
    if settings.pin_generated:
        print(f"Generated ollama-web PIN: {settings.pin}")
        print("Set OLLAMA_WEB_PIN to use a stable PIN.")
    uvicorn.run(
        "ollama_web.app:app",
        host=settings.host,
        port=settings.port,
        reload=False,
    )
    return 0


if __name__ == "__main__":
    sys.exit(main())