Document and harden project handoff
This commit is contained in:
+28
-13
@@ -31,7 +31,7 @@ CACHE_ROOT = WEB_ROOT / "cache"
|
||||
ARXIV_CACHE = CACHE_ROOT / "arxiv"
|
||||
AI_CACHE = CACHE_ROOT / "ai"
|
||||
OLLAMA_URL = os.environ.get("OLLAMA_URL", "http://192.168.1.10:11434").rstrip("/")
|
||||
ASSET_VERSION = "atlas-20260709-01"
|
||||
ASSET_VERSION = "atlas-20260712-01"
|
||||
|
||||
|
||||
def detect_app_version() -> str:
|
||||
@@ -51,18 +51,22 @@ def detect_app_version() -> str:
|
||||
|
||||
APP_VERSION = detect_app_version()
|
||||
|
||||
MODEL_LIGHT = os.environ.get("OLLAMA_MODEL_LIGHT", "ChatGPT-5.6:Luna")
|
||||
MODEL_FAST = os.environ.get("OLLAMA_MODEL_FAST", "ChatGPT-5.6:Terra")
|
||||
MODEL_LARGE = os.environ.get("OLLAMA_MODEL_LARGE", "ChatGPT-5.6:Sol")
|
||||
|
||||
DEFAULT_MODELS = {
|
||||
"translate": "ChatGPT-5.6:light",
|
||||
"summary": "ChatGPT-5.6:fast",
|
||||
"deep": "ChatGPT-5.6:large",
|
||||
"atlas": "ChatGPT-5.6:fast",
|
||||
"topic": "ChatGPT-5.6:large",
|
||||
"path": "ChatGPT-5.6:large",
|
||||
"compare": "ChatGPT-5.6:large",
|
||||
"search_plan": "ChatGPT-5.6:light",
|
||||
"search_summary": "ChatGPT-5.6:fast",
|
||||
"search_followup": "ChatGPT-5.6:fast",
|
||||
"paper_chat": "ChatGPT-5.6:fast",
|
||||
"translate": MODEL_LIGHT,
|
||||
"summary": MODEL_FAST,
|
||||
"deep": MODEL_LARGE,
|
||||
"atlas": MODEL_FAST,
|
||||
"topic": MODEL_LARGE,
|
||||
"path": MODEL_LARGE,
|
||||
"compare": MODEL_LARGE,
|
||||
"search_plan": MODEL_LIGHT,
|
||||
"search_summary": MODEL_FAST,
|
||||
"search_followup": MODEL_FAST,
|
||||
"paper_chat": MODEL_FAST,
|
||||
}
|
||||
|
||||
NS = {
|
||||
@@ -1376,12 +1380,20 @@ class PaperBrowserHandler(SimpleHTTPRequestHandler):
|
||||
def handle_health(self) -> None:
|
||||
papers, _ = load_papers()
|
||||
ollama_ok = False
|
||||
available_models: list[str] = []
|
||||
try:
|
||||
request = urllib.request.Request(f"{OLLAMA_URL}/api/tags")
|
||||
with urllib.request.urlopen(request, timeout=3) as response:
|
||||
ollama_ok = response.status == 200
|
||||
except (urllib.error.URLError, TimeoutError):
|
||||
payload = json.loads(response.read().decode("utf-8"))
|
||||
available_models = sorted(
|
||||
str(item.get("name"))
|
||||
for item in payload.get("models", [])
|
||||
if item.get("name")
|
||||
)
|
||||
except (urllib.error.URLError, TimeoutError, json.JSONDecodeError):
|
||||
ollama_ok = False
|
||||
missing_default_models = sorted(set(DEFAULT_MODELS.values()) - set(available_models))
|
||||
write_json(
|
||||
self,
|
||||
{
|
||||
@@ -1391,6 +1403,9 @@ class PaperBrowserHandler(SimpleHTTPRequestHandler):
|
||||
"asset_version": ASSET_VERSION,
|
||||
"ollama_url": OLLAMA_URL,
|
||||
"ollama_ok": ollama_ok,
|
||||
"ollama_ready": ollama_ok and not missing_default_models,
|
||||
"available_models": available_models,
|
||||
"missing_default_models": missing_default_models,
|
||||
"default_models": DEFAULT_MODELS,
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user