← All courses

EDGE FDE

Advanced

LLM Writing-Style LoRA to Core AI

A practical skill for running a personalized model on a phone, not in the cloud. Clean your private writing. Train a LoRA on a Mac. Bake it into a small instruct LLM. Export a portable .aimodel plus tokenizer. Then chat on the device. The writing style is stored in the model file on the phone.

This course is for you if you can run Python on a Mac and ship a small Xcode 27 chat screen. Pair it with Diffusion LoRA to Core AI on device. The same method, for text instead of images.

The real path

Core AI has no documented hot-swap LoRA. Do not build a runtime that attaches a new writing adapter on the device. Train the LoRA on a Mac with MPS, or with CPU if MPS is missing. Merge it into the base. Export with coreai.llm.export, or with torch.export plus coreai-torch. Ship the on-device .aimodel and its tokenizer sidecar.

Lessons

  1. What a writing-style LoRA means
  2. Prepare your writing data
  3. Pick a base LLM
  4. Train a LoRA on a Mac
  5. Merge and export to Core AI
  6. Build on-device chat
  7. Evaluate the writing style
  8. End-to-end checklist

Key concepts

Takeaways

Agent briefs

FAQ

Does the phone run a live writing-style adapter?

No. The device runs a baked copy of a small instruct model. There is no documented runtime adapter you swap in later.

What should the writing LoRA learn?

Style is rhythm, directness, word choice, and answer shape. It is not facts. Strip secrets, tokens, and third-party private detail before training.

How do I pick the base LLM?

Choose a catalog instruct preset that has a Core AI export recipe. Confirm with coreai.llm.export --list-models and --dry-run. macOS and iOS presets differ in compression and context.

How is the writing model exported?

Merge with merge_and_unload() into a new directory and keep the adapter. Export with coreai.llm.export and --platform iOS or macOS, or with torch.export plus coreai-torch. Bundle the .aimodel with the tokenizer sidecar.

What do I evaluate for writing style?

Judge the baked model, not the adapter. Read Mac merged replies and device chat for the same review prompts. Buckets are voice drift, secret leakage, refusal, and formatting.

Related courses

Official references

apple/coreai-models · coreai-torch docs · Apple Core AI