Skip to content

Commit 918d1a4

Browse files
authored
Merge pull request #1 from VirtualFlyBrain/feature/elm-llama-chat-completions-migration
Feature/elm llama chat completions migration
2 parents 95f4574 + fcd3444 commit 918d1a4

10 files changed

Lines changed: 3909 additions & 287 deletions

File tree

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ VFB Chat is a Next.js chat interface for exploring Virtual Fly Brain (VFB) data
55
## What Changed
66

77
- Native `web_search` has been removed from the model toolset.
8-
- Search is limited to approved `virtualflybrain.org` and `neurofly.org` pages plus reviewed `flybase.org` pages through server-side, domain-restricted tools.
8+
- Search is limited to approved `virtualflybrain.org`, `neurofly.org`, and `vfb-connect.readthedocs.io` pages plus reviewed `flybase.org` pages through server-side, domain-restricted tools.
99
- Outbound links are sanitized server-side to approved domains only.
1010
- Raw IP-based security logs are retained for up to 30 days under `/logs/security`.
1111
- Aggregated analytics and structured feedback are retained under `/logs/analytics` and `/logs/feedback`.
@@ -36,7 +36,7 @@ The app now uses a 3-layer logging model rooted at `LOG_ROOT_DIR`:
3636
The reviewed documentation search path uses two server-side sources:
3737

3838
- a seed index from `config/reviewed-docs-index.json`
39-
- a domain-restricted discovery path for approved `virtualflybrain.org` and `neurofly.org` pages using configured sitemap and robots sources
39+
- a domain-restricted discovery path for approved `virtualflybrain.org`, `neurofly.org`, and `vfb-connect.readthedocs.io` pages using configured sitemap and robots sources
4040

4141
This keeps search scoped to approved domains while avoiding a hand-maintained list of every VFB news or documentation page.
4242

@@ -52,13 +52,16 @@ Environment variable:
5252

5353
Required for production:
5454

55-
- `OPENAI_API_KEY`
56-
- `OPENAI_BASE_URL` or `APPROVED_ELM_BASE_URL`
57-
- `OPENAI_MODEL` or `APPROVED_ELM_MODEL`
55+
- `ELM_API_KEY` (or `OPENAI_API_KEY` as backward-compatible fallback)
56+
- `ELM_BASE_URL` (or `OPENAI_BASE_URL`) or `APPROVED_ELM_BASE_URL`
57+
- `ELM_MODEL` (or `OPENAI_MODEL`) or `APPROVED_ELM_MODEL`
5858
- `LOG_ROOT_DIR=/logs`
5959

6060
Optional:
6161

62+
- `OPENAI_API_KEY`
63+
- `OPENAI_BASE_URL`
64+
- `OPENAI_MODEL`
6265
- `APPROVED_ELM_BASE_URL`
6366
- `APPROVED_ELM_MODEL`
6467
- `RATE_LIMIT_PER_IP`
@@ -68,21 +71,21 @@ Optional:
6871
- `GA_MEASUREMENT_ID`
6972
- `GA_API_SECRET`
7073

71-
When `APPROVED_ELM_BASE_URL` and/or `APPROVED_ELM_MODEL` are provided, production enforces that they exactly match the active `OPENAI_*` values. If they are omitted, the app uses the active gateway/model as the approved baseline so existing single-config deployments continue to work.
74+
When `APPROVED_ELM_BASE_URL` and/or `APPROVED_ELM_MODEL` are provided, production enforces that they exactly match the active configured gateway/model (resolved from `ELM_*` first, then `OPENAI_*`). If they are omitted, the app uses the active gateway/model as the approved baseline so existing single-config deployments continue to work.
7275

7376
Default allow-lists:
7477

75-
- Search allow-list: `virtualflybrain.org`, `*.virtualflybrain.org`, `flybase.org`, `neurofly.org`, `*.neurofly.org`
76-
- Outbound allow-list: `virtualflybrain.org`, `*.virtualflybrain.org`, `flybase.org`, `neurofly.org`, `*.neurofly.org`, `doi.org`, `pubmed.ncbi.nlm.nih.gov`, `biorxiv.org`, `medrxiv.org`
78+
- Search allow-list: `virtualflybrain.org`, `*.virtualflybrain.org`, `flybase.org`, `neurofly.org`, `*.neurofly.org`, `vfb-connect.readthedocs.io`
79+
- Outbound allow-list: `virtualflybrain.org`, `*.virtualflybrain.org`, `flybase.org`, `neurofly.org`, `*.neurofly.org`, `vfb-connect.readthedocs.io`, `doi.org`, `pubmed.ncbi.nlm.nih.gov`, `biorxiv.org`, `medrxiv.org`
7780

7881
## Local Development
7982

8083
Create `.env.local` with explicit values:
8184

8285
```bash
83-
OPENAI_API_KEY=your-key-here
84-
OPENAI_BASE_URL=https://your-elm-gateway.example/v1
85-
OPENAI_MODEL=your-approved-model
86+
ELM_API_KEY=elm-xxxxxxxx-xxxxxxxxxxxxxxxx
87+
ELM_BASE_URL=https://elm.edina.ac.uk/api/v1
88+
ELM_MODEL=meta-llama/Llama-3.3-70B-Instruct
8689
LOG_ROOT_DIR=./logs
8790
```
8891

app/accessibility/page.js

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
export const metadata = {
2+
title: 'VFB Chat Accessibility Statement',
3+
description: 'Accessibility statement for VFB Chat'
4+
}
5+
6+
export default function AccessibilityPage() {
7+
return (
8+
<main style={{
9+
minHeight: '100vh',
10+
backgroundColor: '#000',
11+
color: '#e0e0e0',
12+
padding: '32px 20px 48px',
13+
boxSizing: 'border-box'
14+
}}>
15+
<div style={{ maxWidth: '860px', margin: '0 auto' }}>
16+
<h1 style={{ color: '#fff', marginTop: 0 }}>Accessibility Statement</h1>
17+
<p style={{ color: '#b8b8b8', lineHeight: 1.6 }}>
18+
This accessibility statement applies to VFB Chat (<a href="https://chat.virtualflybrain.org" style={{ color: '#66d9ff' }}>chat.virtualflybrain.org</a>).
19+
This service is run by the Virtual Fly Brain project at the University of Edinburgh.
20+
</p>
21+
22+
<section style={{ marginTop: '28px' }}>
23+
<h2 style={{ color: '#fff' }}>Compliance Status</h2>
24+
<p style={{ color: '#b8b8b8', lineHeight: 1.6 }}>
25+
We aim to make this website accessible in accordance with the Public Sector Bodies
26+
(Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 and
27+
the Web Content Accessibility Guidelines (WCAG) 2.2 at Level AA.
28+
</p>
29+
<p style={{ color: '#b8b8b8', lineHeight: 1.6 }}>
30+
This website is partially compliant with the WCAG 2.2 Level AA standard.
31+
</p>
32+
</section>
33+
34+
<section style={{ marginTop: '28px' }}>
35+
<h2 style={{ color: '#fff' }}>What We Do to Ensure Accessibility</h2>
36+
<ul style={{ lineHeight: 1.7 }}>
37+
<li>Full keyboard navigation throughout the chat interface</li>
38+
<li>Skip-to-content link for keyboard and screen reader users</li>
39+
<li>Proper ARIA landmarks and live regions for dynamic content</li>
40+
<li>Sufficient colour contrast ratios (minimum 4.5:1 for text)</li>
41+
<li>Visible focus indicators for interactive elements</li>
42+
<li>Semantic HTML structure with appropriate heading hierarchy</li>
43+
<li>Alternative text for images</li>
44+
<li>Accessible form inputs with associated labels</li>
45+
<li>No time-limited content</li>
46+
<li>No flashing content</li>
47+
</ul>
48+
</section>
49+
50+
<section style={{ marginTop: '28px' }}>
51+
<h2 style={{ color: '#fff' }}>Known Limitations</h2>
52+
<ul style={{ lineHeight: 1.7 }}>
53+
<li>Network graph visualisations (SVG) convey information visually that may not be fully available to screen reader users, though graph titles and labels are provided as text.</li>
54+
<li>AI-generated content may occasionally produce complex formatting that is not optimally structured for assistive technology.</li>
55+
</ul>
56+
</section>
57+
58+
<section style={{ marginTop: '28px' }}>
59+
<h2 style={{ color: '#fff' }}>Feedback and Contact</h2>
60+
<p style={{ color: '#b8b8b8', lineHeight: 1.6 }}>
61+
If you encounter any accessibility barriers when using this website, please contact us:
62+
</p>
63+
<ul style={{ lineHeight: 1.7 }}>
64+
<li>Email: <a href="mailto:data@virtualflybrain.org" style={{ color: '#66d9ff' }}>data@virtualflybrain.org</a></li>
65+
</ul>
66+
<p style={{ color: '#b8b8b8', lineHeight: 1.6 }}>
67+
We aim to respond to accessibility feedback within 5 working days.
68+
</p>
69+
</section>
70+
71+
<section style={{ marginTop: '28px' }}>
72+
<h2 style={{ color: '#fff' }}>Enforcement Procedure</h2>
73+
<p style={{ color: '#b8b8b8', lineHeight: 1.6 }}>
74+
The Equality and Human Rights Commission (EHRC) is responsible for enforcing the
75+
Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility
76+
Regulations 2018. If you are not happy with how we respond to your complaint, contact
77+
the{' '}
78+
<a
79+
href="https://www.equalityadvisoryservice.com/"
80+
target="_blank"
81+
rel="noopener noreferrer"
82+
style={{ color: '#66d9ff', textDecoration: 'underline' }}
83+
>
84+
Equality Advisory and Support Service (EASS)
85+
</a>.
86+
</p>
87+
</section>
88+
89+
<section style={{ marginTop: '28px' }}>
90+
<h2 style={{ color: '#fff' }}>Preparation of This Statement</h2>
91+
<p style={{ color: '#b8b8b8', lineHeight: 1.6 }}>
92+
This statement was prepared on 26 March 2026. It was last reviewed on 26 March 2026.
93+
</p>
94+
</section>
95+
96+
<p style={{ marginTop: '28px' }}>
97+
<a href="/" style={{ color: '#66d9ff', textDecoration: 'underline' }}>Back to VFB Chat</a>
98+
</p>
99+
</div>
100+
</main>
101+
)
102+
}

0 commit comments

Comments
 (0)