Skip to content

Commit adc0e56

Browse files
robmsmtclaude
andcommitted
Extract SWISS_DOMAINS to backend/swiss_domains.json; FAQ links it
Canonical institution whitelist now lives in backend/swiss_domains.json, loaded by auth_service. The FAQ "Is my institution enabled?" entry links to that file on GitHub so the list stays single-sourced in the backend. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 80bb0b0 commit adc0e56

3 files changed

Lines changed: 24 additions & 12 deletions

File tree

backend/services/auth_service.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import json
12
import secrets
3+
from pathlib import Path
4+
25
import requests
36
from sqlmodel import Session, select
47
from backend.config import get_settings
@@ -13,18 +16,11 @@
1316
DEV_EMAIL = "dev@localhost"
1417

1518

16-
SWISS_DOMAINS = [
17-
"ethz.ch",
18-
"cscs.ch",
19-
"unibas.ch",
20-
"unibe.ch",
21-
"uzh.ch",
22-
"epfl.ch",
23-
"unil.ch",
24-
"unige.ch",
25-
"hevs.ch",
26-
"fhnw.ch",
27-
]
19+
# Institutions whose members are auto-enabled (active budget on first sign-in).
20+
# Canonical list — referenced from the public FAQ via its GitHub URL.
21+
_SWISS_DOMAINS_FILE = Path(__file__).resolve().parent.parent / "swiss_domains.json"
22+
with open(_SWISS_DOMAINS_FILE) as f:
23+
SWISS_DOMAINS = json.load(f)
2824

2925

3026
def get_or_create_apikey(engine, owner_email: str) -> APIKey:

backend/swiss_domains.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
"ethz.ch",
3+
"cscs.ch",
4+
"unibas.ch",
5+
"unibe.ch",
6+
"uzh.ch",
7+
"epfl.ch",
8+
"unil.ch",
9+
"unige.ch",
10+
"hevs.ch",
11+
"fhnw.ch"
12+
]

frontend/src/pages/faq.astro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ const faqs = [
1717
q: "Can I launch any model?",
1818
a: 'Yes, see <a class="text-indigo-600 dark:text-indigo-400 underline" href="https://github.com/swiss-ai/model-launch" target="_blank" rel="noopener noreferrer">model launch</a>. This usually requires a CSCS GPU grant. Compute grants come in two tiers: small (&lt;32k GPU hrs) and large (&gt;500k GPU hrs). See the <a class="text-indigo-600 dark:text-indigo-400 underline" href="https://www.swiss-ai.org/compute-grants" target="_blank" rel="noopener noreferrer">compute grants process</a>.',
1919
},
20+
{
21+
q: "Is my institution enabled?",
22+
a: 'Members of supported Swiss institutions are auto-enabled, getting an active budget on first sign-in. See the current list of <a class="text-indigo-600 dark:text-indigo-400 underline" href="https://github.com/swiss-ai/serving-api/blob/main/backend/swiss_domains.json" target="_blank" rel="noopener noreferrer">enabled institutions</a>. If yours is not listed, please <a class="text-indigo-600 dark:text-indigo-400 underline" href="https://apertvs.ai/contact/" target="_blank" rel="noopener noreferrer">contact us</a>.',
23+
},
2024
{
2125
q: "I'm at a non-Swiss university, can I get access?",
2226
a: "Yes, but service is prioritised in this order: <br /><br />(1) ETH and EPFL Apertus-related projects, <br />(2) Swiss AI-related institutions, <br />(3) other global academic institutions.",

0 commit comments

Comments
 (0)