Remix.run Logo
franze 9 hours ago

I created "apfel" https://github.com/Arthur-Ficial/apfel a CLI for the apple on-device local foundation model (Apple intelligence) yeah its super limited with its 4k context window and super common false positives guardrails (just ask it to describe a color) ... bit still ... using it in bash scripts that just work without calling home / out or incurring extra costs feels super powerful.

podlp 2 hours ago | parent | next [-]

Neat! I’ve actually been building with AFM, including training some LoRA adapters to help steer the model. With the right feedback mechanisms and guardrails, you can even use it for code generation! Hopefully I’ll have a few apps and tools out soon using AFM. I think embedded AI is the future, and in the next few years more platforms will come around to AI as a local API call, not an authorized HTTP request. That said, AFM is still incredibly premature and I’m experimenting with newer models that perform much better.

_doctor_love an hour ago | parent | prev | next [-]

Dieser apfel ist sehr lecker!

chid 3 hours ago | parent | prev | next [-]

this is real neat. I'll give it a spin.

AbuAssar 8 hours ago | parent | prev | next [-]

nice project, thanks for sharing.

any plans for providing it through brew for easy installation?

grosswait 4 hours ago | parent | next [-]

Looks like they just added homebrew tap to the instructions

woadwarrior01 6 hours ago | parent | prev | next [-]

There's a very similar afm CLI that can be installed via Homebrew.

https://github.com/scouzi1966/maclocal-api

franze 4 hours ago | parent [-]

done

  brew tap Arthur-Ficial/tap
  brew install Arthur-Ficial/tap/apfel
jedahan 3 hours ago | parent [-]

No need for the extra tap step, this works fine alone:

    brew install Arthur-Ficial/tap/apfel
franze 8 hours ago | parent | prev [-]

good idea

JumpCrisscross 6 hours ago | parent | prev | next [-]

…is it a reference to apfelwein?

franze 5 hours ago | parent | next [-]

just german for apple, cause reasons

JumpCrisscross 5 hours ago | parent [-]

I thought it was a reference to Wine, the Linux Wine, and then thought of apfelwein. Nvm!

6 hours ago | parent | prev [-]
[deleted]
LeoDaVibeci 8 hours ago | parent | prev | next [-]

Honestly I can't believe Apple put that foundation model product out the door. I was so excited about it, but when I tried it, it was such a disappointment. Glad to hear you calling that out so I know it wasn't just me.

Looks like they have pivoted completely over to Gemini, thank god.

franze 7 hours ago | parent | next [-]

yeah, it is super limited but also you can now do

  cmd(){ local x c r a; while [[ $1 == -* ]]; do case $1 in -x)x=1;shift;; -c)c=1;shift;; *)break;; esac; done; r=$(apfel -q -s 'Output only a shell command.' "$*" | sed '/^```/d;/^#/d;s/^[[:space:]]*//;/^$/d' | head -1); [[ $r ]] || { echo "no command generated"; return 1; }; printf '\e[32m$\e[0m %s\n' "$r"; [[ $c ]] && printf %s "$r" | pbcopy && echo "(copied)"; [[ $x ]] && { printf 'Run? [y/N] '; read -r a; [[ $a == y ]] && eval "$r"; }; return 0; } 
cmd find all swift files larger than 1MB

cmd -c show disk usage sorted by size

cmd -x what process is using port 3000

cmd list all git branches merged into main

cmd count lines of code by language

without calling home or downloading extra local models

and well, maybe one day they get their local models .... more powerful, "less afraid" and way more context window.

jorvi 3 hours ago | parent | next [-]

This really makes me think of A Deepness in the Sky by Vernor Vinge. A loose prequel to A Fire Upon The Deep, and IMO actually the superior story. It plays in the far future of humanity.

In part of it, one group tries to take control of a huge ship from another group. They in part do this by trying to bypass all the cybersecurity. But in those far future days, you don't interface with all the aeons of layers of command protocols anymore, you just query an AI who does it for you. So, this group has a few tech guys that try the bypass by using the old command protocols directly (in a way the same thing like the iOS exploit that used a vulnerability in a PostScript font library from 90s).

Imagine being used to LLM prompting + responses, and suddenly you have to deal with something like

  sed '/^```/d;/^#/d;s/^[[:space:]]\*//;/^$/d' | head -1); [[ $r ]]
and generally obtuse terminal output and man pages.

:)

(offtopic: name your variables, don't do local x c r a;. Readability is king, and a few hundred thousand years from now some poor Qeng Ho fellow might thank his lucky stars you did).

beepbooptheory 4 hours ago | parent | prev [-]

What is the AI doing here? Or is this just like being cheeky?

dgacmu 3 hours ago | parent [-]

The pile of shell and sed is cleaning up the ai output and then running it in the shell.

The instruction to the AI was to create _a_ shell command. So it's a random shell command generator (maybe).

corndoge 3 hours ago | parent [-]

that part is the system prompt, the script is a function that takes a prompt describing a shell command as an argument

beepbooptheory 3 hours ago | parent [-]

But it's gotta be just a joke right? Which is why all the examples are just classic things you do with bash/unix utilities?

I'll just say, if not a joke, the bit is appreciated either way!

"AI change to the home directory. Make it snappy!"

drob518 5 hours ago | parent | prev [-]

In Apple’s defense, they did make it do something borderline useful while targeting a baseline of M1 Macs with 8 GB of RAM (and even less in phones).

3yr-i-frew-up 6 hours ago | parent | prev [-]

[dead]