1amageek

AnyFoundationModels — Development skill for Claude Code

Development community

Unified Swift interface for Foundation Models — Ollama, Claude, OpenAI Responses API, and MLX backends via trait-based configuration.

How to install AnyFoundationModels

This entry records only its repository, not the path inside it, so there is no exact command to give. Open 1amageek/AnyFoundationModels and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What AnyFoundationModels does

Unified Swift interface for Foundation Models — Ollama, Claude, OpenAI Responses API, and MLX backends via trait-based configuration.

Alternatives in Development

  • Claude Code Proxy — Run Claude Code on OpenAI models 3.3k ★
  • Harnessrouter — HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnes 618 ★
  • Notebook Intelligence — A JupyterLab extension supporting Claude Code, Copilot, Ollama, and OpenAI-compatible LLMs, with MCP, skills 331 ★

README

AnyFoundationModels

A unified Swift framework for interacting with multiple language model providers through a single, protocol-based API.

Write against the `LanguageModel` protocol and use **Ollama**, **Claude**, **OpenAI Responses API**, **on-device MLX**, and **on-device Metal via swift-lm** side by side in the same application.

Features

  • Unified LanguageModel protocol — one interface for all providers
  • Structured output via @Generable macro — get typed Swift structs from LLM responses
  • Tool calling with automatic execution loop
  • Streaming responses with partial content parsing
  • Swift 6 concurrency — fully Sendable, async/await native
  • On-device backends for both MLX and direct Metal inference
  • Trait-gated compilation — keep package size small by compiling only the backends you need

Requirements

  • Swift 6.2+
  • macOS 26+ / iOS 26+ / visionOS 26+

Installation

Add to your `Package.swift`:

dependencies: [
    .package(url: "https://github.com/1amageek/AnyFoundationModels.git", from: "0.5.6"),
]

Enable the backends you need via traits. Each backend compiles only when its trait is active, keeping your binary small:

targets: [
    .executableTarget(
        name: "MyApp",
        dependencies: [
            .product(name: "OpenFoundationModels", package: "AnyFoundationModels"),
            .product(name: "ClaudeFoundationModels", package: "AnyFoundationModels",
                     condition: .when(traits: ["Claude"])),
            .product(name: "ResponseFoundationModels", package: "AnyFoundationModels",
                     condition: .when(traits: ["Response"])),
            .product(name: "OllamaFoundationModels", package: "AnyFoundationModels",
                     condition: .when(traits: ["Ollama"])),
            .product(name: "MLXFoundationModels", package: "AnyFoundationModels",
                     condition: .when(traits: ["MLX"])),
            .product(name: "MetalFound