KeyType icon indicating copy to clipboard operation
KeyType copied to clipboard

Issue: Speed

Open Fish-Owl opened this issue 6 months ago • 12 comments

At the speed that a normal user can type, almost no suggestions are made.

This seems to be the make-or-break quality of all these similar apps. Other attempts like CoTabby and Ghosty suffer from this issue as well.

I am using an M5 Max MacBook Pro with 128GB of Unified Memory, and basically the highest specs available. Even with that, only the smallest model (Qwen 3.5 0.8B) gives me suggestions in time for me to use them.

I do not know what secret approach CoTypist uses that means I can use Gemma 4 E4B (a 6.2GB model) and still get suggestions faster than I can type (and faster than Qwen 3.5 0.8B in KeyType for that matter), but I know that is going to be the deciding factor for most users.

Fish-Owl avatar May 31 '26 18:05 Fish-Owl

@Fish-Owl

I have the same specs, so you're in luck here!

Reducing latency (without sacrificing accuracy) is definitely one of my top priorities. Via optimization tricks like batched branch decode, I have already cut latency by ~80% compared to base llama.cpp.

That being said, I agree that there's no harm in reducing latency further and that this is a make-or-break quality!

johnbean393 avatar May 31 '26 18:05 johnbean393

@Fish-Owl

Given these specs, I assume you're a developer yourself?

If you could make a PR, that'd be great too!

johnbean393 avatar May 31 '26 18:05 johnbean393

@Fish-Owl

I have come up with a few ideas, and Codex has already implemented some of them. I'm happy to report that perceived latency has improved significantly! Excited to create a new release soon.

Also, I actually recommend LFM2.5-8B-A1B-Base for our specs. You can see more details here

johnbean393 avatar May 31 '26 19:05 johnbean393

speed issue on m4 air 24gb as well though 0.8 also take a while to kick in previously i was using cotypist with qwen 3 4b which worked well overall

salmanuc avatar Jun 01 '26 12:06 salmanuc

Image

New branch promotion cache optimization incoming.

On a side note, I'm really liking gpt-image-2 diagrams illustrations for changes!

johnbean393 avatar Jun 01 '26 17:06 johnbean393

Image

Added a new tab in the app's settings to visualize latency!

Personally, most of my completions are displayed in under 200 milliseconds, or 0.2 seconds, but I can see this being in the range of 400 milliseconds for a M5 MacBook Air.

Feel free to post screenshots for what you observe in this app, or even better, you can export and send me latency data by pressing "Export data...". Try to post your Mac's specs as well.

Image

johnbean393 avatar Jun 02 '26 17:06 johnbean393

Huge latency improvements incoming!

Release 1.4 should cut wait time by 50-70% from release 1.3. In particular, the long tail for completion wait times has been essentially eliminated.

Image Image

johnbean393 avatar Jun 04 '26 20:06 johnbean393

@salmanuc @Fish-Owl

Release 1.4 contains a number of performance improvements.

Could you provide some feedback on your experience with KeyType's latency on version 1.4? Thanks 🙏

johnbean393 avatar Jun 04 '26 21:06 johnbean393

Image keytype 1.3 and 1.4 doesnt work for me, completions do not appear at all in any app

cotypist and cotabby work

sorry for the late reply

salmanuc avatar Jun 04 '26 21:06 salmanuc

@salmanuc

Thanks! If completions never appear in any app, I need to check whether KeyType is reaching the prediction pipeline at all.

Could you try this exact repro?

  1. Quit and reopen KeyType.
  2. Open TextEdit, create a plain text document.
  3. Type with a normal caret at the end of the line, with no selected/highlighted text.
  4. Then attach: ~/Library/Application Support/KeyType/Logs/predictions.log

Also, please send a screenshot of KeyType Settings > Model, especially which model says “Ready”.

If the prediction log only has the header, the issue is likely model/profile setup, permissions, or AX capture. If it has SUPPRESS(...) lines, those lines will tell us which gate is hiding the completion.

Note that the prediction log might include sensitive information, so you might want to check it before sharing.

johnbean393 avatar Jun 05 '26 04:06 johnbean393

predictions.log

the log is empty

Image Image as i was posting this, i ran the setup again and it works now latency also seems good

salmanuc avatar Jun 05 '26 09:06 salmanuc

@salmanuc

Great to hear that KeyType is working now with a good experience latency-wise!

Perhaps some of the permissions were messed up (?). Hard to pinpoint, will look into it. Thanks for the report!

johnbean393 avatar Jun 05 '26 10:06 johnbean393