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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
<!DOCTYPE html>
<html lang="{{ t('html.lang') }}">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ollama-web</title>
<link rel="stylesheet" href="{{ url_for('static', path='style.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', path='settings.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', path='vendor/github-dark.min.css') }}" />
<link rel="stylesheet" href="{{ url_for('static', path='vendor/katex.min.css') }}" />
<script src="{{ url_for('static', path='vendor/marked.min.js') }}"></script>
<script src="{{ url_for('static', path='vendor/purify.min.js') }}"></script>
<script src="{{ url_for('static', path='vendor/highlight.min.js') }}"></script>
<script src="{{ url_for('static', path='vendor/katex.min.js') }}"></script>
<meta name="ollama-web-i18n" content="{{ messages | tojson | forceescape }}" />
<script src="{{ url_for('static', path='i18n.js') }}"></script>
</head>
<body>
<aside id="sidebar">
<div class="sidebar-header">
<h2>{{ t('chat.sessions') }}</h2>
<button id="new-session-btn" type="button" title="{{ t('chat.new_session') }}">+</button>
</div>
<ul id="session-list"></ul>
<div class="sidebar-footer">
<button id="general-settings-btn" type="button">{{ t('chat.general_settings') }}</button>
<button id="mcp-settings-btn" type="button">{{ t('chat.mcp_settings') }}</button>
</div>
</aside>
<div id="sidebar-backdrop"></div>
<div id="main">
<header>
<button id="menu-btn" type="button" aria-label="{{ t('chat.session_list') }}">☰</button>
<h1>ollama-web</h1>
<div class="controls">
<label for="model-select">{{ t('chat.model_label') }}</label>
<select id="model-select">
{% if models %}
{% for m in models %}
<option value="{{ m }}" {% if m == default_model %}selected{% endif %}>{{ m }}</option>
{% endfor %}
{% else %}
<option value="{{ default_model }}" selected>{{ default_model }}</option>
{% endif %}
</select>
<label class="think-toggle">
<input type="checkbox" id="think-toggle" /> thinking
</label>
<button id="clear-btn" type="button">{{ t('common.clear') }}</button>
</div>
</header>
<main id="chat"></main>
<div id="attachments"></div>
<form id="input-form">
<div class="input-row">
<label class="attach-btn" title="{{ t('chat.attach_file') }}">
<input type="file" id="file-input" multiple accept="*/*" />
📎
</label>
<textarea id="input" placeholder="{{ t('chat.input_placeholder') }}"
rows="2" autofocus></textarea>
<button type="submit" id="send-btn">{{ t('common.send') }}</button>
<button type="button" id="cancel-btn" disabled>{{ t('common.stop') }}</button>
</div>
</form>
</div>
<div id="settings-modal" class="modal" aria-hidden="true">
<div class="modal-content settings-modal-content" role="dialog" aria-modal="true"
aria-labelledby="settings-modal-title">
<div class="modal-header">
<div class="settings-heading">
<button id="settings-back-btn" type="button" class="settings-back-btn"
aria-label="{{ t('settings.back') }}">←</button>
<h2 id="settings-modal-title">{{ t('settings.general.title') }}</h2>
</div>
<button id="settings-modal-close" type="button" class="close-btn"
aria-label="{{ t('common.close') }}">×</button>
</div>
<div class="modal-body">
<section class="settings-screen" data-settings-screen="general">
<p class="modal-help">{{ t('settings.general.description') }}</p>
<div class="settings-menu">
<button id="open-ui-settings" type="button" class="settings-menu-card">
<strong>{{ t('settings.ui.title') }}</strong>
<span>{{ t('settings.ui.description') }}</span>
</button>
<button id="open-ollama-settings" type="button" class="settings-menu-card">
<strong>{{ t('settings.ollama.title') }}</strong>
<span>{{ t('settings.ollama.description') }}</span>
</button>
</div>
</section>
<section class="settings-screen" data-settings-screen="ui" hidden>
<label class="settings-field" for="settings-language">
<span>{{ t('settings.ui.language') }}</span>
<select id="settings-language">
<option value="ja">日本語</option>
<option value="en">English</option>
</select>
</label>
<p class="field-help">{{ t('settings.ui.reload_notice') }}</p>
</section>
<section class="settings-screen" data-settings-screen="ollama" hidden>
<label class="settings-field" for="settings-system-prompt">
<span>{{ t('settings.ollama.system_prompt') }}</span>
<textarea id="settings-system-prompt" rows="7"
placeholder="{{ t('settings.ollama.system_prompt_placeholder') }}"></textarea>
</label>
<label class="settings-field" for="settings-temperature">
<span>{{ t('settings.ollama.temperature') }}: <output id="temperature-value">0.8</output></span>
<input id="settings-temperature" type="range" min="0" max="2" step="0.1" value="0.8" />
</label>
<label class="settings-field" for="settings-num-ctx">
<span>{{ t('settings.ollama.num_ctx') }}: <output id="num-ctx-value">8k</output></span>
<input id="settings-num-ctx" type="range" min="0" max="6" step="1" value="1" />
<div class="range-labels" aria-hidden="true">
<span>4k</span><span>8k</span><span>16k</span><span>32k</span>
<span>64k</span><span>128k</span><span>256k</span>
</div>
</label>
<div class="settings-field">
<span>{{ t('settings.ollama.seed') }}</span>
<div class="seed-controls">
<select id="settings-seed-mode" aria-label="{{ t('settings.ollama.seed_mode') }}">
<option value="random">{{ t('settings.ollama.seed_random') }}</option>
<option value="fixed">{{ t('settings.ollama.seed_fixed') }}</option>
</select>
<input id="settings-seed" type="number" step="1"
aria-label="{{ t('settings.ollama.seed_value') }}" hidden />
</div>
</div>
<details class="advanced-settings">
<summary>{{ t('settings.ollama.advanced') }}</summary>
<p class="field-help">{{ t('settings.ollama.blank_omitted') }}</p>
<div class="option-grid">
<label class="settings-field"><span>num_keep</span><input data-option="num_keep" data-type="int" type="number" step="1" placeholder="24" /></label>
<label class="settings-field"><span>num_predict</span><input data-option="num_predict" data-type="int" type="number" step="1" placeholder="512" /></label>
<label class="settings-field"><span>top_k</span><input data-option="top_k" data-type="int" type="number" step="1" placeholder="40" /></label>
<label class="settings-field"><span>top_p</span><input data-option="top_p" data-type="float" type="number" step="any" placeholder="0.9" /></label>
<label class="settings-field"><span>min_p</span><input data-option="min_p" data-type="float" type="number" step="any" placeholder="0.05" /></label>
<label class="settings-field"><span>typical_p</span><input data-option="typical_p" data-type="float" type="number" step="any" placeholder="0.7" /></label>
<label class="settings-field"><span>tfs_z</span><input data-option="tfs_z" data-type="float" type="number" step="any" placeholder="1.0" /></label>
<label class="settings-field"><span>repeat_last_n</span><input data-option="repeat_last_n" data-type="int" type="number" step="1" placeholder="64" /></label>
<label class="settings-field"><span>repeat_penalty</span><input data-option="repeat_penalty" data-type="float" type="number" step="any" placeholder="1.1" /></label>
<label class="settings-field"><span>presence_penalty</span><input data-option="presence_penalty" data-type="float" type="number" step="any" placeholder="0.0" /></label>
<label class="settings-field"><span>frequency_penalty</span><input data-option="frequency_penalty" data-type="float" type="number" step="any" placeholder="0.0" /></label>
<label class="settings-field"><span>mirostat</span><input data-option="mirostat" data-type="int" type="number" step="1" placeholder="0" /></label>
<label class="settings-field"><span>mirostat_tau</span><input data-option="mirostat_tau" data-type="float" type="number" step="any" placeholder="5.0" /></label>
<label class="settings-field"><span>mirostat_eta</span><input data-option="mirostat_eta" data-type="float" type="number" step="any" placeholder="0.1" /></label>
</div>
<label class="settings-field" for="settings-stop">
<span>stop</span>
<textarea id="settings-stop" rows="4"
placeholder="{{ t('settings.ollama.stop_placeholder') }}"></textarea>
</label>
</details>
</section>
<div id="settings-status" class="settings-status" role="status" aria-live="polite"></div>
</div>
<div id="settings-modal-footer" class="modal-footer" hidden>
<button id="settings-save-btn" type="button">{{ t('common.save') }}</button>
</div>
</div>
</div>
<div id="mcp-modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h2>{{ t('mcp.server_settings') }}</h2>
<button id="mcp-modal-close" type="button" class="close-btn">×</button>
</div>
<div class="modal-body">
<div id="mcp-servers"></div>
<button id="mcp-add-btn" type="button" class="secondary">{{ t('mcp.add_server') }}</button>
</div>
<div class="modal-footer">
<button id="mcp-save-btn" type="button">{{ t('common.save') }}</button>
</div>
</div>
</div>
<script src="{{ url_for('static', path='tools.js') }}"></script>
<script src="{{ url_for('static', path='mcp.js') }}"></script>
<script src="{{ url_for('static', path='settings-actions.js') }}"></script>
<script src="{{ url_for('static', path='app.js') }}"></script>
</body>
</html>
|