Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07f6fec4bf | ||
|
|
6761a73364 | ||
|
|
0d1ce96c99 | ||
|
|
b16b3af44d |
No files matched your search
@@ -6,6 +6,8 @@ COPY frontend/ frontend/
|
||||
RUN npm run build --prefix frontend
|
||||
|
||||
FROM python:3.12-slim
|
||||
ARG APP_VERSION=dev
|
||||
ENV APP_VERSION=$APP_VERSION
|
||||
WORKDIR /app
|
||||
|
||||
COPY backend/requirements.txt .
|
||||
|
||||
+19
-1
@@ -14,7 +14,7 @@ Typische Anwendungsfälle:
|
||||
|
||||
## Zugang
|
||||
|
||||
Der Dienst ist **nur im Intranet** erreichbar.
|
||||
Der Dienst ist **nur im Intranet (VPN)** erreichbar.
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
@@ -86,6 +86,24 @@ for m in models.data:
|
||||
|
||||
---
|
||||
|
||||
## Aktuell geladenes Modell abfragen
|
||||
|
||||
Da immer nur ein Modell gleichzeitig im Speicher sein kann, lässt sich mit folgendem Aufruf prüfen, welches Modell gerade aktiv ist:
|
||||
|
||||
```python
|
||||
import httpx
|
||||
|
||||
r = httpx.get(
|
||||
"http://141.75.33.244:8000/api/ps",
|
||||
headers={"Authorization": "Bearer sk-..."}
|
||||
)
|
||||
print(r.json())
|
||||
```
|
||||
|
||||
Die Antwort enthält Modellname, Größe und wie lange das Modell noch im Speicher bleibt.
|
||||
|
||||
---
|
||||
|
||||
## Empfehlungen zur Nutzung
|
||||
|
||||
- **Kleines Modell zuerst** (`gemma4:31b` oder `gpt-oss:20b`) – viel schneller, für viele Aufgaben ausreichend.
|
||||
|
||||
+4
-1
@@ -131,7 +131,10 @@ async def get_proxy_info(_ = Depends(require_admin_auth)):
|
||||
host = os.getenv("PROXY_HOST", "0.0.0.0")
|
||||
port = os.getenv("PROXY_PORT", "8000")
|
||||
display_host = "localhost" if host in ("0.0.0.0", "::") else host
|
||||
return {"endpoint": f"http://{display_host}:{port}"}
|
||||
return {
|
||||
"endpoint": f"http://{display_host}:{port}",
|
||||
"version": os.getenv("APP_VERSION", "dev"),
|
||||
}
|
||||
|
||||
@app.get("/api/settings", response_model=schemas.Settings)
|
||||
async def read_settings(db: Session = Depends(get_db), _ = Depends(require_admin_auth)):
|
||||
|
||||
@@ -149,6 +149,16 @@ async def list_models(db: Session = Depends(get_db)):
|
||||
response = await proxy_request(f"{ollama_url}/api/tags", method="GET")
|
||||
return JSONResponse(content=response.json(), status_code=response.status_code)
|
||||
|
||||
@app.get("/version")
|
||||
async def version():
|
||||
return {"version": os.getenv("APP_VERSION", "dev")}
|
||||
|
||||
@app.get("/api/ps")
|
||||
async def running_models(db: Session = Depends(get_db)):
|
||||
ollama_url = crud.get_setting(db, "ollama_url", os.getenv("OLLAMA_URL", "http://localhost:11434"))
|
||||
response = await proxy_request(f"{ollama_url}/api/ps", method="GET")
|
||||
return JSONResponse(content=response.json(), status_code=response.status_code)
|
||||
|
||||
@app.get("/api/versions")
|
||||
async def versions(db: Session = Depends(get_db)):
|
||||
ollama_url = crud.get_setting(db, "ollama_url", os.getenv("OLLAMA_URL", "http://localhost:11434"))
|
||||
|
||||
@@ -37,6 +37,7 @@ echo ""
|
||||
docker buildx build \
|
||||
--platform "$PLATFORM" \
|
||||
--push \
|
||||
--build-arg APP_VERSION="$VERSION" \
|
||||
-t "$IMAGE:$VERSION" \
|
||||
-t "$IMAGE:latest" \
|
||||
.
|
||||
|
||||
@@ -82,6 +82,7 @@ function SettingsSection({ password }) {
|
||||
const [modelsLoading, setModelsLoading] = useState(false);
|
||||
const [ollamaReachable, setOllamaReachable] = useState(true);
|
||||
const [proxyEndpoint, setProxyEndpoint] = useState(null);
|
||||
const [appVersion, setAppVersion] = useState(null);
|
||||
const [saved, setSaved] = useState(false);
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
@@ -115,6 +116,7 @@ function SettingsSection({ password }) {
|
||||
const s = settingsRes.data;
|
||||
setSettings(s);
|
||||
setProxyEndpoint(proxyRes.data.endpoint);
|
||||
setAppVersion(proxyRes.data.version);
|
||||
fetchModels(s.ollama_url, s.force_model);
|
||||
}).catch(() => setError('Einstellungen konnten nicht geladen werden.'));
|
||||
}, []);
|
||||
@@ -145,6 +147,10 @@ function SettingsSection({ password }) {
|
||||
<small> (Änderung erfordert Neustart)</small>
|
||||
</span>
|
||||
</div>
|
||||
<div className="settings-row">
|
||||
<label>Version</label>
|
||||
<span className="settings-value">{appVersion ?? '…'}</span>
|
||||
</div>
|
||||
<div className="settings-row">
|
||||
<label>Ollama-Endpunkt</label>
|
||||
<div className="settings-input-wrap">
|
||||
|
||||
Reference in new issue
Block a user