{"id":29437792,"url":"https://github.com/loopwork/olleh","last_synced_at":"2025-07-13T07:15:07.733Z","repository":{"id":301441715,"uuid":"1007093952","full_name":"loopwork/olleh","owner":"loopwork","description":"An Ollama-compatible CLI for Apple's Foundation Models","archived":false,"fork":false,"pushed_at":"2025-07-09T12:45:32.000Z","size":527,"stargazers_count":113,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-12T11:42:33.524Z","etag":null,"topics":["foundation-models","ollama"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loopwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-23T13:02:39.000Z","updated_at":"2025-07-12T09:31:33.000Z","dependencies_parsed_at":"2025-06-26T23:13:55.404Z","dependency_job_id":"900d6527-ec92-4679-acbc-efb0abbbfbf3","html_url":"https://github.com/loopwork/olleh","commit_stats":null,"previous_names":["loopwork/olleh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/loopwork/olleh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopwork%2Folleh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopwork%2Folleh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopwork%2Folleh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopwork%2Folleh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loopwork","download_url":"https://codeload.github.com/loopwork/olleh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopwork%2Folleh/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265102779,"owners_count":23711585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["foundation-models","ollama"],"created_at":"2025-07-13T07:15:04.739Z","updated_at":"2025-07-13T07:15:07.726Z","avatar_url":"https://github.com/loopwork.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"Assets/logo-dark.svg\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"Assets/logo-light.svg\"\u003e\n  \u003cimg alt=\"olleh\" width=\"200\"\u003e\n\u003c/picture\u003e\n\n![Screen recording of olleh command running interactively](/demo.gif)\n\nOlleh provides an Ollama-compatible API to Apple's new\n[Foundation Models](https://developer.apple.com/documentation/foundationmodels),\nannounced at WWDC 2025.\nIt serves as a bridge between Apple's native AI capabilities and the\nOllama ecosystem, offering both a command-line interface and an HTTP API\nfor seamless integration with existing tools and workflows.\n\n## Requirements\n\n- macOS 26 beta or later\n- Apple Silicon Mac (M1 or later)\n- Xcode 26 beta / Swift 6.2+\n\n## Installation\n\n### Homebrew\n\n```bash\nbrew install loopwork/tap/olleh\n```\n\n### Building from Source\n\n```bash\ngit clone https://github.com/loopwork/olleh.git\ncd olleh\nmake\nsudo make install # installs to /usr/local/bin/\n```\n\n## Quick Start\n\n```bash\n# Check if Foundation Models are available\nolleh check\n\n# Start the Ollama-compatible API server\nolleh serve\n\n# Chat interactively with the model\nolleh run default\n```\n\n## CLI Reference\n\n### Available Commands\n\n```terminal\n❯ olleh\nOVERVIEW: Ollama-compatible CLI for Apple Foundation Models\n\nUSAGE: olleh \u003csubcommand\u003e\n\nOPTIONS:\n  --version               Show the version.\n  -h, --help              Show help information.\n\nSUBCOMMANDS:\n  serve                   Start olleh\n  run                     Run a model interactively\n  list                    List models\n  show                    Show model information\n  check                   Check availability\n\n  See 'olleh help \u003csubcommand\u003e' for detailed help.\n```\n\n### Command Details\n\n#### `olleh serve`\n\nStart the [Ollama-compatible HTTP API](https://github.com/ollama/ollama/blob/main/docs/api.md) server.\n\n```bash\n# Default configuration (port 11941)\nolleh serve\n\n# Verbose logging\nolleh serve --verbose\n\n# Bind to specific host and port\nolleh serve --host 0.0.0.0 --port 11434 # default ollama port \n```\n\n#### `olleh run`\n\nStart an interactive chat session with the model.\n\n```bash\n$ olleh run default\n\u003e\u003e\u003e Enter a message (/? for help)\n```\n\nUse `Ctrl+C` or type `/bye` to exit the chat session.\n\n#### `olleh list`\n\nList all available models.\nCurrently returns only the `default` Foundation Model.\n\n```console\n$ olleh list\nNAME                     ID             SIZE     MODIFIED\ndefault                                 N/A      2 weeks ago\n```\n\n#### `olleh show`\n\nShow information about a model.\n\n```console\n$ olleh show default\n  Model\n    architecture        foundation\n    parameters          3B\n    context length      65536\n    embedding length    2048\n    quantization        2b-qat\n\n  Capabilities\n    completion\n    tools\n\n  Parameters\n    temperature    0.7\n\n  License\n    Apple Terms of Use\n```\n\n#### `olleh check`\n\nVerify that Foundation Models are available on your system.\n\n```console\n$ olleh check\nFoundation Models available\n```\n\n## HTTP API\n\nWhen running `olleh serve`,\nthe following Ollama-compatible endpoints are available:\n\n- `POST /api/generate` - Generate text completions\n- `POST /api/chat` - Chat with the model\n- `GET /api/tags` - List available models\n- `GET /api/show` - Show information about a model\n\n### Example: Using with Ollama Swift Client\n\nYou can use Olleh with the\n[Ollama Swift](https://github.com/loopwork/ollama-swift)\nclient library:\n\n```swift\nimport Ollama\n\n// Connect to olleh server (default port: 11941)\nlet client = Client(host: URL(\"http://localhost:11941\")!)\n\n// Generate text using Apple's Foundation Models\nlet response = try await client.generate(\n    model: \"default\",\n    prompt: \"Tell me about Swift programming.\",\n    options: [\n        \"temperature\": 0.7,\n        \"max_tokens\": 100\n    ]\n)\nprint(response.response)\n```\n\n### Example: Using with curl\n\n```bash\n# Generate text with streaming\ncurl http://localhost:11941/api/generate -d '{\n  \"model\": \"default\",\n  \"prompt\": \"Why is the sky blue?\",\n  \"stream\": true\n}'\n\n# Chat completion\ncurl http://localhost:11941/api/chat -d '{\n  \"model\": \"default\",\n  \"messages\": [\n    {\"role\": \"user\", \"content\": \"Hello, how are you?\"}\n  ],\n}'\n```\n\n## Model Support\n\nOlleh currently supports the lone `default` model\nprovided by Apple's Foundation Models framework.\n\n### Foundation Models Adapters\n\nOlleh supports loading custom Foundation Models adapters using the `--adapter` flag:\n\n```bash\n# Load and run with a custom adapter\nolleh run default --adapter /path/to/my_adapter.fmadapter\n```\n\nFoundation Models adapters let you:\n\n- Specialize the model for specific domains or tasks\n- Improve accuracy and consistency for your use case\n- Add new skills to the base model\n\nSee [Apple's Foundation Models Adapter documentation](https://developer.apple.com/apple-intelligence/foundation-models-adapter/)\nfor information on training custom adapters.\n\n### Future Features\n\nFuture releases may include:\n- Support for specialized models as they become available\n- Model configuration and fine-tuning options\n- Adapter management commands\n\n## License\n\nThis project is licensed under the Apache License, Version 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopwork%2Folleh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floopwork%2Folleh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopwork%2Folleh/lists"}