Track your cycle without renting your body back from a subscription
AI: publik API or your key
Today
Day 3Period: Day 3
Next period estimated in 27 days · ±5
Prices are for one typical use: one request of about 1,500 words sent and 375 words back. A higher quality score is better.
Lunara has no option to run its AI on your computer.
| Model | Quality | Per 1,000 uses |
|---|---|---|
| On your computer (Ollama, 4-bit download size) | ||
| Granite 4.2 3B2.2 GB | 9 | $0 |
| Phi-4 Mini2.5 GB | 6 | $0 |
| Llama 3.1 8B4.9 GB | 7 | $0 |
| gpt-oss 20B14 GB | 9 | $0 |
| Gemma 4 31B20 GB | 19* | $0 |
| Qwen3.5 35B-A3B24 GB | 19* | $0 |
| publik API | ||
| publik-fastGLM-5.3 Flash | 42 | $1.00 |
| publik-balancedMiMo-V2.6-Pro · Lunara | 46 | $10.00 |
| publik-smartGPT-6 Sol | 48 | $18.00 |
Quality: Artificial Analysis Intelligence Index v4.3.2, read 2026-09-22 (publik API models 2026-09-25); * = estimated by Artificial Analysis. Sizes: the Ollama library, read 2026-09-22.
Every step written out. No terminal experience needed. Pick your setup.
⚠️ Unfinished — this is a work in progress. Lunara is not on the App Store or Google Play, and there is no installer to double-click. You build it from this repository and run it on your own phone. Features are landing continuously and things will break. Do not rely on it as your only record of your health data.
An open-source, local-first cycle, fertility, pregnancy, and perimenopause companion.
Lunara ships through native iOS and Android shells powered by Capacitor. Your data stays on this phone unless you turn on AI chat or encrypted backup. There is no Lunara-hosted database of your health data. AI chat is optional. It sends data only after you turn it on (see "AI chat is optional" below), and it sends an anonymized summary, never your name, email or birth date. Encrypted backup sends a copy that the backup server cannot read.
The App Store name and the name inside the app is publik Lunara. The label
under the icon stays Lunara, because a home screen cuts a longer label short
(app/src/lib/appName.ts). The bundle ID, the package and the URL scheme stay
app.lunara.mobile.
Lunara is an open-source cycle tracker that keeps your health data on your own phone. It has no ads, does not sell data, and you can read every line of its code.
app/ — React/Vite product layer plus Capacitor iOS and Android projectsworkers/backup/ — stateless zero-knowledge backup relay (Cloudflare Worker + R2)workers/reminders/ — opt-in generic email reminders (no health terms, ever)docs/NATIVE_ARCHITECTURE.md — current runtime and platform designdocs/FEATURE_PARITY.md — honest implementation and release-readiness mappnpm install
pnpm dev # run the app in a browser
pnpm test # engine unit tests
pnpm --filter @lunara/app native:sync
The cycle engine is covered by a seeded fuzz audit
(app/src/engine/estimateAudit.test.ts) that exercises every user-facing
estimate across 360 generated histories. It must stay at zero violations —
run pnpm test before touching any prediction math.
Lunara works fully without AI, and the companion is never offered under 18. Lunara knows only the birth year, so the companion opens when the current year minus the birth year is 19 or more (an 18-year-old born late in the year waits until January 1). When it is on, answers come from one of three places:
claude setup-token to bill answers to a Claude
subscription.sk-ant-…).A chat goes to one provider only: when you change the provider or its base URL, Lunara AI starts a new chat and sends none of the earlier messages to the new provider.
Choosing publik never touches a key you pasted, and choosing your own key never revokes the publik one. Credentials are stored in the Keychain / Keystore, never in the cycle database and never in a backup. Nothing from your tracker is sent unless you tick the specific categories for that message.
For maintainers — the app token. A build takes the app token from
VITE_PUBLIK_APP_TOKEN (app/.env.native for a local native:sync; the
PUBLIK_APP_TOKEN repo secret in CI, where every workflow fails when the
secret is empty). vite build --mode native fails when the value is not
pat_lunara_ and 32 letters and digits. Without the value, a development or
test build uses PUBLIK_DEV_APP_TOKEN in app/src/lib/publikBuild.ts: a real,
minted token, committed as the fallback. A release never uses it: release.yml
fails without the secret, and an Xcode Release archive refuses a bundle built on
the fallback. The token can only mint rate-limited anonymous installs; it holds
no balance and reads nothing.
Lunara opens with Sign in with publik, before onboarding, the PIN lock and
the tabs. The link opens publik's bare sign-in page in the in-app browser
(Safari view on iPhone, a Custom Tab on Android): the app adds in_app=1 to the
claim_url from publik, and publik shows its in-app page with no site
navigation, footer, prices or plan links. On iPhone the in-app browser closes by
itself when the sign-in is done. While Lunara is in the foreground it checks the sign-in every
3 seconds; it stops in the background and checks again at once when you come
back. Then onboarding asks your age. After that, an adult picks Get a plan,
Connect your plan or Use my own key (a person under 18 never sees this
screen); "Use my own key" keeps the Anthropic / OpenAI paths above exactly as
they were. "Use my own AI key" opens the key entry in Lunara AI at once and
changes no setting until you save a key. You can change the choice later in
Settings → publik.
Purchase links follow the App Store storefront (app/src/lib/storefront.ts).
The iOS app reads the storefront country from StoreKit (appStoreStorefront in
LunaraNativePlugin.swift).
| Storefront | What the app shows |
|---|---|
United States (USA) | Get a plan, the top-up links and the prices, as built. |
| Every other country, or unknown (no StoreKit answer, Android, a browser) | No purchase link, no purchase button, no price. The app says: To get a plan, search for "publik" on Google. |
Connect your plan and Use my own key stay on every storefront. The Android app has no storefront reading, so it shows no purchase links.
Build settings (one environment value each at pnpm build:native time,
src/lib/buildFlags.ts):
| Setting | Values | Effect |
|---|---|---|
PUBLIK_GATE_MODE | required (default), optional | optional: the tracker opens with no sign-in wall. Lunara asks for Sign in with publik (with "Not now") only when you open Lunara AI or tap Settings → publik → Sign in with publik. Usage counting starts only after sign-in. For test builds only: a release build (LUNARA_RELEASE=1) and an Xcode Release archive refuse optional, so the App Store app always has the gate. |
APP_STORE_BUILD | unset (default), 1, 0 | No Claude subscription-token (claude setup-token) option. Unset: on in the iOS app, off on Android and the web. 1: on everywhere. 0: off everywhere; an Xcode Release archive then fails. Anthropic and OpenAI API keys always work. |
PUBLIK_TEST_HOOKS | unset (default), 1 | 1: a test build. The two test hooks below work. A release build (LUNARA_RELEASE=1) refuses it. |
An Xcode Release build runs app/ios/App/scripts/check-release-build.sh: it
fails when the web bundle has the test hooks, offers the Claude
subscription token, uses the dev app token, or has no publik gate
(PUBLIK_GATE_MODE=optional).
The version and the build number come from app/package.json (version,
buildNumber). Android reads that file; iOS keeps the same values and the
display name (APP_DISPLAY_NAME) in app/ios/App/Lunara.xcconfig, and a test
fails when they differ.
app_opened and
active_session, with the app version, the phone OS and a random per-app ID.
No health data, no cycle data, no notes, ever. Sign-out stops it. Turn it off
in Settings → publik → Count my use, or launch with DO_NOT_TRACK=1 /
PUBLIK_TELEMETRY=0.required mode the sign-in
screen comes back at once.PUBLIK_TEST_HOOKS=1 and the native build has it too (Android: ./gradlew assembleDebug -PpublikTestHooks=true, never a release build; iOS: a Debug
build with xcodebuild ... PUBLIK_TEST_HOOKS=YES). The CI test builds have
them; a release has neither. Android reads them only from a launcher start,
never from a link.
PUBLIK_API_BASE_URL points the app at a fake publik on this computer
(127.0.0.1, localhost, or 10.0.2.2 from the Android emulator). iOS
simulator: xcrun simctl launch <device> app.lunara.mobile -PUBLIK_API_BASE_URL http://127.0.0.1:8787/api/v1; Android: adb shell am start -a android.intent.action.MAIN -n app.lunara.mobile/.MainActivity --es PUBLIK_API_BASE_URL http://10.0.2.2:8787/api/v1.PUBLIK_SELF_TEST=1 (iOS simulator: SIMCTL_CHILD_PUBLIK_SELF_TEST=1;
Android: --es PUBLIK_SELF_TEST 1). The app prints publik self-test: ok lunara <version> after a real wallet check and exits. CI runs it in the iOS
simulator and in an Android emulator.PUBLIK_TEST_SIGN_IN=1 (iOS simulator: SIMCTL_CHILD_PUBLIK_TEST_SIGN_IN=1).
The gate taps "Sign in with publik" once by itself, and the app prints
publik sheet: opened, publik sheet: closed by the app and publik sign-in test: passed lunara <version>. CI runs
.github/scripts/ios-sheet-test.sh with a fake publik
(.github/scripts/fake-publik.mjs) that says "claimed" 20 seconds after
the sign-in sheet opened. The test fails when the sheet does not close by
itself within 5 seconds of the claim.https://publikhq.com/in-app/delete-account)
in the in-app browser. Settings → publik → Sign out signs this phone out and
keeps your data. Settings → publik → Help and support opens
https://publikhq.com/in-app/support?app=lunara&app_name=publik+Lunara in
the in-app browser. Under each AI answer, "Report this answer" opens a card
above the message box. You pick a reason, then Lunara opens the same support
page with only the app name and that reason (reason, reason_label). It
sends no chat text and no health data. Settings → publik → publik privacy policy opens
https://publikhq.com/in-app/privacy in the in-app browser. The in-app
browser opens only these in-app pages; the US-storefront "Get a plan" and
top-up links open the normal publik site.app/src/lib/aiPayload.ts (makeAiPayload), makes every AI
request, for publik API and for your own key. It sends no name, email, birth
date, location, device or account ID, and no notes. Days are relative to
today ("cycle day 14", "3 days ago"); no calendar date is sent. So the AI
does not know today's date: it writes [[day:+18]] or [[range:+13..+23]],
and the phone shows your local dates ("Dec 3", "Nov 28 – Dec 8")
(app/src/lib/answerDates.ts). A date that the AI guesses is left out, with
a note. The next period and the fertile window in the summary come from the
same forecast as Today and the Calendar (app/src/lib/sharedForecast.ts). Symptoms,
moods and events go only when they are values from Lunara's own lists. The
publik install key goes in the Authorization header, for billing only. Unit
tests fail when a name, an email, a birth date or a calendar date reaches the
request. "Turn on AI chat" sends. "Not now" closes AI chat and sends nothing.
A new provider, or a newly ticked category, shows the screen again. Sign-out
and Delete account end the agreement with publik. The numbers live in
app/src/lib/aiLimits.ts; a test compares the screen with the request..github/workflows/mobile-test-builds.yml builds a debug
APK (android-debug-apk) and two unsigned arm64 iOS simulator apps, both
App Store builds: ios-sim-app (gate required) and ios-sim-app-optional
(gate optional). Each runs the self-test in a simulator. It never releases.Lunara is not a medical device and does not diagnose, treat, cure, or prevent any condition. Predictions are estimates for informational purposes only and must not be used to prevent pregnancy.
AGPL-3.0 — see LICENSE.