PPQ Private Mode StartOS package

Wraps the ppq-private-mode-proxy (git submodule, built from its own
Dockerfile) as a StartOS 0.4.0 service:
- Critical first-run task + masked action to set the PPQ.AI API key
- OpenAI-/Anthropic-compatible API interface on port 8787
- Health check reflects enclave attestation (proxy binds only after
  attestation succeeds)
- x86_64 + aarch64, config backed up via the main volume

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
mattius459andClaude Fable 5 committed 2026-07-27 22:27:38 +02:00
commit b6b2589c55
40 files changed
+2532

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
.git
.gitmodules
+20
View File
@@ -0,0 +1,20 @@
name: Build
on:
workflow_dispatch:
pull_request:
paths-ignore: ['*.md']
branches: ['master']
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
if: github.event.pull_request.draft == false
uses: Start9Labs/start-technologies/.github/workflows/build.yml@master
# with:
# FREE_DISK_SPACE: true
secrets:
DEV_KEY: ${{ secrets.DEV_KEY }}
+33
View File
@@ -0,0 +1,33 @@
name: Release
on:
push:
tags:
- 'v*.*'
jobs:
guard:
runs-on: ubuntu-latest
outputs:
id: ${{ steps.read.outputs.id }}
steps:
- uses: actions/checkout@v4
- id: read
run: |
id="$(awk -F"'" '/id:/ {print $2; exit}' startos/manifest/index.ts)"
echo "id=$id" >> "$GITHUB_OUTPUT"
release:
needs: guard
if: needs.guard.outputs.id != 'hello-world'
uses: Start9Labs/start-technologies/.github/workflows/release.yml@master
with:
# FREE_DISK_SPACE: true
RELEASE_REGISTRY: ${{ vars.RELEASE_REGISTRY }}
S3_S9PKS_BASE_URL: ${{ vars.S3_S9PKS_BASE_URL }}
secrets:
DEV_KEY: ${{ secrets.DEV_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
permissions:
contents: write
+38
View File
@@ -0,0 +1,38 @@
name: Tag and Release
on:
push:
branches: ['master']
paths-ignore: ['*.md']
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
guard:
runs-on: ubuntu-latest
outputs:
id: ${{ steps.read.outputs.id }}
steps:
- uses: actions/checkout@v4
- id: read
run: |
id="$(awk -F"'" '/id:/ {print $2; exit}' startos/manifest/index.ts)"
echo "id=$id" >> "$GITHUB_OUTPUT"
tag:
needs: guard
if: needs.guard.outputs.id != 'hello-world'
uses: Start9Labs/start-technologies/.github/workflows/tagAndRelease.yml@master
with:
REFERENCE_REGISTRY: ${{ vars.REFERENCE_REGISTRY }}
# FREE_DISK_SPACE: true
RELEASE_REGISTRY: ${{ vars.RELEASE_REGISTRY }}
S3_S9PKS_BASE_URL: ${{ vars.S3_S9PKS_BASE_URL }}
secrets:
DEV_KEY: ${{ secrets.DEV_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
permissions:
contents: write
+8
View File
@@ -0,0 +1,8 @@
*.s9pk
startos/*.js
node_modules/
.DS_Store
.vscode/
docker-images
javascript
ncc-cache
+3
View File
@@ -0,0 +1,3 @@
[submodule "ppq-private-mode-proxy"]
path = ppq-private-mode-proxy
url = https://github.com/PayPerQ/ppq-private-mode-proxy.git
+19
View File
@@ -0,0 +1,19 @@
# AGENTS.md
This is a StartOS service-package repository — it builds a `.s9pk` for StartOS.
Develop it inside a StartOS packaging workspace created by `start-cli s9pk init-workspace`,
which provides the packaging guide and agent context one level up. If you're reading this in a
bare clone with no workspace, the full guide is at <https://docs.start9.com/packaging>.
**Start every task at the recipe index** — `../start-technologies/projects/start-sdk/docs/src/recipes.md`
(or <https://docs.start9.com/packaging/recipes.html>). It maps an intent ("prompt the user to create
admin credentials", "expose a web UI") to the constructs, the reference pages, and a named production
package to copy. Find the recipe before you read this package's neighbours: a package you reach by
grepping may be non-conformant, and the recipe outranks it.
Work this package's `TODO.md` from top to bottom. Keep `README.md` (architecture, for developers and LLMs) and `instructions.md` (end-user docs) in sync with your changes.
## Inspecting a running install
To run a command inside a service's container (read its generated config, grep app logs), use `start-cli package attach <id> -n <subcontainer-name> -- <cmd>`. Select the subcontainer by **name** with `-n` (the name passed to `SubContainer.of` in `main.ts`, e.g. `-n web`) or by image with `-i`. Note: `-s/--subcontainer` matches the internal **Guid**, not the name, so passing a name to `-s` fails with "no matching subcontainers". A service with more than one subcontainer requires a selector; with none given, `attach` falls back to an interactive picker that panics in a non-TTY shell — that's the missing selector, not a TTY requirement.
+1
View File
@@ -0,0 +1 @@
@AGENTS.md
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 New Caird Technologies, Inc. (PPQ.AI)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+3
View File
@@ -0,0 +1,3 @@
ARCHES := x86 arm
# overrides to s9pk.mk must precede the include statement
include node_modules/@start9labs/start-sdk/s9pk.mk
+141
View File
@@ -0,0 +1,141 @@
<p align="center">
<img src="icon.svg" alt="PPQ Private Mode Logo" width="21%" />
</p>
# PPQ Private Mode on StartOS
> **Upstream docs:** <https://github.com/PayPerQ/ppq-private-mode-proxy>
>
> Everything not listed in this document should behave the same as the upstream
> PPQ Private Mode proxy. If a feature, setting, or behavior is not mentioned
> here, the upstream documentation is accurate and fully applicable.
End-to-end encrypted proxy for [PPQ.AI](https://ppq.ai) private (TEE) AI models.
Requests are encrypted on your server and only decrypted inside a
hardware-secured enclave whose code fingerprint is cryptographically attested
before any data is sent. Upstream: [PayPerQ/ppq-private-mode-proxy](https://github.com/PayPerQ/ppq-private-mode-proxy).
---
## Table of Contents
- [Image and Container Runtime](#image-and-container-runtime)
- [Volume and Data Layout](#volume-and-data-layout)
- [Installation and First-Run Flow](#installation-and-first-run-flow)
- [Configuration Management](#configuration-management)
- [Network Access and Interfaces](#network-access-and-interfaces)
- [Actions (StartOS UI)](#actions-startos-ui)
- [Backups and Restore](#backups-and-restore)
- [Health Checks](#health-checks)
- [Dependencies](#dependencies)
- [Limitations and Differences](#limitations-and-differences)
- [What Is Unchanged from Upstream](#what-is-unchanged-from-upstream)
- [Contributing](#contributing)
- [Quick Reference for AI Consumers](#quick-reference-for-ai-consumers)
---
## Image and Container Runtime
The image is built from the upstream repository's own `Dockerfile` via the
`ppq-private-mode-proxy` git submodule (multi-stage `node:22-alpine` build,
runs as the unprivileged `node` user). No entrypoint modifications; the daemon
runs `node /app/dist/bin/server.js` directly.
Architectures: `x86_64`, `aarch64`.
## Volume and Data Layout
One volume, `main`, mounted at `/data`. The proxy itself is stateless; the
volume holds only `config.json` (the StartOS-managed settings file containing
the API key and logging preference), written by the SDK on the host side.
## Installation and First-Run Flow
On install, a critical task prompts for a PPQ.AI API key. The service cannot
start until the key is provided (upstream exits immediately without
`PPQ_API_KEY`). There is no other setup.
## Configuration Management
All upstream configuration is via environment variables; StartOS manages them
from `config.json`:
- `PPQ_API_KEY` — set from the **Configure PPQ API Key** action
- `DEBUG` — set from the same action's Verbose Logging toggle
- `HOST` — fixed to `0.0.0.0` (container binding)
- `PORT` — fixed to `8787`
- `PPQ_API_BASE` — not set (upstream default `https://api.ppq.ai`)
Changing settings restarts the daemon (values are read reactively).
## Network Access and Interfaces
One interface, `api` (port 8787, HTTP): the upstream OpenAI-compatible API,
shown as a copyable connection string. Endpoints: `GET /health`,
`GET /v1/models`, `POST /v1/chat/completions` (OpenAI format),
`POST /v1/messages` (Anthropic format). Availability on LAN/Tor is decided by
the user from the interface panel.
## Actions (StartOS UI)
- **Configure PPQ API Key** (`configure-api-key`) — sets the PPQ.AI API key
(masked, never echoed back) and the Verbose Logging toggle. Available at any
service status. Also the target of the critical first-run task.
## Backups and Restore
The `main` volume (i.e. `config.json`) is backed up. Restore brings back the
saved API key and settings; no other state exists.
## Health Checks
One daemon readiness check on port 8787. The upstream proxy only binds its
port after remote attestation of the enclave succeeds, so "listening" implies
the encrypted channel is verified. Until attestation completes the check
reports the proxy as not ready.
## Dependencies
None.
## Limitations and Differences
1. This service is a client-side encryption proxy, not a self-hosted model
server: inference runs remotely in PPQ.AI's attested TEE enclaves, and a
funded [PPQ.AI](https://ppq.ai) API key is required (pay-per-query).
2. The upstream OpenClaw-plugin mode is not packaged; only the standalone
proxy runs on StartOS.
3. The bind address and port are fixed (`0.0.0.0:8787` inside the container);
upstream's `HOST`/`PORT`/`PPQ_API_BASE` variables are not user-configurable.
## What Is Unchanged from Upstream
- All API endpoints, request/response formats, and streaming behavior
- The encryption and attestation flow (EHBP transport via the `tinfoil` client)
- Model catalog and per-request `Authorization: Bearer` key override
## Contributing
See [AGENTS.md](AGENTS.md).
---
## Quick Reference for AI Consumers
```yaml
package_id: ppq-private-mode
architectures: [x86_64, aarch64]
volumes:
main: /data
ports:
api: 8787
dependencies: none
startos_managed_env_vars:
- PPQ_API_KEY
- HOST
- PORT
- DEBUG
actions:
- configure-api-key
```
+12
View File
@@ -0,0 +1,12 @@
# TODO — remaining work before release
- [ ] Install on a StartOS box and verify: critical task prompts for the API
key, service starts, health check turns ready after attestation, and a
`POST /v1/chat/completions` request against the exported interface
address succeeds.
- [ ] Backup / restore sanity check (config.json survives, service starts
without re-prompting for the key).
- [ ] Review README and instructions once more against actual behavior on the
box.
- [ ] Submit to the Community Registry (email submissions@start9.com with a
link to this repo).
+25
View File
@@ -0,0 +1,25 @@
# Updating the upstream version
Upstream is [PayPerQ/ppq-private-mode-proxy](https://github.com/PayPerQ/ppq-private-mode-proxy),
vendored as the `ppq-private-mode-proxy` git submodule and built from its own
`Dockerfile`. The package version tracks upstream's `package.json` version.
## Determining the upstream version
```bash
git -C ppq-private-mode-proxy fetch origin
git -C ppq-private-mode-proxy log --oneline HEAD..origin/main # anything new?
jq -r .version ppq-private-mode-proxy/package.json # current pin
```
The packaged version lives in `startos/versions/current.ts` (`version:
'<upstream>:<revision>'`).
## Applying the bump
1. Advance the submodule: `git -C ppq-private-mode-proxy checkout origin/main`
2. Update `version` in `startos/versions/current.ts` to the new upstream
`package.json` version with revision `:0` (bump only the revision for
packaging-only changes), and write release notes.
3. Rebuild and test: `make x86` (or `make arm`), install, verify attestation
completes and a `/v1/models` request succeeds.
+18
View File
@@ -0,0 +1,18 @@
# assets/
Supplementary files that ship inside the `.s9pk` alongside your compiled code —
anything the service needs at runtime that isn't part of the upstream image.
Typical contents:
- entrypoint or wrapper scripts the daemon execs,
- configuration templates / generators,
- static files (default configs, seed data, certificates),
- an `ABOUT.md` or other docs you want bundled.
To make these files visible inside a container, mount them in `startos/main.ts`
with `sdk.Mounts.…mountAssets(…)` and exec against the mountpoint (see the
Volume Mounts section of `../../src/main.md`).
This directory is **required and must not be empty** — the build fails and git
won't track an empty directory. This README satisfies that requirement, so don't
delete it unless you're adding real assets to replace it.
+18
View File
@@ -0,0 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect width="512" height="512" rx="104" ry="105" fill="white"/>
<g transform="translate(256, 256) scale(12.75) translate(-12, -12)">
<path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"/>
<path d="M9 13a4.5 4.5 0 0 0 3-4"/>
<path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"/>
<path d="M3.477 10.896a4 4 0 0 1 .585-.396"/>
<path d="M6 18a4 4 0 0 1-1.967-.516"/>
<path d="M12 13h4"/>
<path d="M12 18h6a2 2 0 0 1 2 2v1"/>
<path d="M12 8h8"/>
<path d="M16 8V5a2 2 0 0 1 2-2"/>
<circle cx="16" cy="13" r=".5"/>
<circle cx="18" cy="3" r=".5"/>
<circle cx="20" cy="21" r=".5"/>
<circle cx="20" cy="8" r=".5"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 894 B

+46
View File
@@ -0,0 +1,46 @@
# PPQ Private Mode
## Documentation
- [Upstream proxy documentation](https://github.com/PayPerQ/ppq-private-mode-proxy) — endpoints, client examples, and how the encryption works
- [PPQ.AI API docs](https://ppq.ai/api-docs) — creating an API key and funding your account
## Getting set up
1. When the service is installed, you will be prompted to run **Configure PPQ
API Key**. Paste an API key from [ppq.ai](https://ppq.ai) (create one under
**Settings → API Keys** and fund the account — usage is billed per query to
this key).
2. The service starts and performs a cryptographic attestation of the remote
enclave. The health check reports ready once attestation is verified —
usually within a few seconds.
3. Copy the **OpenAI-Compatible API** address from the service's interface
panel. That is the URL you point your AI clients at.
## Using the proxy
Point any OpenAI-compatible client at the interface address:
```
POST <api-address>/v1/chat/completions
{"model": "private/glm-5-2", "messages": [{"role": "user", "content": "Hello"}]}
```
Anthropic-SDK clients (including Claude Code) can use the native endpoint at
`<api-address>/v1/messages`. For Claude Code, set:
```
export ANTHROPIC_BASE_URL="<api-address>"
export ANTHROPIC_MODEL="private/glm-5-2"
```
`GET <api-address>/v1/models` lists the available private models. Every
request is encrypted on your server before it leaves and is only decrypted
inside the attested enclave — neither PPQ.AI nor the model host can read your
queries.
Requests are billed to your saved API key by default. To bill a different
PPQ.AI key per request, pass it as an `Authorization: Bearer` header.
If you need to change the key or turn on verbose logging later, run
**Configure PPQ API Key** again from the service's Actions.
+1670
View File
File diff suppressed because it is too large. Load diff
+26
View File
@@ -0,0 +1,26 @@
{
"name": "ppq-private-mode-startos",
"scripts": {
"build": "rm -rf ./javascript && ncc build startos/index.ts -o ./javascript",
"prettier": "prettier --write startos",
"check": "tsc --noEmit"
},
"dependencies": {
"@start9labs/start-sdk": "2.0.9"
},
"overrides": {
"@start9labs/start-sdk": "$@start9labs/start-sdk"
},
"devDependencies": {
"@types/node": "^22.19.0",
"@vercel/ncc": "^0.38.4",
"prettier": "^3.6.2",
"typescript": "^6.0.3"
},
"prettier": {
"trailingComma": "all",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
}
+67
View File
@@ -0,0 +1,67 @@
import { sdk } from '../sdk'
import { configJson } from '../fileModels/config.json'
import { i18n } from '../i18n'
const { InputSpec, Value } = sdk
const inputSpec = InputSpec.of({
apiKey: Value.text({
name: i18n('PPQ.AI API Key'),
description: i18n(
'Your API key from ppq.ai (Settings → API Keys). Leave blank to keep the key already saved.',
),
required: false,
default: null,
masked: true,
placeholder: 'sk-...',
}),
debug: Value.toggle({
name: i18n('Verbose Logging'),
description: i18n(
'Log every request the proxy handles. Useful for troubleshooting.',
),
default: false,
}),
})
export const configureApiKey = sdk.Action.withInput(
'configure-api-key',
async ({ effects }) => ({
name: i18n('Configure PPQ API Key'),
description: i18n(
'Set the PPQ.AI API key the proxy uses to authenticate. Requests are billed to this key.',
),
warning: null,
allowedStatuses: 'any',
group: null,
visibility: 'enabled',
}),
inputSpec,
// Prefill: the API key is never echoed back into the form.
async ({ effects }) => {
const debug = await configJson
.read((c) => c.debug)
.once()
.catch(() => false)
return { debug: debug ?? false }
},
async ({ effects, input }) => {
const existingKey = await configJson
.read((c) => c.apiKey)
.once()
.catch(() => undefined)
const apiKey = (input.apiKey ?? '').trim() || existingKey
if (!apiKey) {
throw new Error(
i18n('An API key is required. Create one at ppq.ai under Settings → API Keys.'),
)
}
await configJson.merge(effects, { apiKey, debug: input.debug })
},
)
+4
View File
@@ -0,0 +1,4 @@
import { sdk } from '../sdk'
import { configureApiKey } from './configureApiKey'
export const actions = sdk.Actions.of().addAction(configureApiKey)
+5
View File
@@ -0,0 +1,5 @@
import { sdk } from './sdk'
export const { createBackup, restoreInit } = sdk.setupBackups(
async ({ effects }) => sdk.Backups.ofVolumes('main'),
)
+5
View File
@@ -0,0 +1,5 @@
import { sdk } from './sdk'
export const setDependencies = sdk.setupDependencies(
async ({ effects }) => ({}),
)
+5
View File
@@ -0,0 +1,5 @@
Use the `/fileModels` directory to create separate `.ts` files to represent underlying files used by you package. The exported `FileModels` afford a convenient and type safe way to read amd write to the underlying files, as well as react to changes.
Supported file formats are `.yaml`, `.toml`, `.json`, `.env`, `.ini`, and `.txt`. For alternative file formats, you can use the `raw` method and provide custom serialization and parser functions.
It is common for packages to use a `store.json.ts` FileModel as a convenient place to persist arbitrary data that are needed by the package but are _not_ persisted by the upstream service. For example, you might use store.json to persist startup flags or login credentials.
+15
View File
@@ -0,0 +1,15 @@
import { FileHelper, z } from '@start9labs/start-sdk'
import { sdk } from '../sdk'
// Package-owned settings file on the main volume. The upstream proxy is
// configured purely through environment variables; main.ts bridges these
// values into the daemon's env.
const shape = z.object({
apiKey: z.string().optional().catch(undefined),
debug: z.boolean().catch(false),
})
export const configJson = FileHelper.json(
{ base: sdk.volumes.main, subpath: 'config.json' },
shape,
)
+29
View File
@@ -0,0 +1,29 @@
export const DEFAULT_LANG = 'en_US'
const dict = {
// main.ts
'Starting PPQ Private Mode!': 0,
'Encrypted Proxy': 1,
'The proxy is ready — enclave attestation verified': 2,
'The proxy is not ready (enclave attestation pending)': 3,
// interfaces.ts
'OpenAI-Compatible API': 4,
'Point any OpenAI or Anthropic SDK client at this URL to use PPQ private (TEE) models with end-to-end encryption': 5,
// actions/configureApiKey.ts
'PPQ.AI API Key': 6,
'Your API key from ppq.ai (Settings → API Keys). Leave blank to keep the key already saved.': 7,
'Verbose Logging': 8,
'Log every request the proxy handles. Useful for troubleshooting.': 9,
'Configure PPQ API Key': 10,
'Set the PPQ.AI API key the proxy uses to authenticate. Requests are billed to this key.': 11,
'An API key is required. Create one at ppq.ai under Settings → API Keys.': 12,
// init/taskConfigureApiKey.ts
'Add your PPQ.AI API key to start the proxy': 13,
} as const
/**
* Plumbing. DO NOT EDIT.
*/
export type I18nKey = keyof typeof dict
export type LangDict = Record<(typeof dict)[I18nKey], string>
export default dict
+68
View File
@@ -0,0 +1,68 @@
import { LangDict } from './default'
export default {
es_ES: {
0: '¡Iniciando PPQ Private Mode!',
1: 'Proxy cifrado',
2: 'El proxy está listo — atestación del enclave verificada',
3: 'El proxy no está listo (atestación del enclave pendiente)',
4: 'API compatible con OpenAI',
5: 'Apunta cualquier cliente SDK de OpenAI o Anthropic a esta URL para usar los modelos privados (TEE) de PPQ con cifrado de extremo a extremo',
6: 'Clave API de PPQ.AI',
7: 'Tu clave API de ppq.ai (Ajustes → Claves API). Déjalo en blanco para conservar la clave ya guardada.',
8: 'Registro detallado',
9: 'Registra cada solicitud que maneja el proxy. Útil para diagnosticar problemas.',
10: 'Configurar clave API de PPQ',
11: 'Establece la clave API de PPQ.AI que el proxy usa para autenticarse. Las solicitudes se facturan a esta clave.',
12: 'Se requiere una clave API. Crea una en ppq.ai en Ajustes → Claves API.',
13: 'Añade tu clave API de PPQ.AI para iniciar el proxy',
},
de_DE: {
0: 'Starte PPQ Private Mode!',
1: 'Verschlüsselter Proxy',
2: 'Der Proxy ist bereit — Enklave-Attestierung verifiziert',
3: 'Der Proxy ist nicht bereit (Enklave-Attestierung ausstehend)',
4: 'OpenAI-kompatible API',
5: 'Verbinde jeden OpenAI- oder Anthropic-SDK-Client mit dieser URL, um die privaten (TEE) Modelle von PPQ mit Ende-zu-Ende-Verschlüsselung zu nutzen',
6: 'PPQ.AI-API-Schlüssel',
7: 'Dein API-Schlüssel von ppq.ai (Einstellungen → API-Schlüssel). Leer lassen, um den bereits gespeicherten Schlüssel zu behalten.',
8: 'Ausführliche Protokollierung',
9: 'Protokolliert jede Anfrage, die der Proxy verarbeitet. Nützlich zur Fehlersuche.',
10: 'PPQ-API-Schlüssel konfigurieren',
11: 'Lege den PPQ.AI-API-Schlüssel fest, mit dem sich der Proxy authentifiziert. Anfragen werden diesem Schlüssel in Rechnung gestellt.',
12: 'Ein API-Schlüssel ist erforderlich. Erstelle einen auf ppq.ai unter Einstellungen → API-Schlüssel.',
13: 'Füge deinen PPQ.AI-API-Schlüssel hinzu, um den Proxy zu starten',
},
pl_PL: {
0: 'Uruchamianie PPQ Private Mode!',
1: 'Szyfrowany proxy',
2: 'Proxy jest gotowy — atestacja enklawy zweryfikowana',
3: 'Proxy nie jest gotowy (atestacja enklawy w toku)',
4: 'API zgodne z OpenAI',
5: 'Skieruj dowolnego klienta SDK OpenAI lub Anthropic na ten URL, aby korzystać z prywatnych modeli (TEE) PPQ z szyfrowaniem end-to-end',
6: 'Klucz API PPQ.AI',
7: 'Twój klucz API z ppq.ai (Ustawienia → Klucze API). Pozostaw puste, aby zachować już zapisany klucz.',
8: 'Szczegółowe logowanie',
9: 'Rejestruje każde żądanie obsługiwane przez proxy. Przydatne przy rozwiązywaniu problemów.',
10: 'Skonfiguruj klucz API PPQ',
11: 'Ustaw klucz API PPQ.AI, którym proxy się uwierzytelnia. Żądania są rozliczane na ten klucz.',
12: 'Wymagany jest klucz API. Utwórz go na ppq.ai w Ustawienia → Klucze API.',
13: 'Dodaj swój klucz API PPQ.AI, aby uruchomić proxy',
},
fr_FR: {
0: 'Démarrage de PPQ Private Mode !',
1: 'Proxy chiffré',
2: "Le proxy est prêt — attestation de l'enclave vérifiée",
3: "Le proxy n'est pas prêt (attestation de l'enclave en attente)",
4: 'API compatible OpenAI',
5: "Pointez n'importe quel client SDK OpenAI ou Anthropic vers cette URL pour utiliser les modèles privés (TEE) de PPQ avec un chiffrement de bout en bout",
6: 'Clé API PPQ.AI',
7: 'Votre clé API de ppq.ai (Paramètres → Clés API). Laissez vide pour conserver la clé déjà enregistrée.',
8: 'Journalisation détaillée',
9: 'Journalise chaque requête traitée par le proxy. Utile pour le dépannage.',
10: 'Configurer la clé API PPQ',
11: "Définissez la clé API PPQ.AI avec laquelle le proxy s'authentifie. Les requêtes sont facturées sur cette clé.",
12: 'Une clé API est requise. Créez-en une sur ppq.ai dans Paramètres → Clés API.',
13: 'Ajoutez votre clé API PPQ.AI pour démarrer le proxy',
},
} satisfies Record<string, LangDict>
+8
View File
@@ -0,0 +1,8 @@
/**
* Plumbing. DO NOT EDIT this file.
*/
import { setupI18n } from '@start9labs/start-sdk'
import defaultDict, { DEFAULT_LANG } from './dictionaries/default'
import translations from './dictionaries/translations'
export const i18n = setupI18n(defaultDict, translations, DEFAULT_LANG)
+11
View File
@@ -0,0 +1,11 @@
/**
* Plumbing. DO NOT EDIT.
*/
export { createBackup } from './backups'
export { main } from './main'
export { init, uninit } from './init'
export { actions } from './actions'
import { buildManifest } from '@start9labs/start-sdk'
import { manifest as sdkManifest } from './manifest'
import { versionGraph } from './versions'
export const manifest = buildManifest(versionGraph, sdkManifest)
+18
View File
@@ -0,0 +1,18 @@
import { sdk } from '../sdk'
import { setDependencies } from '../dependencies'
import { setInterfaces } from '../interfaces'
import { versionGraph } from '../versions'
import { actions } from '../actions'
import { restoreInit } from '../backups'
import { taskConfigureApiKey } from './taskConfigureApiKey'
export const init = sdk.setupInit(
restoreInit,
versionGraph,
setInterfaces,
setDependencies,
actions,
taskConfigureApiKey,
)
export const uninit = sdk.setupUninit(versionGraph)
+19
View File
@@ -0,0 +1,19 @@
import { sdk } from '../sdk'
import { configJson } from '../fileModels/config.json'
import { configureApiKey } from '../actions/configureApiKey'
import { i18n } from '../i18n'
// The proxy cannot start without a PPQ.AI API key, so a critical task blocks
// startup until the user provides one.
export const taskConfigureApiKey = sdk.setupOnInit(async (effects, kind) => {
const apiKey = await configJson
.read((c) => c.apiKey)
.once()
.catch(() => undefined)
if (!apiKey) {
await sdk.action.createOwnTask(effects, configureApiKey, 'critical', {
reason: i18n('Add your PPQ.AI API key to start the proxy'),
})
}
})
+31
View File
@@ -0,0 +1,31 @@
import { sdk } from './sdk'
import { apiPort } from './utils'
import { i18n } from './i18n'
// Host id (the sdk.MultiHost.of group) — distinct from the interface id exported on it.
export const apiHostId = 'api-multi'
export const apiInterfaceId = 'api'
export const setInterfaces = sdk.setupInterfaces(async ({ effects }) => {
const apiMulti = sdk.MultiHost.of(effects, apiHostId)
const apiMultiOrigin = await apiMulti.bindPort(apiPort, {
protocol: 'http',
})
const api = sdk.createInterface(effects, {
name: i18n('OpenAI-Compatible API'),
id: apiInterfaceId,
description: i18n(
'Point any OpenAI or Anthropic SDK client at this URL to use PPQ private (TEE) models with end-to-end encryption',
),
type: 'api',
masked: true,
schemeOverride: null,
username: null,
path: '',
query: {},
})
const apiReceipt = await apiMultiOrigin.export([api])
return [apiReceipt]
})
+47
View File
@@ -0,0 +1,47 @@
import { i18n } from './i18n'
import { sdk } from './sdk'
import { apiPort } from './utils'
import { configJson } from './fileModels/config.json'
export const main = sdk.setupMain(async ({ effects }) => {
console.info(i18n('Starting PPQ Private Mode!'))
// Read reactively so the daemon restarts when the user changes settings.
const apiKey = await configJson.read((c) => c.apiKey).const(effects)
const debug = await configJson.read((c) => c.debug).const(effects)
return sdk.Daemons.of(effects).addDaemon('proxy', {
subcontainer: sdk.SubContainer.of(
effects,
{ imageId: 'proxy' },
sdk.Mounts.of().mountVolume({
volumeId: 'main',
subpath: null,
mountpoint: '/data',
readonly: false,
}),
'proxy-sub',
),
exec: {
command: ['node', '/app/dist/bin/server.js'],
env: {
PPQ_API_KEY: apiKey ?? '',
HOST: '0.0.0.0',
PORT: apiPort.toString(),
DEBUG: debug ? 'true' : 'false',
},
},
// The proxy only binds its port after remote attestation of the enclave
// succeeds, so a listening port means the encrypted channel is verified
// and ready.
ready: {
display: i18n('Encrypted Proxy'),
fn: () =>
sdk.healthCheck.checkPortListening(effects, apiPort, {
successMessage: i18n('The proxy is ready — enclave attestation verified'),
errorMessage: i18n('The proxy is not ready (enclave attestation pending)'),
}),
},
requires: [],
})
})
+20
View File
@@ -0,0 +1,20 @@
export const short = {
en_US: 'End-to-end encrypted proxy for PPQ.AI private (TEE) AI models',
es_ES: 'Proxy cifrado de extremo a extremo para los modelos de IA privados (TEE) de PPQ.AI',
de_DE: 'Ende-zu-Ende-verschlüsselter Proxy für private (TEE) KI-Modelle von PPQ.AI',
pl_PL: 'Szyfrowany end-to-end proxy dla prywatnych modeli AI (TEE) PPQ.AI',
fr_FR: 'Proxy chiffré de bout en bout pour les modèles IA privés (TEE) de PPQ.AI',
}
export const long = {
en_US:
'Run AI queries that nobody — not even PPQ.AI — can read. This proxy encrypts every request on your server before it leaves, and it is only decrypted inside a hardware-secured enclave (Trusted Execution Environment) that is cryptographically attested before any data is sent. Point any OpenAI- or Anthropic-compatible client (including Claude Code) at the local endpoint and pay per query with a PPQ.AI API key — no subscription required.',
es_ES:
'Ejecuta consultas de IA que nadie — ni siquiera PPQ.AI — puede leer. Este proxy cifra cada solicitud en tu servidor antes de que salga, y solo se descifra dentro de un enclave protegido por hardware (Trusted Execution Environment) que se verifica criptográficamente antes de enviar cualquier dato. Apunta cualquier cliente compatible con OpenAI o Anthropic (incluido Claude Code) al endpoint local y paga por consulta con una clave API de PPQ.AI — sin suscripción.',
de_DE:
'Führe KI-Anfragen aus, die niemand — nicht einmal PPQ.AI — lesen kann. Dieser Proxy verschlüsselt jede Anfrage auf deinem Server, bevor sie ihn verlässt; entschlüsselt wird sie nur innerhalb einer hardwaregesicherten Enklave (Trusted Execution Environment), die vor jeder Datenübertragung kryptografisch attestiert wird. Verbinde jeden OpenAI- oder Anthropic-kompatiblen Client (einschließlich Claude Code) mit dem lokalen Endpunkt und zahle pro Anfrage mit einem PPQ.AI-API-Schlüssel — ohne Abonnement.',
pl_PL:
'Wykonuj zapytania AI, których nikt — nawet PPQ.AI — nie może odczytać. Ten proxy szyfruje każde żądanie na Twoim serwerze, zanim je opuści, a odszyfrowanie następuje wyłącznie wewnątrz sprzętowo zabezpieczonej enklawy (Trusted Execution Environment), kryptograficznie weryfikowanej przed wysłaniem jakichkolwiek danych. Skieruj dowolnego klienta zgodnego z OpenAI lub Anthropic (w tym Claude Code) na lokalny endpoint i płać za zapytanie kluczem API PPQ.AI — bez subskrypcji.',
fr_FR:
"Exécutez des requêtes IA que personne — pas même PPQ.AI — ne peut lire. Ce proxy chiffre chaque requête sur votre serveur avant qu'elle ne parte, et elle n'est déchiffrée qu'à l'intérieur d'une enclave sécurisée par le matériel (Trusted Execution Environment), attestée cryptographiquement avant tout envoi de données. Pointez n'importe quel client compatible OpenAI ou Anthropic (y compris Claude Code) vers le point de terminaison local et payez à la requête avec une clé API PPQ.AI — sans abonnement.",
}
+34
View File
@@ -0,0 +1,34 @@
import { setupManifest } from '@start9labs/start-sdk'
import { long, short } from './i18n'
export const manifest = setupManifest({
id: 'ppq-private-mode',
title: 'PPQ Private Mode',
license: 'MIT',
packageRepo: 'https://github.com/PayPerQ/ppq-private-mode-startos',
upstreamRepo: 'https://github.com/PayPerQ/ppq-private-mode-proxy',
marketingUrl: 'https://ppq.ai',
donationUrl: null,
description: { short, long },
volumes: ['main'],
images: {
// Built from the upstream Dockerfile (git submodule ./ppq-private-mode-proxy).
proxy: {
source: {
dockerBuild: {
workdir: './ppq-private-mode-proxy',
},
},
arch: ['x86_64', 'aarch64'],
},
},
alerts: {
install: null,
update: null,
uninstall: null,
restore: null,
start: null,
stop: null,
},
dependencies: {},
})
+9
View File
@@ -0,0 +1,9 @@
import { StartSdk } from '@start9labs/start-sdk'
import { manifest } from './manifest'
/**
* Plumbing. DO NOT EDIT.
*
* The exported "sdk" const is used throughout this package codebase.
*/
export const sdk = StartSdk.of().withManifest(manifest).build(true)
+4
View File
@@ -0,0 +1,4 @@
// Constants shared across this package's startos/ code.
// Port the proxy listens on inside the container (upstream default).
export const apiPort = 8787
+17
View File
@@ -0,0 +1,17 @@
import { IMPOSSIBLE, VersionInfo } from '@start9labs/start-sdk'
export const current = VersionInfo.of({
// Tracks upstream ppq-private-mode-proxy (package.json version).
version: '0.3.2:0',
releaseNotes: {
en_US: 'Initial release for StartOS',
es_ES: 'Lanzamiento inicial para StartOS',
de_DE: 'Erstveröffentlichung für StartOS',
pl_PL: 'Pierwsze wydanie dla StartOS',
fr_FR: 'Version initiale pour StartOS',
},
migrations: {
up: async ({ effects }) => {},
down: IMPOSSIBLE,
},
})
+7
View File
@@ -0,0 +1,7 @@
import { VersionGraph } from '@start9labs/start-sdk'
import { current } from './current'
export const versionGraph = VersionGraph.of({
current,
other: [],
})
+4
View File
@@ -0,0 +1,4 @@
{
"extends": "@start9labs/start-sdk/tsconfig.base.json",
"include": ["startos/**/*.ts", "node_modules/**/startos"]
}