-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnullorigin.yaml
More file actions
106 lines (96 loc) · 3.89 KB
/
Copy pathnullorigin.yaml
File metadata and controls
106 lines (96 loc) · 3.89 KB
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
# NullOrigin — Default Configuration
# Author: Muhammad Rakibul Islam <imrakibul@gmail.com>
# License: Apache-2.0
#
# Every value here can be overridden by a NULLORIGIN_* environment variable
# (see nullorigin/config.py) and then by an explicit CLI flag.
proxy:
# Loopback by default: this proxy relays your upstream API keys. Binding a
# public interface requires either a telemetry token or --allow-public-bind,
# and should sit behind a TLS-terminating reverse proxy.
host: "127.0.0.1"
port: 8080
# Guards /telemetry and /telemetry/reset. Generate with:
# openssl rand -hex 32
# Leave empty only while bound to loopback.
telemetry_token: ""
# Reject request bodies larger than this many bytes (default 100 MiB).
max_request_bytes: 104857600
# Used when a request carries no x-nullorigin-provider header.
default_provider: "openai"
timeout_seconds: 120.0
upstream_map:
anthropic: "https://api.anthropic.com"
openai: "https://api.openai.com"
gemini: "https://generativelanguage.googleapis.com"
text:
clean_unicode: true
# Fold Cyrillic/Greek confusables to their Latin equivalents.
fold_homoglyphs: true
# Deltas buffered before a streaming span is handed to the rewriter.
stream_window_tokens: 40
# Keep fenced code blocks out of the rewriter. Paraphrasing code produces
# code that does not run, and the z-score drops either way, so nothing
# downstream would notice. Code inside a response still has invisible and
# bidi characters stripped; it is never NFKC-normalized (that rewrites
# string literal values) and never sent to the model.
protect_code_blocks: true
# Also shield inline `code` spans, which usually hold identifiers or commands.
protect_inline_code: true
paraphraser:
# none | ollama | openai_compatible | llama_cpp | lexical
#
# Choosing "none" leaves the statistical watermark intact — only unicode
# artifacts are removed. "lexical" needs no local model but is a much
# weaker attack than a neural rewrite; `nullorigin benchmark` measures the
# difference rather than assuming it.
backend: "ollama"
endpoint: "http://localhost:11434"
model: "llama3.2:3b"
# Used only by the llama_cpp backend.
model_path: ""
# Used only by the openai_compatible backend.
api_key: ""
temperature: 0.75
top_p: 0.9
timeout_seconds: 120.0
# Gate on whether a rewrite preserved meaning. A z-score drop is not evidence
# of preserved meaning: a fluent rewrite that changes a fact scores exactly
# like a faithful one. Failed checks retry at lower temperature and finally
# fall back to the original, because measuring drift after the fact does not
# help if the damaged text has already been returned.
fidelity:
enabled: true
# Retries at progressively lower temperature; drift is temperature-driven.
max_retries: 2
temperature_step: 0.25
# Bidirectional entailment catches role swaps that invariant counting
# cannot. Requires nullorigin[nli]; without it, invariants still gate and
# the limitation is reported rather than hidden.
use_nli: true
nli_threshold: 0.5
nli_model: "cross-encoder/nli-deberta-v3-small"
kgw:
gamma: 0.5
hash_key: 15485863
# z > 4.0 corresponds to p < 3e-5 (Kirchenbauer et al.).
detection_threshold: 4.0
media:
purge_metadata: true
disrupt_stego: true
crop_ratio: 0.005
# trim — shift the coordinate origin without resampling (default;
# retained pixels stay bit-exact, output is ~1% smaller)
# resample — restore exact original dimensions, costing roughly
# SSIM 0.81 / PSNR 31 dB even at a 0.5% crop
# none — no geometric change
crop_mode: "trim"
dwt_threshold: 0.8
fourier_strength: 0.05
dither_sigma: 0.6
audio:
disrupt_watermarks: true
# Phase below this frequency is preserved to protect intelligibility.
low_cut_hz: 800.0
max_shift_rad: 0.25
notch_bands: 3