sdk/runanywhere-swift/Sources/LlamaCPPRuntime/README.md
Llama.cpp LLM backend for the RunAnywhere Swift SDK — GGUF text generation with Metal acceleration on Apple platforms.
Add the Swift package and include the RunAnywhereLlamaCPP product (pin 0.20.13):
dependencies: [
.package(url: "https://github.com/RunanywhereAI/runanywhere-sdks", exact: "0.20.13"),
],
targets: [
.target(
name: "YourApp",
dependencies: [
.product(name: "RunAnywhere", package: "runanywhere-sdks"),
.product(name: "RunAnywhereLlamaCPP", package: "runanywhere-sdks"),
]
)
]
See the Swift SDK README for Xcode setup and API keys.
import RunAnywhere
import LlamaCPPRuntime
@MainActor
func bootstrap() throws {
LlamaCPP.register()
try RunAnywhere.initialize(
apiKey: "<YOUR_API_KEY>",
baseUrl: "https://api.runanywhere.ai",
environment: .production
)
}
// Load models and generate via RunAnywhere core APIs
let result = try await RunAnywhere.llm.generate(prompt: "What is on-device AI?")
See the Swift SDK README for model registration, streaming, and VLM.
RunAnywhere License. See LICENSE.