Skip to content

Coordinator setup (one command)#

koordinator-kur.sh turns a Linux server into a working reference coordinator in a few minutes. The coordinator only validates and averages adapters; no GPU is needed, a small server is enough.

Not

Status (alpha). The script is tested automatically on clean GitHub Ubuntu and Arch Linux machines (service-less mode). The systemd service, its hardening and the management commands were tried by hand on a real Ubuntu server. The HTTPS path with Caddy has not yet been tried with a real domain (the generated config is validated with Caddy). If you run into problems, report them on GitHub.

What you need first#

  • A Linux server (Ubuntu, Debian, Arch and other glibc-based distributions; x86_64 or aarch64) with root (sudo) access, at least ~2 GB of memory and ~3 GB of free disk (more as your data grows).
  • A domain name with an A record pointing to the server (for HTTPS) and ports 80 and 443 open.
  • Your training data: plain text files (.txt, .md, .jsonl). The source and licence of the data are your responsibility; Modelen neither provides nor selects data. See Integration options.

Install#

curl -fsSL https://github.com/macbyclp/modelen-tr/releases/latest/download/koordinator-kur.sh -o koordinator-kur.sh
bash koordinator-kur.sh --dene                      # see what it would do first (installs nothing)
sudo bash koordinator-kur.sh --alan-adi coordinator.example.org --veri ./texts/

When it finishes, the coordinator is running, the protocol conformance test has run by itself, and your shared key and the next steps are printed.

OptionMeaning
--alan-adi NAMEDomain for HTTPS; Caddy is installed and the certificate is obtained automatically. Without it only 127.0.0.1 is listened on
--veri PATHA .txt / .md / .jsonl file or folder (tokenised for you) or a ready .safetensors
--tur NTotal rounds (20)
--en-az NResults needed to close a round (2)
--ic-adim NA volunteer's local steps per round (20)
--parca NNumber of data shards (4); each volunteer downloads only one
--port NCoordinator port (8750; local only)
--acikNo key: a publicly open coordinator. Default: a random shared key (closed group)
--hedef DIRInstall folder (default /opt/modelen-koordinator)
--sistemsizRun in the background without systemd and Caddy (testing; no root needed)
--surum TAGA specific release (default: latest)

What gets installed?#

PartDescription
Python 3.12 + PyTorch (CPU)In .venv via uv; your system Python is untouched
Coordinator scriptsFrom the release's modelen-istemci.zip, with SHA-256 verified
Starting adapterGenerated without the model (adaptor_uret.py); no 1.2 GB base-model download
Training dataTokenised by veri_hazirla.py with the base model's tokenizer (only tokenizer files, ~10 MB, are downloaded)
systemd servicemodelen-koordinator.service, run by a dedicated modelen-koordinator user, memory-limited, istemci/ read-only
HTTPSCaddy (with --alan-adi), if 80/443 are free. If the server already has another web server it is not installed; a ready config snippet is printed
modelen-koordinatorManagement command (below)

After install: connecting to the portal#

  1. DNS. Point your domain's A record at the server and open 80 and 443 (Caddy then gets the certificate).
  2. Application. Create an account on modelen.tr, verify your e-mail, and apply via Panel → Application; use https://your-domain as the address. See Becoming a coordinator.
  3. Address verification. The portal gives you a value; publish it with this command, then have the portal check it: ``bash sudo modelen-koordinator dogrulama modelen-dogrulama-AbC123... `` Details: Address verification.
  4. Heartbeat. Create a key under Panel → API keys and start the heartbeat service; your coordinator then shows as "online" in the directory: ``bash sudo modelen-koordinator nabiz mdl_... `` It works even when your coordinator is key-protected (closed). See Heartbeat.
  5. Volunteers. In a closed group you hand the key to volunteers (modelen-koordinator anahtar). To open it to everyone: modelen-koordinator acik.

Management commands#

CommandWhat it does
modelen-koordinator durumService status and a /durum summary
modelen-koordinator anahtarShows the shared key
modelen-koordinator acik / kapatKeyless (open to everyone) / keyed (closed group) mode; the service restarts
modelen-koordinator dogrulama <value>Writes the file for the portal's address verification
modelen-koordinator nabiz <API_KEY>Starts sending heartbeats to the portal (systemd service)
modelen-koordinator uyumRuns the protocol conformance test
modelen-koordinator gunlukRecent logs
modelen-koordinator baslat / durdur / yeniden-baslatService control
modelen-koordinator kaldirRemoves the services (the data folder is kept)

Security notes#

  • The key is not visible in the process list (ps): it lives in an environment file (koordinator.env, readable only by root and the service user).
  • The coordinator listens only on 127.0.0.1; only the HTTPS proxy faces the outside. A per-IP rate limit and a worker-count limit are on (Reference coordinator).
  • Open mode (no key) lets anyone submit results. Poisoning protection is only simple outlier elimination and structural validation; it is not enough against a determined attacker (Security). We recommend starting with a closed group.
  • The content and licence of your training data are your responsibility.

Updating and removing#

  • Update: run the script again with the same options. The existing key, round state and work folder are kept.
  • Remove: sudo modelen-koordinator kaldir, then, if you like, sudo rm -rf /opt/modelen-koordinator.

If the server already runs a web server#

If 80/443 are in use, Caddy is not installed. At the end the script prints a ready snippet. For an existing Caddy:

coordinator.example.org {
    handle /.well-known/modelen-dogrulama.txt {
        root * /opt/modelen-koordinator/dogrulama
        rewrite * /dogrulama.txt
        file_server
    }
    reverse_proxy 127.0.0.1:8750
}

For nginx: location / { proxy_pass http://127.0.0.1:8750; } plus location = /.well-known/modelen-dogrulama.txt { alias /opt/modelen-koordinator/dogrulama/dogrulama.txt; }. If you gave the script --alan-adi, the coordinator starts with --vekil, so the IP limit sees the real client address the proxy forwards (X-Forwarded-For).

Troubleshooting#

SymptomWhat to do
Service does not startsudo modelen-koordinator gunluk
HATA: port 8750 in useGive another port with --port
No certificateIs the A record right, are 80 and 443 reachable from outside? DNS propagation can take a few minutes
veri hazırlanamadı (data preparation failed)Check the --veri path and extensions (.txt, .md, .jsonl); make sure the server can reach Hugging Face (for the tokenizer)
Volunteers get 401The group is closed: give them the key or run modelen-koordinator acik

By hand (without the script)#

If you prefer not to use the script you can set everything up yourself: see Reference coordinator and Write your own coordinator.