Documentation Index
Fetch the complete documentation index at: https://docs.arkor.ai/llms.txt
Use this file to discover all available pages before exploring further.
Project structure
A scaffolded Arkor project looks like this:.arkor/ (per-project, in the repo) and ~/.arkor/ (per-user, in your home directory).
src/arkor/
Arkor discovers your project by looking for src/arkor/index.ts. That file should expose the result of createArkor(). The CLI accepts three export shapes (in priority order):
export const arkor = createArkor({ trainer })(preferred, what the templates produce).export const trainer = createTrainer({ ... })as a power-user shortcut when you do not need the umbrella.- A default export holding either an
Arkormanifest or aTrainer.
index.ts stays thin:
index.ts needs to be at the canonical path.
To register additional trainers in the future, drop more files and pass them through createArkor. Today the API accepts a single trainer; deploy and eval slots are reserved on the type but not yet implemented.
arkor.config.ts
pnpm create arkor generates a default arkor.config.ts:
Trainer itself (maxSteps, learningRate, lora, etc.) so you control them per-trainer rather than at the project level. Leave the file alone unless you have a reason to delete it.
.arkor/ (per-project, gitignored)
You should not commit this directory.
.arkor/state.json. Project routing:orgSlug,projectSlug,projectId. This is how the runtime maps your local repo to a workspace on the managed backend. The file is created byensureProjectState(), which is called the first time you run training (or hit base-model inference) on the project. For anonymous workspaces it is auto-created on that first call. For Auth0 users the runtime errors out and asks you to runarkor initfirst. Do not edit by hand..arkor/build/index.mjs. Output ofarkor build: an esbuild bundle ofsrc/arkor/index.tstargeting Node 22.6 with bare specifiers kept external.arkor startruns this.
~/.arkor/ (per-user)
Lives in your home directory, shared across all Arkor projects on the machine.
~/.arkor/credentials.json. Auth state. Either an Auth0 token (afterarkor login) or an anonymous token (created on first use if you never logged in). The file is tagged with amodefield of"auth0"or"anon"so the CLI knows which path you are on.arkor loginwrites only this file; it does not create.arkor/state.json.~/.arkor/studio-token(transient). A per-launch CSRF token written byarkor dev(mode0600). Used by Studio to authorize calls back into the CLI’s local server. Rotated on everyarkor devrun.
arkor logout deletes credentials.json. The studio token is removed on process exit on a best-effort basis (it may linger if arkor dev crashes) and is rotated on the next launch.
What the CLI looks for
arkor devstarts the Studio web server at127.0.0.1:4000and writes~/.arkor/studio-token. It does not file-watchsrc/arkor/. Studio’s/api/manifestendpoint does callrunBuildand re-import with a cache-bust query, but only when the UI fetches it, which currently happens when the Run training page mounts (seepackages/studio-app/src/components/RunTraining.tsx). If you stay on that page across multiple runs, the build artifact is reused. To pick up edits between runs, refresh the Run training page (or runarkor buildfrom the terminal) before the next click.arkor devdoes not write.arkor/state.jsonon its own.arkor buildreadssrc/arkor/index.ts(or the entry you pass) and writes.arkor/build/index.mjs. You only need to call this directly outside the Studio dev loop (e.g. CI, or right beforearkor startfrom a script).arkor startresolves the entry through the runner, rebuilds.arkor/build/index.mjsif it is missing or you passed an explicit entry, and runs it (which callstrainer.start()andtrainer.wait()). Triggering training from Studio internally spawnsarkor start.
.arkor/state.json and ~/.arkor/credentials.json before reaching for support.