Skip to content

Add os-x native support - #1

Open
mihajloS wants to merge 1 commit into
Element9:mainfrom
mihajloS:osx-native-llm
Open

Add os-x native support#1
mihajloS wants to merge 1 commit into
Element9:mainfrom
mihajloS:osx-native-llm

Conversation

@mihajloS

Copy link
Copy Markdown

Summary

Add apfel as an alternative backend, enabling fully offline, zero-cost command generation using Apple's on-device LLM on macOS Tahoe.

Changes

  • Add --backend apfel flag to select the local on-device model instead of the default Claude API
  • Invoke apfel via child_process.execFile with a compact prompt that requests a JSON response containing the command and its safety classification
  • Fall back to treating raw output as an unsafe command when the model does not return valid JSON
  • Skip the Anthropic API key check when using the apfel backend
  • Update README with prerequisites, shell function examples, and a backend comparison table

How to test

  1. Install apfel: brew install apfel
  2. Add the apfel shell function variant to ~/.zshrc:
    ask() {
      local cmd
      cmd=$(command ask-llm-cli --backend apfel "$@") || return
      print -z "$cmd"
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant