Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration Reference

4got uses KDL (KDL Document Language) for all configuration. All config files live in the data/ directory.

The files are KDL v1, read by kdl-go: booleans are bare true and false (KDL v2’s #true and #false are refused). A file that is not valid KDL stops the server at startup with file:line:col and nothing from the file itself, since config.kdl holds secrets; a hot reload (SIGUSR1 or POST /admin/reload) keeps what that file configured and logs the same place. 4got --check-config runs the same checks without starting anything (it reads the same file the server would; see below), names each problem by key or file:line:col, never by value, and exits 1 on any fatal one; the deploy runs it before swapping the binary.

config.kdl

The main configuration file. Every field but default-languages has a default.

The server reads the file FGOT_CONFIG names, and stops if it isn’t there. Otherwise it reads the first config.kdl it finds in the folder FGOT_DATA_DIR names, then in data/ under the working directory, then in ../data/. With none, it says so at startup and runs on FGOT_* environment variables alone. Relative data-dir and db-path in a found config.kdl are relative to the folder above its own (with FGOT_CONFIG, to the working directory).

FieldTypeDefaultDescription
portint8888HTTP listen port
hoststring“0.0.0.0”Listen address
owner-secretstring“CHANGE_ME”Admin password. Also used to derive Ed25519 signing keys for session cookies.
deluxe-secretstring“”Legacy cookie-based deluxe tier secret. Leave empty to disable.
pow-difficultyint17The proof of work’s difficulty: 2^difficulty HashWX hashes on average, in 16 puzzles the page solves with a Web Worker per core. Each bit doubles the wait; 17 is about 0.2 s on a desktop’s cores and about a second on one. Under load it is one bit more
default-search-methodstring“GET”The search form’s method for anyone who hasn’t chosen one (GET or POST).
default-bookmark-modestring“link”The bookmark button on results for anyone who hasn’t chosen: link (specific link), domain, or off.
default-audio-playstring“full”How audio reaches someone who may have Full (the owner, and groups with proxy_audio, with proxy-audio on) and hasn’t chosen: full, through this server, or redirect, from its own site; everyone else gets redirect
audio-full-streamsint6Full audio streams (Settings › Play buttons › Audio) playing at once on this server; a person may have two; past either, 429
default-home-buttonstring“right”Where Home sits in the top bar for anyone who hasn’t chosen: right, with the other links, or left, at the bar’s left edge.
default-safesearchint0Safe search for anyone who hasn’t chosen: 0 none, 1 moderate, 2 strict.
default-languagesstringsnone: requiredKnown languages for anyone who hasn’t set theirs, as two-letter ISO 639-1 codes: "en", or "en" "es"; results in another language are translated into the first, and Wikipedia, its card and its sister wikis are asked in it. It has no default: without it the server does not start and --check-config fails, naming the key.
default-friend-sharebooltrueFor anyone who hasn’t chosen: after a fresh search, send its results to this server’s friends (peers.kdl). Settings › History & Privacy › “Send my results to this server’s friends”.
default-tracker-detectionboolfalseTracker detection for anyone who hasn’t chosen: each result names its site’s known trackers (WhoTracksMe), up to three, then “+N” for the rest. Settings › “Tracker detection”.
overload-relayboolfalseWhen the admission gate sheds a web search, run it on the next eligible friend with relay true (federation.md) instead of showing the busy page. That friend reads the words. Never for “Use no outside services” or Incognito.
captcha-bypass-hoursint720How long a captcha solution grants session access
captcha-bypass-searchesint0How many searches the IQ test (or its long proof of work) grants before it is asked again; the pass ends at this or captcha-bypass-hours, whichever comes first. Each results page counts, a later page and the scroll’s next one too, and each API or streamed search; counted in memory, so a restart forgives. The owner and groups that skip the proof of work are not counted. 0 counts nothing
iq-test-log-daysint90Days to keep each IQ test answer (its pictures and their distortions, the squares ticked, the time taken and the day; nothing about who answered), at most the newest 100,000; the owner console counts the last 7 days. -1 keeps them, 0 records none
iq-test-long-extra-bitsint8How much harder than pow-difficulty the IQ test’s alternative for people who can’t see the pictures is; it is worth the same month as the test. Any proof of work is cheaper for a bot than the pictures, so raise this if bots use it; each bit doubles the wait for everyone (8 is about 40 s on four cores of a desktop; the page shows its estimate). A browser without WebAssembly does it in SHA-256, one bit harder. Below 0 counts as 0
pow-bypass-secondsint300How long a PoW solution grants session access
max-searches-per-dayint200The searches a day (UTC) each person, and each API key, may make through the API, MCP, format=json, /feed/search and /search with a key: everything that uses one key shares its count, and a search the cache answers is not counted. A group may set its own in groups.kdl. Past it: 429, saying whose limit it is and when it resets. 0 is no limit; the owner has none
wolfram-answer-sint3600How long a Wolfram|Alpha answer is kept and shown again instead of asking (0 keeps none)
wolfram-miss-sint2592000How long Wolfram|Alpha’s “no answer” is kept, so the question is not sent again (0 keeps none)
ddg-answer-sint86400The same for a DuckDuckGo instant answer
ddg-miss-sint604800The same for DuckDuckGo’s “no answer”
new-cookies-per-dayint0How many browsers a day (UTC) may take the IQ test, or its long proof of work, for a first cookie; then the test says to come back tomorrow. Anyone who passed within captcha-bypass-hours is not counted; 0 is no limit
long-check-sha256-per-dayint20How many long checks a day (UTC) may be passed in SHA-256, the long check’s way for a browser without WebAssembly. A GPU solves SHA-256 cheaply, so these have their own share, apart from new-cookies-per-day; 0 takes none
fanout-hard-window-msint1000Maximum time to wait for engine responses
fanout-idle-timeout-msint500Stop waiting if no new results arrive within this window
cache-ttl-web-sint1800Cache TTL for web results (seconds)
cache-ttl-images-sint7200Cache TTL for image results
cache-ttl-news-sint300Cache TTL for news results
cache-max-mbint0Delete the oldest cached searches once the cache passes this many MB. 0 never deletes: an old search is only no longer used. Set it if your disk is small (a cached search is about 0.4 MB): the cache shares one database file with bookmarks and history, so a full disk stops those saving too, not only caching.
cache-max-rowsint0The same by number of searches; 0 never deletes.
page-facts-disk-sint31536000The longest anything the server learned about a result page (its text, dates, profile, merge, indicator and comparison answers) is kept on disk, where it outlasts a restart, so a page seen before answers at once after a deploy. Each is kept for the page’s own shelf life, which Jev picks from a minute to a year, and never longer than this; in memory, a day at most (0 = the default)
page-facts-disk-mbint1024What those answers, the pages’ text and profiles and the merge and indicator verdicts may take on disk together; past it the oldest go, to be fetched again when needed. 0 never deletes. A year of one small server’s pages was about 220 MB. Cached searches and history are not in it
site-facts-keep-sint2592000How long a site’s TLS version, Encrypted Client Hello and domain age are kept. Any connection the server makes to the site (reading a page for the AI, the page checks, the reader) renews its TLS facts without another connection (0 = the default)
prefetch-thresholdint2Minimum access count before a cache entry is eligible for background prefetch
prefetch-before-expiry-sint60Prefetch entries within this many seconds of expiry
nsfw-landingboolfalseShow NSFW banners on the landing page
kv-retention-daysint90Server-side per-person rows (profiles, boards) untouched this long are deleted (0 = the default). Swept a minute after start and every 6 h
rate-limit-groupblocknoneHosts that share an upstream’s rate limit: rate-limit-group "name" { host "example.com" … }. A 429 from one of them, or from a subdomain, pauses them all until it passes, as the built-in wikimedia group does for every Wikimedia site. Add only hosts you have seen share a limit: a wrong group pauses an engine that works. A group with no name or no host, a host that is not a hostname, a host in two groups or under Wikimedia, a name used twice or wikimedia stops the boot
disabled-enginesstring“”Comma-separated engine ids this instance never asks: the ones its network cannot reach or that block its address. engines.kdl stays shared; this is the instance’s own list
chat-urlstring“”Where “ask a follow-up” on an instant-answer card leads, e.g. https://chat.example.org/?q={q}; {q} takes the question and the answer (a template without it gets q= appended). Unset: no link
chat-labelstring“ask a follow-up”The link’s wording
map-tilesstring, with attribution and attribution-urlOpenStreetMap’sThe tile server for the map card and the “where am i” map: an http or https template with {z}, {x} and {y}, once each ({s} is filled as a), serving PNG tiles; for example map-tiles "http://127.0.0.1:8080/tile/{z}/{x}/{y}.png" attribution="© OpenStreetMap contributors" attribution-url="https://www.openstreetmap.org/copyright". attribution and attribution-url are the credit shown on every map, OpenStreetMap’s when left out. The tiles come through this server’s image proxy, which pages ask by tile number only, and are kept on disk at least a week, as OpenStreetMap’s are: a visitor’s browser never sees the tile server’s address, or a key in it, and never contacts it. A redirect from the tile server is not followed. A server on your own machine or network works. A template the server can’t use stops it at startup
geocoderstring“”Your own Nominatim’s address (http or https, no query; not the public one), e.g. http://127.0.0.1:8088 or https://example.org/nominatim. Asked first for every place a card looks up, without the one-request-a-second pacing the public Nominatim gets. When it doesn’t answer, knows no such place or finds only a weak match, Open-Meteo and the public Nominatim are asked as without it. Unset: Open-Meteo, then the public Nominatim. An address the server can’t use stops it at startup
research-context-idle-daysint30An agent-made research context untouched this long is forgotten (capped at 365). A person’s own context is forgotten after a year
data-dirstring“../data”Path to the data directory (config files, DB, banners, captcha assets), relative to the working directory (go-server/)
db-pathstring“../data/4got.db”Path to the SQLite database
peersstring[][]Legacy peer URLs (prefer peers.kdl instead)
peer-secretstring“”Shared secret for peer authentication
engine-break-alertsboolfalseWhen an engine keeps failing, ask friend instances whether it works for them and send a notification (ntfy, webhook, event log). The old name self-heal-enabled is still read
notify-ntfy-urlstring“”An ntfy topic URL for operator events (an engine that keeps failing, a consensus check, a report from the failure page, a feedback note by its length and file, a site marked as having friction), besides events.jsonl in the cache dir
notify-webhook-urlstring“”A URL POSTed each operator event as JSON (type, engine, message, timestamp, severity)
quotes-modestring“all”Landing page quote visibility: “all”, “deluxe”, “off”
planner-waitboolfalsePlan searches (planner_live.go): make a search wait for the planner’s decision, up to 1.5 s, and skip the search as typed when the plan says those words are not a useful search, so only the planned searches go to the engines (if none of them brings anything back in time, the words as typed go out after all, and a page without them says so with a “search as typed” link). Off is preemptive searching (Alex’s name for it): the search as typed goes at once, beside the planner. Also a switch on /admin, “Preemptive searching”
caption-max-bytesint2097152Describe images (image_captions.go): the most of a thumbnail read to describe it, in bytes; a larger one is skipped, as no thumbnail. Kept between 65536 (64 KB) and 8388608 (8 MB): up to 24 are read at once
jev-fallbackbooltrueWhen Jev (the TypeSafe classifier) fails on the server’s key, from an error, a timeout, no credit or a rate limit, the research AI’s model in ai-research.kdl is asked instead, and answers in Jev’s shape: which instant answer fits a search, quick yes/no answers, result indicators (each page read whole, in one call) and Rank by my algorithm’s first ten. A yes or no it gives is shown only at 98% sure, a score at 60%, and each says who answered on hover (“via DeepSeek V4.1 Flash”); its answers are kept an hour, in memory. For these three, a single timeout is slow, not down: only an error answer (no credit, a refused key, a 5xx), no connection, or routing’s pause after repeated failures sends them to the model, and a page whose own time ran out asks none. Images, videos and maps in All, the ranking’s comparison and the rest wait for Jev, as before. A person’s own Jev key failing gets no stand-in, and nobody with No Jev or “Use no outside services” gets one. Its calls are their own row, jev_fallback, under Paid providers on /admin, and stop for the day at 20,000 (UTC), as the server-key stops do. Also a switch on /admin
api-keysblock{}Third-party API keys (stackexchange, wolframalpha, deepl, freesound, spotify-client-id, spotify-client-secret). stackexchange is a free Stack Apps key: every StackExchange request carries it, for 10,000 requests a day instead of 300 (engine-spec.md, Host budgets)
allow-cookielessboolfalseA visitor without a cookie may search with no IQ test, after the proof of work cookieless-pow-difficulty sets; over Tor (from an exit, or to onion-address through the Tor daemon on the server), with none (the public tier)
cookieless-pow-difficultyintpow-difficulty + 1The proof of work a search without a cookie pays on an allow-cookieless server, raised under load as pow-difficulty is; each bit doubles the wait. 0 asks none
captcha-messagestring“”The IQ test page’s intro words; empty = “This test is good for a month.”
version-labelstring“”Text beside the version on the home page, e.g. “pre-beta”; empty shows none. Its old name, beta-label, is still read
default-onstring list“”Features on for every visitor, not only the owner (setting names, comma-separated, e.g. ai_rerank, merge, crawl, tls_badges; rewrite_defaults fills everyone’s hostname rewrites with the server’s suggestions); a person’s own choice still wins
banners-enabledstring listthe two chosen 2026-09-21Bundled banners in the home page’s rotation (file names, comma-separated); personal and uploaded banners are not gated
onion-addressstring“”This instance’s .onion address, sent as Onion-Location
server-biostring“”One line about this server that /ami4got gives other 4got servers, shown beside its name on their Instances pages (at most 280 characters; empty: “4got metasearch engine”)
open-to-connectingboolfalse/ami4got says this server welcomes new friends; their Instances pages mark it “open to connecting”
cache-dirstringdata-dirRuntime state that cycles: the database, tracker lists, the ToS;DR cache, events.jsonl
cache-opt-out-groupsstring“all”Who may bypass the shared cache entirely: “all”, “none”, or group labels (space- or comma-separated)
memory-limit-mbint0The runtime’s soft memory limit; 0 = half the machine’s memory (never under 128)
log-engine-timingsboolfalseLog one “Engine X: +Nms” line per engine per search (at ~145 engines a search, most of the log)
disable-wtmboolfalseLoad no WhoTracks.me lists
api-quotasstring“”Limits for keyed APIs, over the registry’s stated ones: "serpapi_google=250/month, typesafe=20000/month"
proxy-audioboolfalsePlay audio results through this server, for the owner and groups with the proxy_audio permission; it is Settings’ Full (default-audio-play); off, everyone’s audio is Redirect and /proxy/audio answers 404
token-counter-publicboolfalseOffer the token counter (/tools/tokens) to everyone; off, to the owner alone. It needs tok’s browser build (make tok-web, which make deploy runs and ships as static/tok/) and is not offered without it
tok-web-dirstringstatic/tokWhere tok’s browser build is served from as /static/tok/; a local server names ~/.cache/4got/tok-web
kv-max-bytes-per-cookieint262144Server-side storage per person (profiles, boards, research contexts), in bytes
locked-syncbooltrueKeep the ciphertext of “Sync my locked history” for people who turn it on; false keeps none
locked-sync-mbint20That ciphertext’s allowance per sync id, in MB
qablockoffQuestions and answers (/questions): qa { require "deluxe"; open-max 200; answers-max 50 }. require names who may ask and answer, a group or all (a key carrying that name may too, over MCP); unset or off, no one, and the pages say this server takes no questions. Reading needs nothing
open-maxint200In the qa block: the open questions this server holds at once, held ones counted; past it, a new question is refused until one closes
answers-maxint50In the qa block: the answers one question takes
report-hideint3In the qa block: the people whose reports take a published question or answer off the pages, into the owner’s Held queue
prefetch-depth-apiint or “inf”“inf”Pages fetched ahead for keyless JSON engines; “inf” is every page (to page 100). Keyed engines are never fetched ahead
prefetch-depth-assetsint3Pages fetched ahead for image, video and music searches
prefetch-depth-scrapedint1Pages fetched ahead for scraped engines (1 = none ahead)
deferred-scheduled-defaultint3Pending scheduled searches per person in no group
deferred-standing-defaultint0Standing searches per person in no group (0 = none)
deferred-standing-totalint100Active standing searches on the whole server
deferred-min-refresh-minint30Fewest minutes between two runs of one standing search
admission-enforceboolfalseAdmission control acts (sheds load); false = it computes and logs only
admission-bandwidth-pctfloat80The share of the monthly traffic cap that admission control counts as full
admission-manual-shedfloat0The operator’s floor for shedding load (0 to 1 and over); 0 = off
traffic-cap-gbint0The provider’s monthly traffic cap in GB; 0 = traffic is counted, with no guardrails
traffic-ifacestring“”The network interface metered (“” = every one but loopback)
traffic-reset-dayint1The day of the month the provider’s cap resets
traffic-reset-hhmmstring“00:00”The time of day it resets, UTC
traffic-low-gb-per-dayfloat10Below this many GB a day left until the reset, heavy endpoints are throttled
traffic-critical-gb-per-dayfloat3Below this many, heavy endpoints answer 503
traffic-throttle-kbpsint128Heavy endpoints’ bandwidth while throttled, in KB/s
traffic-user-retention-daysint0Per-cookie traffic rows: 0 = not stored, -1 = kept forever, N = kept N days
speech-urlstring“”An OpenAI-compatible /v1/audio/transcriptions endpoint you run, for the microphone; unset = no microphone
speech-keystring“”Its bearer token (never sent to the page)
speech-modelstring“whisper-1”The model name sent to it
speech-seconds-per-dayint1800The seconds of audio one person may send it a day, counted as sent (dictation sends the recording so far every 2.5 s); past them it is refused until midnight UTC. 0 = no limit; the owner has none

Environment variable overrides

Every config.kdl field has a corresponding FGOT_* environment variable:

  • FGOT_PORT, FGOT_HOST, FGOT_OWNER_SECRET, FGOT_DELUXE_SECRET
  • FGOT_POW_DIFFICULTY, FGOT_CAPTCHA_HOURS, FGOT_POW_SECONDS
  • FGOT_MAX_SEARCHES, FGOT_FANOUT_HARD_WINDOW_MS, FGOT_FANOUT_IDLE_TIMEOUT_MS
  • FGOT_CACHE_WEB_S, FGOT_CACHE_IMAGES_S, FGOT_CACHE_NEWS_S
  • FGOT_DATA_DIR, FGOT_DB_PATH
  • FGOT_DEFAULT_LANGUAGES (en,es), which a server with no config.kdl needs
  • FGOT_CONFIG: the config file to read, instead of looking for one

KDL config files

4got uses KDL (KDL Document Language) for structured subsystem configs. Each subsystem looks for its config in two places:

  1. A dedicated file (e.g. data/peers.kdl)
  2. A named section inside any *.kdl file in data/ (e.g. a peers { ... } block inside data/conf.kdl)

You can use either approach but not both for the same subsystem. This lets you keep everything in a single conf.kdl or split into per-subsystem files.

peers.kdl

Configures the friend/peer network for cache sharing and service proxying.

// Services this instance allows friends to proxy through us
allow-proxy "translation" "wolfram" "autocomplete"

// Prefer a friend for specific services (for groups with friend_proxy)
// prefer-friend "alice" for="translation,wolfram"

// Searches each relay friend may ask us to run in an hour (default 60)
// relay-per-hour 60

// Keep a friend's cached copy in our cache when it answers a search (default true)
keep-friend-copies true

peer "instance-b" {
    url "http://127.0.0.1:8890"
    // Optional mTLS:
    // cert "/path/to/client.crt"
    // key "/path/to/client.key"
    // Optional: how far this friend's cached copies count
    // trust "preview"
    // Optional: run searches for each other (off by default)
    // relay true
}

trust is "full" (the default when the line is absent) or "preview". With full, a copy from this friend’s cache is our cache hit: it is shown, kept in our cache with the friend’s age, and no engine runs. With preview, the copy is shown at once, labelled “on a friend”, and our engines search behind it to refresh our own cache, as for a stale entry; the friend’s copy is never kept as ours. That refresh passes the admission gate (a shedding server serves the preview and searches nothing), and at most one starts per search a minute. Any other value stops the server at startup, naming the line; on a hot reload (SIGUSR1) the file is refused. Even a valid reload does not change the friend list or their trust: those take effect on restart (a reload applies only the proxy permissions). A person’s own cache rules (“Never older than”, “Only if it has results from”) judge a friend’s copy first, so the stricter of the two always wins.

keep-friend-copies (default true) keeps a full friend’s copy in our cache with its age once it has answered a search here, so the next search for it needs no friend; false shows the copy and keeps nothing. Any other value stops the server like a bad trust; it is applied on a reload. The results line names the friend: “(cached 4 minutes ago on alice)”.

relay true (default false; any other value stops the server like a bad trust) lets this friend and this server run searches for each other through POST /api/v1/relay (federation.md). This server runs that friend’s searches only if its pubkey is listed too, since a relay ask is known by its signature, and at most relay-per-hour of them an hour (default 60; 0 refuses every one). The owner’s AI research may send searches to it in turn, which also needs its pubkey: each ask is addressed to that key. Like trust, relay takes effect on restart; relay-per-hour is applied on a reload.

groups.kdl

Defines user tiers/groups and their permissions.

group "deluxe" {
    allow "server_api_keys" "friend_proxy" "priority_fanout"
    label "deluxe"
}

group "researcher" {
    allow "server_api_keys"
    label "researcher"
}

Known permissions: server_api_keys, friend_proxy, priority_fanout, agent_contexts, no_captcha, peer_cache. Groups are assigned to users by identity via the admin panel (/admin/users).

A group named anywhere that groups.kdl does not define stops the server at startup and fails --check-config, naming the file, the key, the name and the groups there are; the owner’s editor refuses to save it. Groups are named in oracle-permissions.kdl, ai-research.kdl’s require keys, image-proxy.kdl’s require, discovery.kdl’s groups=, and config.kdl’s safesearch-floor-groups and cache-opt-out-groups. A name may be a group, its label, or a permission a group allows; all, none, off and owner are the files’ own words.

agent_contexts lets the group’s agents keep research contexts on this server through the API and MCP (context=); without it they search without one. The owner always has it, and deluxe as shipped. Listing and forgetting your own contexts are never gated.

no_captcha (or no_pow): the group’s people are never asked for the IQ test or a proof of work. A session of theirs that has ended is renewed on their next visit, with the same identity (while the browser keeps its cookie, 30 days past the session), and captcha-bypass-searches does not count their searches. Someone removed from the group keeps the session already issued until it ends (captcha-bypass-hours).

peer_cache lets the group’s people ask this server’s cache as a friend does (GET /api/v1/cache), on a server with a peer-secret; without one it answers anyone. A friend server needs no group: it is known by the peer secret.

friend_proxy lets someone use what a friend lends (prefer-friend: translation, Wolfram|Alpha). The owner always has it, and so does any group that allows it (deluxe and translator as shipped). Anyone else’s text goes to this server’s own backends, never to the friend.

storage-mb N is what one person in the group may keep on this server, all kinds together: their server history, bookmarks with folders and likes, settings and research contexts, pastes with their files, and scheduled searches (-1 no ceiling). A group without it takes the default group’s; with none anywhere there is no ceiling, and the owner never has one. Past it, new history, bookmarks, likes and pastes are not kept, the bookmark and the ♡ say “your space here is full”, and Settings › Your data shows how much is kept, by kind, and the ceiling. user_kv also keeps its own per-person cap (kv-max-bytes-per-cookie); a synced locked history has locked-sync-mb.

max-searches-per-day N is the searches a day each person in the group may make through the API and MCP, in place of config.kdl’s max-searches-per-day (0 no limit). It holds too for an API key that names the group: tick the group when making the key at /admin/users, or on the key’s row there (Set groups), which changes an existing key’s groups without reissuing it. A key in two groups takes the more generous limit, no limit beating any number. A key’s count is shared by everything that uses it, and the key’s own searches a day on /agents holds beside it, the fewer of the two binding. A group without it takes the default group’s, else the server’s; the owner has none. A value that is not a whole number of 0 or more stops the server at startup and fails --check-config.

server_api_keys is what lets someone use the keys in api-keys. The owner always has it. An engine that needs a key runs on the server’s key only for these groups; anyone else’s search asks it with their own key or skips it. The Places card’s Foursquare and HERE keys work the same way, and anyone else gets OpenStreetMap’s places. A scheduled or standing search keeps the coverage of whoever made it.

key-limit "gnews" "10/day" is what one person in the group may spend of the server’s key for that id (/min, /hour, /day or /month; "inf" for no limit), on the keyed search engines, the news and stock cards (also in the research agent’s tools), scheduled searches and the image search (Google Vision and SauceNAO; a person the server’s keys do not cover draws it only with the IQ test’s session). Each use made for them is taken from their share and counted under their identity, per day for this month, beside their own keys’ counts; past their share the server’s key is not theirs until the window turns, and someone with no session gets none. Their own key, when they have one, comes first and spends no share. Delete my server data keeps a share’s current window. A group without a line for a key takes the default group’s; the owner has no limit. total="60/day" beside the limit is what everyone the line holds for may spend together, counted under the group’s name and no person’s: the shipped default group takes at most two thirds of the Google Vision and SauceNAO stops, so the owner and the groups with server_api_keys (which say "inf", the stops alone) keep a third. A scheduled search takes the group the server has its maker in (user_groups), else the default group’s. Settings › API keys shows it as gnews 1/10 today (34/100 shared), and a results page whose engine or card was refused says “Your share of GNews is used; it resets at midnight UTC.” A key-limit on a key nothing spends per person is a warning at start and in --check-config.

captcha.kdl

Configures the pre-rendered captcha (IQ test) pool.

pool {
    distorted-target 500     // target pool size for distorted tiles
    distorted-batch 50       // generate this many per cycle
    prebuilt-target 100      // target pool size for assembled captchas
    prebuilt-batch 20        // assemble this many per cycle
    cycle-count 25           // number of generation cycles at startup
    cycle-interval-min 5     // minutes between background replenishment cycles
}

autocomplete.kdl

Configures autocomplete suggestion backends and their weights.

backend "duckduckgo" weight=1 enabled=true
backend "brave" weight=1 enabled=true
backend "qwant" weight=1 enabled=true
backend "yahoo" weight=1 enabled=true
backend "wikipedia" weight=1 enabled=true
backend "google" weight=1 enabled=false
backend "bing" weight=1 enabled=false
// … and swisscows, mwmbl, yandex, privacywall, seznam, baidu, naver, quark,
// 360search, sogou, dbpedia, all off in the shipped file

Higher weight = more influence when merging suggestions from multiple backends. Only the backends the file names are asked; one it names with enabled=false is not. Every backend on the list gets what people type into the search box, so turn on only those you would send it to.

translation.kdl

Configures translation backends with priority routing and per-user rate limits. A limit applies only to someone translating on the server’s key whom the server doesn’t cover: not with their own DeepL, Papago or Microsoft key, and not for the owner or a group with server_api_keys. Settings shows each person their count under that key in API keys, and the translation card shows it at its foot. Lingva and NLLB are asked only where the operator names an instance (lingva_url, nllb_url among the API keys): the public Lingva instances no longer translate.

// Language sets (non-overlapping)
set "cjk" "ja" "zh" "ko"
set "eu" "de" "fr" "nl" "pl" "es" "pt" "it" "ro" "sv" "da" "no" "fi" "cs" "hu" "el"

// Backends: priority (higher=tried first), languages ("all" or set name),
// limit-per-cookie, reset hours
backend "llm" priority=4 languages="all" limit=0
backend "deepl" priority=3 languages="eu" limit=500 reset-hours=24
backend "papago" priority=3 languages="cjk" limit=50 reset-hours=24
backend "lingva" priority=2 languages="all" limit=100 reset-hours=24
backend "nllb" priority=1 languages="all" limit=0
backend "microsoft" priority=2 languages="all" limit=30 reset-hours=24

instances.kdl

Configures the instance browser (shows other 4got instances).

fetch-interval-min 60

friends {
    // instance "https://search.friend.example.com"
}

public {
    // instance "https://public.4got.example.com"
    // url "https://git.example.com/4got/instances/raw/branch/main/instances.txt"
}

A url in public names a public list of instances, read every fetch-interval-min: one address a line (# starts a comment), or a server’s own /ami4got or /ami4get answer, whose instances it lists (url "https://4get.ca/ami4get" brings 4get’s public instances). What a list names is asked only at public addresses, as friends-of-friends are, up to 200 in all. A server that answers /ami4get as 4get does shows with a 4get tag; the failure page never offers it, since 4get’s searches are at other addresses.

ai-research.kdl

Configures the AI research agent that synthesizes search results.

enabled true
mode "lua"                    // "lua" (sandboxed) or "off" — no "bash" mode exists
provider "cerebras"
model "llama3.1-8b"
api-key "csk-..."
base-url "https://api.cerebras.ai/v1"
max-runtime-seconds 360       // six minutes a job
lua-timeout-seconds 180       // three minutes a Lua run
max-tool-iterations 20        // required while enabled: the server won't start without it
require "deluxe"              // group permission required
instructions-require "deluxe" // who may give the AI their own instructions (default: deluxe, whatever require says)
overview-require "all"        // who gets the AI overview above All's results: "all" (default), "off", or a group
vision-require "deluxe"       // whose attached images the vision model reads: a group (default deluxe), "all", "owner" or "off"

See ai-research.md for full details.

image-proxy.kdl (optional)

Configures the SQLite-backed image proxy cache. With no section it is on, with these values, for the require group; enabled false turns it off. A picture is served first as fetched and re-encoded afterwards, one at a time, behind every search (JPEG losslessly, PNG at distance 1, nothing over 1 MB); the rest wait their turn.

enabled true
hold-time-days 30             // evict images unserved for this many days
jxl-reencode true             // reencode to JXL (requires cjxl binary)
redownload-threshold 999      // re-fetch original after N serves
require "deluxe"              // group permission required ("" for everyone)

door.kdl (optional)

Lets the people a friend’s 4got vouches for into a web service of yours, with a cap per friend; see Doors. A line that cannot mean anything stops the start; a reload puts a change in effect.

name "Glen's films"   // what a refused person reads
friend "alice" key="<alice's 4got key, from her /door page>" people=10 url="https://search.alice.example"

engines.kdl budgets

engine-budget "duckduckgo" per-minute=2 per-hour=20 per-day=120

An engine-budget line is the most one engine (a Go engine’s id or an engine block’s) is sent a minute, an hour and a day: its ceiling. Under it the server learns an allowance: a refusal (a captcha, a 429, 403 or 400, or answers gone empty after rows) halves the minute’s and the hour’s, never below one, and each 30 minutes without one, once the suspension it began ends, wins a tenth of the ceiling back. An engine with no line has 30 a minute and 1,000 a day. The allowance, the backoff and the hour’s and day’s counts outlive a restart. All three numbers are required, each above 0 and no more than the next; a wrong number, an engine named twice or a name that is no engine stops the boot and fails --check-config. The shipped file names DuckDuckGo, Brave, Startpage, Yahoo, Swisscows, PrivacyWall, Karmasearch and mwmbl, from measurements made from a server. /admin/health shows what each engine answered this hour and in the last 24 hours, with its allowance beside its ceiling; the counts are kept 30 days, with no query, key or address. Budgets shared by several engines on one host are host-budget lines (the engine spec).

The unified conf.kdl option

Instead of separate files, you can put everything in a single data/conf.kdl:

peers {
    peer "instance-b" {
        url "http://127.0.0.1:8890"
    }
}

groups {
    group "deluxe" {
        allow "server_api_keys"
        label "deluxe"
    }
}

translation {
    backend "lingva" priority=2 languages="all" limit=100 reset-hours=24
}

The resolver scans all *.kdl files for matching section blocks. It is an error to have both peers.kdl and a peers { ... } section in another file.

Users can customize their experience via cookies set on the /settings page:

CookieValuesDescription
safesearch0 (default), 1, 2Safe search: 0 none, 1 moderate, 2 strict
temp_unitC (default), F, KTemperature unit for the weather card
distance_unitkm (default), miDistance unit for the distance card, and wind speed on the weather card
home_locationa place name, URL-escapedWhere weather and distances start (“Detroit, MI”)
regionDuckDuckGo’s region code (us-en, de-de), blank for allThe region engines are asked for, each in its own form (go-server/regions.tsv)
badgesfirst (default), always, multiple, neverEngine badge display mode: first shows the best-placed engine and folds the rest behind “+N”
hard_windowinteger msMaximum time to wait for engine responses (default 1000)
idle_timeoutinteger msStop waiting if no new results in this window (default 500)
cache_max_ageinteger minutesOldest cached copy a search will use (default 43200 = 30 days; 0 = always fresh)
cache_needscomma-separated engine IDsA cached copy (ours or a friend’s) counts only if it has rows from every one of these engines; otherwise the search runs again. Unknown IDs are dropped. Blank (default) = any copy
priority_engineengine ID or “none”Engine that must respond before results are shown
disabled_web, disabled_images, etc.comma-separated engine IDsDisable specific engines per category
weight_<engine>integer >= 1Override engine weight in result ranking
rewrite_<service>hostnames (comma-separated), “off”, “none”, “disabled”The site’s frontends; unset is the owner’s suggestions for the owner (or everyone, with default-on "rewrite_defaults") and none for anyone else
rewrite_<service>_place“replace”, “replace_only”The title opens the first frontend, with or without “ originally”; unset is beside the result’s own link
rewrite_archive“off”Leave the frontends out of the archive ▾
rewrite_muted“on”Draw a frontend’s link beside a result in the muted colour
known_languagescomma-separated ISO 639-1 codesLanguages the user knows (for auto-translation, a dictionary card in one of them for a single word English lacks, and the first for Wikipedia, its card and its sister wikis)
apikey_wolframalphaAPI key stringPersonal Wolfram Alpha API key
history_enabled“1”Older name of server_history; still read, and any Settings save clears it
autocomplete“off” to disableEnable autocomplete suggestions
bookmark_modelink (default), domain, offBookmark flag on each result: the exact link, the site, or none
audio_playfull, redirectHow audio plays: full through this server (only for those who may have it), redirect from its own site; unset is config.kdl’s default-audio-play
page_audioon, offPlay buttons for other sites’ audio (Jev); on for the owner, off for others until they turn it on
home_buttonright (default), leftWhere Home sits in the top bar, on every page; the default is config.kdl’s default-home-button
new_tabonLinks in the results that leave 4got open in a new tab (off by default)
kbdoffSingle-key shortcuts (j, k, p, …) and the home page’s type-anywhere off (on by default)
archive_linkson, offShow archive links on results
show_scores“1”Show ranking scores next to results
search_methodGET (default), POSTHTTP method for search form
tab_modeskey=always|sometimes|never, comma-separatedEach tab’s switch where it differs from the default; an older hidden_tabs list reads as never
tracker_detection“1”Highlight known tracking domains