Choose Your Platform
Select your development platform to get started:- Swift
- Kotlin
- React Native
- Flutter
1. Install the SDK
Add RunAnywhere to your project using Swift Package Manager:Package.swift
Copy
Ask AI
dependencies: [
.package(url: "https://github.com/RunanywhereAI/runanywhere-sdks.git", from: "0.1.0")
]
Copy
Ask AI
.target(
name: "YourApp",
dependencies: [
.product(name: "RunAnywhere", package: "runanywhere-swift"),
.product(name: "RunAnywhereLlamaCPP", package: "runanywhere-swift"),
.product(name: "RunAnywhereONNX", package: "runanywhere-swift"),
]
)
2. Initialize the SDK
Copy
Ask AI
import RunAnywhere
import LlamaCPPRuntime
@main
struct MyApp: App {
init() {
do {
try RunAnywhere.initialize(
apiKey: "your-api-key",
baseURL: "https://api.runanywhere.ai",
environment: .production
)
Task { @MainActor in
ModuleRegistry.shared.register(LlamaCPP.self)
}
} catch {
print("SDK init failed: \(error)")
}
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
3. Generate Text
Copy
Ask AI
let response = try await llm.chat(
prompt: "Hello, how can you help me today?",
options: .init(maxTokens: 256, temperature: 0.7)
)
print(response.text)
Full Swift Documentation
Explore all Swift SDK features →
1. Install the SDK
Add RunAnywhere to yourbuild.gradle.kts:Copy
Ask AI
dependencies {
implementation("ai.runanywhere:runanywhere-core:0.1.0")
implementation("ai.runanywhere:runanywhere-llamacpp:0.1.0")
implementation("ai.runanywhere:runanywhere-onnx:0.1.0")
}
2. Initialize the SDK
Copy
Ask AI
import ai.runanywhere.RunAnywhere
import ai.runanywhere.llamacpp.LlamaCPP
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
RunAnywhere.initialize(
apiKey = "your-api-key",
baseURL = "https://api.runanywhere.ai",
environment = Environment.PRODUCTION
)
ModuleRegistry.register(LlamaCPP::class)
}
}
3. Generate Text
Copy
Ask AI
val response = llm.chat(
prompt = "Hello, how can you help me today?",
options = ChatOptions(maxTokens = 256, temperature = 0.7f)
)
println(response.text)
Full Kotlin Documentation
Explore all Kotlin SDK features →
1. Install the SDK
Copy
Ask AI
npm install @runanywhere/react-native
# or
yarn add @runanywhere/react-native
2. Initialize the SDK
Copy
Ask AI
import { RunAnywhere } from '@runanywhere/react-native';
// In your app entry point
RunAnywhere.initialize({
apiKey: 'your-api-key',
baseURL: 'https://api.runanywhere.ai',
environment: 'production',
});
3. Generate Text
Copy
Ask AI
import { useLLM } from '@runanywhere/react-native';
function MyComponent() {
const { chat } = useLLM();
const handleChat = async () => {
const response = await chat({
prompt: 'Hello, how can you help me today?',
options: { maxTokens: 256, temperature: 0.7 },
});
console.log(response.text);
};
return <Button onPress={handleChat} title="Chat" />;
}
Full React Native Documentation
Explore all React Native SDK features →
1. Install the SDK
Add to yourpubspec.yaml:Copy
Ask AI
dependencies:
runanywhere: ^0.1.0
Copy
Ask AI
flutter pub get
2. Initialize the SDK
Copy
Ask AI
import 'package:runanywhere/runanywhere.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await RunAnywhere.initialize(
apiKey: 'your-api-key',
baseURL: 'https://api.runanywhere.ai',
environment: Environment.production,
);
runApp(MyApp());
}
3. Generate Text
Copy
Ask AI
final response = await llm.chat(
prompt: 'Hello, how can you help me today?',
options: ChatOptions(maxTokens: 256, temperature: 0.7),
);
print(response.text);
Full Flutter Documentation
Explore all Flutter SDK features →
Next Steps
LLM Guide
Learn about text generation and chat
Speech-to-Text
Add voice transcription to your app
Text-to-Speech
Give your app a voice
Voice Agent
Build complete voice experiences
Need help? Check out the SDK Overview to compare all platforms, or dive into the full
documentation for your chosen SDK.