Building an ultrafast assistant called Julia

I don't have high expectations for an assistant that runs on my Mac. I want it to handle basic tasks. While Siri keeps improving with every update, I wanted to try building my own.

I currently own an M2 Pro MacBook Pro (16 GB) that my dad bought me in 2023. Speed was my biggest constraint. I didn't expect it to provide ChatGPT-like detailed answers. The questions I'd ask this assistant would be anything but complicated.

Let me take you through this engineering journey.

Searching my Emails

I started by downloading a few Qwen 3.5 models (they come in various sizes). While my Mac has 16 GB of RAM, I didn't want to allocate all of it to run the model, since it would need to share resources with other tasks I was running.

Searching for emails isn't something I usually ask my assistant to do, but it seemed like a good benchmark task for the Qwen model. Siri has a new indexing architecture that makes it particularly effective at these kinds of tasks.

I made a copy of my local mail database and built a harness for the Qwen model running on Ollama. The smaller Qwen models (0.8B) performed poorly, to put it mildly. It would get stuck in loops, make wrong tool calls, or reach the correct result but fail to report it.

The larger models (4B) performed somewhat better, but allocating that much memory just to search emails didn't seem worthwhile. Plus, the larger models also run slower on my Mac.

Handling it in software

I realized I couldn't rely on the LLM to be intelligent at the sizes I was working with, it could only extract intent from raw text and trigger tools. An agentic loop seemed out of reach.

So I started building the harness. I made a list of things I usually do that Siri doesn't handle at the moment. I went as far as creating tools to switch my Mac from WiFi to my iPhone's hotspot. This requires the model to look into Apple's device list database, activate Instant Hotspot by connecting to my phone via Bluetooth, and then switch WiFi to the spawned hotspot.

I was willing to build these complex tools for my specific use cases because I only had to program them once and they'd work indefinitely. Here are some of the tools I built:

  1. Connect to my phone for hotspot
  2. Launch an app
  3. Handle precise music seeking (I like to repeat songs if I miss my favorite part)
  4. Look up contact information (to trigger FaceTime calls)
  5. List my Reminders

Apple Foundation Models

Meanwhile, I was also researching how Apple handled this. Siri seemed fast with simple queries and appeared to load a smaller model initially, then switch to a larger one for more complex tasks. It turned out my hypothesis was correct.

Snazzy Labs has a great video on how Siri works. He also explains how to structure your prompts to get the most out of Siri.

The New Siri Sucks. But It Shouldn’t. — Snazzy Labs
youtube.com
Introducing the Third Generation of Apple’s Foundation Models
machinelearning.apple.com

Finetuning

Even though I was building this new harness, I wanted the overall model to work better on macOS. I thought I could fine-tune my way out of this problem. I started with a small test because I genuinely wasn't sure if it would work.

I asked Codex to spawn sub-agents to generate search trajectories over my exported email database. I had it create examples where it would find the correct email and terminate the search, but also include cases where no data was available, so it would return a failure result.

I started the fine-tuning process on my Mac, but given the iteration times, I moved the workload to GCP with an H100. Training was obviously much faster there.

I started a '/goal' with Codex and went to a friend's place for the evening. It ran for around 4 hours and showed some improvements on the holdout test, though only 13 of my 24 test cases returned positive results. It was late, so I decided to call it a night. Little did I know, everything would change the next day.

TypeSafe

I opened Twitter the next morning and my entire timeline was filled with posts about this new AI company that had released a different kind of model, a decision model. From what I understand, it's a transformer model with a specialized decoder.

I had class that day (I'm currently pursuing my M.S. in CS at USC), so all I could do was sign up for the waitlist and head to class.

Fortunately, I got the invite during class. So I went to their playground to see what the hype was about. I think Typesafe did a great job with their launch marketing, but I don't know how they could have explained what Jev is. You have to experience it to understand it.

A new harness

On my way back to my apartment, I realized most of what I wanted Julia to do could be expressed as boolean operations. Sure, it wouldn't be able to search my emails, but that's not something I ask Siri to do often anyway.

If I could design my harness to submit my machine's state and ask the right questions, I could create an ultrafast assistant. I started with basic music controls: playing, pausing, seeking, etc. I also tried a feature called handoff, which would send requests to an LLM if it couldn't handle them directly.

00:00−02:08
Julia with jev: an early demoOriginal video

(While this video shows the handoff to local LLM feature, it's not currently available in the final release)

Realigning

I created a fresh Xcode project and actually started writing this like a proper software engineer. The main problem with my previous implementation was that Julia would only start collecting macOS state once a request was submitted. I wanted a newer architecture where Julia's subsystems would monitor their respective areas (audio, playback, focus mode, etc.) and keep themselves updated with changes.

I also had to do some workarounds to get focus mode and audio working. macOS doesn't provide developer APIs to make these changes. You can see the code for this in AudioKit and FocusKit. I wanted to keep these separate from the rest of the app because while their public APIs are stable, the implementation might need to change based on macOS updates.

Every day I'd pick a new feature to add, figure out how its macOS APIs work, and create a subsystem for Julia to use. All powered by Jev on the backend. I added a basic onboarding and settings page so you can download and try it yourself.

I think the nicest part of Julia is the assistant overlay it spawns with. It's a private macOS blur that reveals progressively as you hold down the right command key. I had been looking for an excuse to use this for a while.

Advait1306 / Julia
github.com/Advait1306/Julia

I haven't attached a release build because this is a side project that might not be maintained, although I encourage you to build it yourself and give it a shot. Maybe add a couple of features you'd use and send a PR.

Here's a demo of it working:

00:00−02:46
An ultrafast assistant for macOS called JuliaOriginal video