Skip to content
Merged

Dev #345

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
409c108
feat: Add tool calling support with C++ as single source of truth
jmakwana06 Jan 25, 2026
e1b806e
fix: Address code review feedback
jmakwana06 Jan 25, 2026
ea1ed92
fix(ios): not deleting models once downloaded
Hyunoh-Yeo Jan 25, 2026
5e1244b
fix(ios): not deleting models once downloaded
Hyunoh-Yeo Jan 25, 2026
e827a4d
fix(ios): not deleting models once downloaded
Hyunoh-Yeo Jan 25, 2026
bf1fd5e
fix(ios): wrong metadata displaying
Hyunoh-Yeo Jan 25, 2026
a766075
fix(ios): wrong metadata displaying
Hyunoh-Yeo Jan 25, 2026
cc577cf
fixes
shubhammalhotra28 Jan 25, 2026
1f1b42a
adding tab - to just see what's happenin when doing tool call - will …
shubhammalhotra28 Jan 25, 2026
cd26d3a
fix(ios): disable trash for Platform LLM/TTS
Hyunoh-Yeo Jan 25, 2026
1ec933e
Merge pull request #293 from j-makwana/feature/tool-calling
sanchitmonga22 Jan 26, 2026
f58f2db
git ignore updates
shubhammalhotra28 Jan 26, 2026
21c8ca8
git ignore updates
shubhammalhotra28 Jan 26, 2026
6703de9
Merge pull request #300 from RunanywhereAI/feature/tool-calling
shubhammalhotra28 Jan 26, 2026
9311ff8
Merge pull request #298 from Hyunoh-Yeo/bugfix/272
shubhammalhotra28 Jan 26, 2026
9d6a9ba
intial changes
shubhammalhotra28 Jan 26, 2026
066bcfc
stage changes
shubhammalhotra28 Jan 26, 2026
9fadba7
updates
shubhammalhotra28 Jan 26, 2026
cab2873
updates
shubhammalhotra28 Jan 26, 2026
4ffbe2b
bug fixes
shubhammalhotra28 Jan 26, 2026
943f4f6
bug fixes
shubhammalhotra28 Jan 26, 2026
d0022cb
feat(swift): Add strongly-typed tool calling support to Swift SDK
sanchitmonga22 Jan 26, 2026
57315b1
feat(swift): Enhance tool calling with real API integration and impro…
sanchitmonga22 Jan 26, 2026
cf43e7b
small change
sanchitmonga22 Jan 26, 2026
51a410a
fixes
shubhammalhotra28 Jan 26, 2026
029d70f
feat: Add Vision Language Model (VLM) support
sanchitmonga22 Jan 26, 2026
6fd772c
Merge remote-tracking branch 'origin/smonga/tool_call_swift' into smo…
sanchitmonga22 Jan 26, 2026
1929415
feat: Add floating VLM camera button to chat view
sanchitmonga22 Jan 26, 2026
18fb754
fix: Add NSCameraUsageDescription for VLM camera feature
sanchitmonga22 Jan 26, 2026
67ea49b
feat: Add SmolVLM 500M and Qwen2-VL 2B to model registry
sanchitmonga22 Jan 26, 2026
f4f8027
feat: Enhance VLM model registration and loading
sanchitmonga22 Jan 26, 2026
4d6af0c
feat: Add chat template formatting for VLM model types
sanchitmonga22 Jan 26, 2026
e3fe5b4
fix: Configure camera output to BGRA format for VLM image processing
sanchitmonga22 Jan 26, 2026
2886392
feat: Implement auto-streaming feature in VLMCameraView and VLMViewModel
sanchitmonga22 Jan 27, 2026
f8a50a8
Merge shubham/core-ml-diffusion: add CoreML Diffusion support alongsi…
sanchitmonga22 Jan 27, 2026
018e07f
initial changes
shubhammalhotra28 Jan 27, 2026
5b1f78c
updates
shubhammalhotra28 Jan 28, 2026
5281ac0
fixes for swift
shubhammalhotra28 Jan 28, 2026
93c9a8f
minor fixes
shubhammalhotra28 Jan 28, 2026
e92681e
kotlin and swift works
shubhammalhotra28 Jan 28, 2026
f0e04bc
fixing flutter sdk
shubhammalhotra28 Jan 29, 2026
f98320c
fix flutter
shubhammalhotra28 Jan 29, 2026
9d37274
flutter changes
shubhammalhotra28 Jan 29, 2026
9d2605d
stagng flutter changes
shubhammalhotra28 Jan 29, 2026
ed52fcd
flutter changes
shubhammalhotra28 Jan 30, 2026
09644a1
tweaks fo rflutter
shubhammalhotra28 Jan 30, 2026
e29e042
react-native nweaks
shubhammalhotra28 Jan 30, 2026
2c5d44a
fixing react native
shubhammalhotra28 Jan 30, 2026
88a1239
react-native looks good
shubhammalhotra28 Jan 30, 2026
e9ecf85
feat: Reorganize iOS app tabs and simplify UI
sanchitmonga22 Jan 30, 2026
30596a7
fix: Address PR #309 review comments - Quick fixes and critical issues
sanchitmonga22 Jan 30, 2026
a6b8eea
fix: Address PR #309 larger structural issues
sanchitmonga22 Jan 30, 2026
0c18ecb
fix: Eliminate React Native prompt formatting duplication
sanchitmonga22 Jan 31, 2026
12599fc
small fixes
shubhammalhotra28 Jan 30, 2026
0b4e8eb
Merge main into shubham/fix-tool-calling
shubhammalhotra28 Feb 1, 2026
fb4663f
minor fixes
shubhammalhotra28 Feb 2, 2026
fb8e9dd
Merge pull request #309 from RunanywhereAI/shubham/fix-tool-calling
shubhammalhotra28 Feb 2, 2026
1587d13
fixed merge conflict
shubhammalhotra28 Feb 2, 2026
f84e929
ci(swift): add auto-tag workflow on push to main
josuediazflores Feb 2, 2026
e728114
Merge pull request #1 from josuediazflores/ci/swift-auto-tag
josuediazflores Feb 2, 2026
30c23a6
Phase 2 Complete
josuediazflores Feb 2, 2026
00c1eba
Fix
josuediazflores Feb 2, 2026
cb07423
Fix Again
josuediazflores Feb 2, 2026
9dfb4ec
ci(swift): create semver tag in Phase 2 for SPM resolution
josuediazflores Feb 2, 2026
37ad693
validation: point swift-spm-consumer at fork for Phase 2 test
josuediazflores Feb 2, 2026
cfe813b
chore(swift): use remote binaries on main for consumer (v0.17.5)
josuediazflores Feb 2, 2026
88a5d69
apple ios changes
shubhammalhotra28 Feb 2, 2026
5d93b6a
staging changes
shubhammalhotra28 Feb 2, 2026
338176b
updates
shubhammalhotra28 Feb 2, 2026
dcc3000
updates
shubhammalhotra28 Feb 2, 2026
ff05d72
updates
shubhammalhotra28 Feb 2, 2026
fcbe222
SDKTestApp, TTS/LLM UI, upstream URLs, SDK improvements
josuediazflores Feb 2, 2026
1328ad3
ci(swift): Swift CI/CD only – auto-tag, build-release, release, Packa…
josuediazflores Feb 2, 2026
9f7da15
changes
shubhammalhotra28 Feb 2, 2026
ac2a957
tweaking some changes
shubhammalhotra28 Feb 2, 2026
7f21179
ci(swift): harden tag build release workflows
josuediazflores Feb 2, 2026
98336e9
ci(swift): ensure commons built before swift package build
josuediazflores Feb 2, 2026
c431a64
fixnig ios
shubhammalhotra28 Feb 2, 2026
4509331
minor tweaks
shubhammalhotra28 Feb 2, 2026
f88f570
minor changes - will need to tweak again - since diff models have dif…
shubhammalhotra28 Feb 2, 2026
9127453
ci(swift): pin Xcode 15.4 for swift-v tag build
josuediazflores Feb 3, 2026
459abcf
feat(ios): add SDKTestApp demo app
josuediazflores Feb 3, 2026
2139b85
fix(swift): resolve strict concurrency build errors
josuediazflores Feb 3, 2026
6d83bcb
Merge branch 'main' into ci/swift-cd-only
josuediazflores Feb 3, 2026
892c82a
fix(swift): Swift 6 strict concurrency – temp storage, Sendable ref
josuediazflores Feb 3, 2026
0c5f063
fix(swift): use resultPtr.pointee in Foundation Models generate catch
josuediazflores Feb 3, 2026
b1fa241
fix(ci): correct zip path for release-assets (3 levels up from common…
josuediazflores Feb 3, 2026
3f4934d
fix(ci): checkout main before pushing Package.swift, merge tag steps
josuediazflores Feb 3, 2026
93ddf5e
chore: trigger PR refresh
josuediazflores Feb 3, 2026
129a799
fix(ci): build commons once; Swift SDK step only consumes 3 XCFrameworks
josuediazflores Feb 3, 2026
c884700
fix(ci): discard local Package.swift changes before checkout main
josuediazflores Feb 3, 2026
124fa8b
fix(ci): guard tag/main alignment; use git pull --ff-only to prevent …
josuediazflores Feb 3, 2026
7055a3d
fix(codeql): C/C++ manual build for runanywhere-commons; disable defa…
josuediazflores Feb 4, 2026
7c38b94
chore: trigger CodeQL run with latest workflow
josuediazflores Feb 4, 2026
0d4c26b
fix(ci): run tag/main guard only on upstream; allow release on forks …
josuediazflores Feb 4, 2026
5028c39
Add diffusion model support and TTS router for Kotlin SDK
shubhammalhotra28 Feb 5, 2026
bfca896
Merge branch 'main' into add-diffusion
shubhammalhotra28 Feb 5, 2026
c718d6c
updates
shubhammalhotra28 Feb 5, 2026
acd63a9
remvoing diffsin model support for android as of now
shubhammalhotra28 Feb 6, 2026
bf32f29
fixes
shubhammalhotra28 Feb 6, 2026
64977bb
fixes
shubhammalhotra28 Feb 6, 2026
df50a6f
fixnig
shubhammalhotra28 Feb 6, 2026
af0ae2a
Merge PR 323: ci/swift-cd-only
shubhammalhotra28 Feb 8, 2026
e77ac2c
cleanup
shubhammalhotra28 Feb 8, 2026
fc58f2d
fixes
shubhammalhotra28 Feb 8, 2026
643c2c1
fixes
shubhammalhotra28 Feb 8, 2026
a9fec96
fixed
shubhammalhotra28 Feb 8, 2026
a19f695
changes
shubhammalhotra28 Feb 8, 2026
eb06a90
cleanuo
shubhammalhotra28 Feb 9, 2026
9ff6c66
some more changes
shubhammalhotra28 Feb 9, 2026
e467a58
cleanup
shubhammalhotra28 Feb 9, 2026
0b6d4fb
react native fix
shubhammalhotra28 Feb 9, 2026
2ce2b03
fixed react native
shubhammalhotra28 Feb 9, 2026
a9a6232
fixing the script
shubhammalhotra28 Feb 9, 2026
7dc49d1
fixing
shubhammalhotra28 Feb 10, 2026
e951815
fix
shubhammalhotra28 Feb 10, 2026
0987347
minor fix
shubhammalhotra28 Feb 10, 2026
07ee370
addressing comments
shubhammalhotra28 Feb 10, 2026
389c1bf
removing the stale code not needed since coreml / swift is the only a…
shubhammalhotra28 Feb 10, 2026
abdaab0
some changes in swift layer
shubhammalhotra28 Feb 10, 2026
f63675a
Merge pull request #327 from RunanywhereAI/add-diffusion
shubhammalhotra28 Feb 10, 2026
be76bda
minor chanegs
shubhammalhotra28 Feb 10, 2026
70bcd66
minor fixing the UI
shubhammalhotra28 Feb 10, 2026
64c9895
ui fix
shubhammalhotra28 Feb 10, 2026
6c9d815
Merge pull request #304 from RunanywhereAI/smonga/vlm+diffusion
shubhammalhotra28 Feb 10, 2026
329cbec
Merge main into dev
shubhammalhotra28 Feb 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ sdk/runanywhere-swift/Sources/RunAnywhere/Data/Network/DevelopmentConfig.swift
# Swift SDK - Local XCFrameworks
sdk/runanywhere-swift/Binaries/*.xcframework

# Swift SDK - Vendor directory (locally built xcframeworks)
sdk/runanywhere-swift/vendor/

# Kotlin SDK - Local JNI libs
sdk/runanywhere-kotlin/src/androidMain/jniLibs/

Expand Down
22 changes: 20 additions & 2 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ let package = Package(
.package(url: "https://github.com/devicekit/DeviceKit.git", from: "5.6.0"),
.package(url: "https://github.com/tsolomko/SWCompression.git", from: "4.8.0"),
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.40.0"),
// ml-stable-diffusion for CoreML-based image generation
.package(url: "https://github.com/apple/ml-stable-diffusion.git", from: "1.1.0"),
],
targets: [
// =================================================================
Expand Down Expand Up @@ -132,6 +134,7 @@ let package = Package(
.product(name: "DeviceKit", package: "DeviceKit"),
.product(name: "SWCompression", package: "SWCompression"),
.product(name: "Sentry", package: "sentry-cocoa"),
.product(name: "StableDiffusion", package: "ml-stable-diffusion"),
"CRACommons",
],
path: "sdk/runanywhere-swift/Sources/RunAnywhere",
Expand Down
12 changes: 12 additions & 0 deletions examples/android/RunAnywhereAI/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,15 @@ hs_err_pid*

# Detekt
detekt.sarif

# Native libraries - these come from SDK module dependencies, NOT local copies.
# NEVER put .so files directly in app/src/main/jniLibs/. They are provided by:
# - :sdk:runanywhere-kotlin (core + commons)
# - :sdk:runanywhere-kotlin:modules:runanywhere-core-onnx (ONNX/Sherpa-ONNX)
# - :sdk:runanywhere-kotlin:modules:runanywhere-core-llamacpp (LlamaCPP)
# Having stale .so here will OVERRIDE the SDK module versions and cause crashes.
app/src/main/jniLibs/

# Crash/debug log captures
stt_crash_logcat.txt
app_logcat.txt
15 changes: 5 additions & 10 deletions examples/android/RunAnywhereAI/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,11 @@ android {
// and 16KB alignment during packaging.
useLegacyPackaging = true

// Handle duplicate native libraries from multiple backend modules
// (ONNX and LlamaCPP both include some common libraries)
pickFirsts += listOf(
"lib/arm64-v8a/libomp.so",
"lib/arm64-v8a/libc++_shared.so",
"lib/arm64-v8a/librac_commons.so",
"lib/armeabi-v7a/libomp.so",
"lib/armeabi-v7a/libc++_shared.so",
"lib/armeabi-v7a/librac_commons.so",
)
// Handle duplicate native libraries from multiple SDK modules.
// The main SDK, ONNX module, and LlamaCPP module may share common
// libraries (libc++_shared, libomp, librac_commons). Use a wildcard
// to safely pick the first copy for any ABI.
pickFirsts += listOf("lib/**/*.so")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,21 @@ class RunAnywhereApplication : Application() {
framework = InferenceFramework.LLAMA_CPP,
memoryRequirement = 400_000_000,
)
// LFM2-Tool models - For tool calling / function calling support
RunAnywhere.registerModel(
id = "lfm2-1.2b-tool-q4_k_m",
name = "LiquidAI LFM2 1.2B Tool Q4_K_M",
url = "https://huggingface.co/LiquidAI/LFM2-1.2B-Tool-GGUF/resolve/main/LFM2-1.2B-Tool-Q4_K_M.gguf",
framework = InferenceFramework.LLAMA_CPP,
memoryRequirement = 800_000_000,
)
RunAnywhere.registerModel(
id = "lfm2-1.2b-tool-q8_0",
name = "LiquidAI LFM2 1.2B Tool Q8_0",
url = "https://huggingface.co/LiquidAI/LFM2-1.2B-Tool-GGUF/resolve/main/LFM2-1.2B-Tool-Q8_0.gguf",
framework = InferenceFramework.LLAMA_CPP,
memoryRequirement = 1_400_000_000,
)
Log.i("RunAnywhereApp", "✅ LLM models registered")

// Register ONNX STT and TTS models
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ data class PerformanceSummary(
val successRate: Double = 1.0,
)

/**
* App-local tool call info.
* Matches iOS ToolCallInfo exactly.
*/
@Serializable
data class ToolCallInfo(
val toolName: String,
val arguments: String, // JSON string for display
val result: String? = null, // JSON string for display
val success: Boolean,
val error: String? = null,
)

/**
* App-specific ChatMessage for conversations.
* Self-contained with app-local types.
Expand All @@ -130,6 +143,7 @@ data class ChatMessage(
val timestamp: Long = System.currentTimeMillis(),
val analytics: MessageAnalytics? = null,
val modelInfo: MessageModelInfo? = null,
val toolCallInfo: ToolCallInfo? = null,
val metadata: Map<String, String>? = null,
) {
val isFromUser: Boolean get() = role == MessageRole.USER
Expand Down Expand Up @@ -158,6 +172,7 @@ data class ChatMessage(
thinkingContent: String? = null,
analytics: MessageAnalytics? = null,
modelInfo: MessageModelInfo? = null,
toolCallInfo: ToolCallInfo? = null,
metadata: Map<String, String>? = null,
): ChatMessage =
ChatMessage(
Expand All @@ -166,6 +181,7 @@ data class ChatMessage(
thinkingContent = thinkingContent,
analytics = analytics,
modelInfo = modelInfo,
toolCallInfo = toolCallInfo,
metadata = metadata,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ import com.runanywhere.runanywhereai.data.ConversationStore
import com.runanywhere.runanywhereai.domain.models.ChatMessage
import com.runanywhere.runanywhereai.domain.models.Conversation
import com.runanywhere.runanywhereai.domain.models.MessageRole
import com.runanywhere.runanywhereai.presentation.settings.ToolSettingsViewModel
import com.runanywhere.runanywhereai.presentation.chat.components.MarkdownText
import com.runanywhere.runanywhereai.presentation.chat.components.ModelLoadedToast
import com.runanywhere.runanywhereai.presentation.chat.components.ModelRequiredOverlay
import com.runanywhere.runanywhereai.util.getModelLogoResIdForName
import com.runanywhere.runanywhereai.ui.theme.AppColors
import android.app.Application
import com.runanywhere.runanywhereai.ui.theme.AppTypography
import com.runanywhere.runanywhereai.ui.theme.Dimensions
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -221,6 +223,20 @@ fun ChatScreen(viewModel: ChatViewModel = viewModel()) {
}
}

// Tool calling indicator - matching iOS
val toolContext = LocalContext.current
val application = toolContext.applicationContext as Application
val toolSettingsViewModel = remember { ToolSettingsViewModel.getInstance(application) }
val toolState by toolSettingsViewModel.uiState.collectAsStateWithLifecycle()

AnimatedVisibility(
visible = toolState.toolCallingEnabled && toolState.registeredTools.isNotEmpty(),
enter = fadeIn() + expandVertically(),
exit = fadeOut() + shrinkVertically(),
) {
ToolCallingBadge(toolCount = toolState.registeredTools.size)
}

// ModelRequiredOverlay when no model - animated circles + Get Started
if (!uiState.isModelLoaded && !uiState.isGenerating) {
ModelRequiredOverlay(
Expand Down Expand Up @@ -554,6 +570,8 @@ fun MessageBubbleView(
isGenerating: Boolean = false,
modifier: Modifier = Modifier,
) {
var showToolCallSheet by remember { mutableStateOf(false) }

val alignment =
if (message.role == MessageRole.USER) {
Arrangement.End
Expand Down Expand Up @@ -595,6 +613,15 @@ fun MessageBubbleView(
Spacer(modifier = Modifier.height(Dimensions.small))
}

// Tool call indicator (for assistant messages with tool calls) - matching iOS
if (message.role == MessageRole.ASSISTANT && message.toolCallInfo != null) {
com.runanywhere.runanywhereai.presentation.chat.components.ToolCallIndicator(
toolCallInfo = message.toolCallInfo,
onTap = { showToolCallSheet = true },
)
Spacer(modifier = Modifier.height(Dimensions.small))
}

// Thinking toggle (if thinking content exists)
message.thinkingContent?.let { thinking ->
ThinkingToggle(
Expand Down Expand Up @@ -754,6 +781,14 @@ fun MessageBubbleView(
Spacer(modifier = Modifier.width(Dimensions.messageBubbleMinSpacing))
}
}

// Tool call detail sheet - matching iOS
if (showToolCallSheet && message.toolCallInfo != null) {
com.runanywhere.runanywhereai.presentation.chat.components.ToolCallDetailSheet(
toolCallInfo = message.toolCallInfo,
onDismiss = { showToolCallSheet = false },
)
}
}

// Helper function to format timestamp
Expand Down Expand Up @@ -1241,6 +1276,42 @@ fun EmptyStateView() {
// MODEL SELECTION PROMPT
// ====================

/**
* Tool calling indicator badge - matching iOS ChatInterfaceView toolCallingBadge
*/
@Composable
fun ToolCallingBadge(toolCount: Int) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = Dimensions.mediumLarge, vertical = Dimensions.small),
horizontalArrangement = Arrangement.Center,
) {
Row(
modifier = Modifier
.background(
color = AppColors.primaryAccent.copy(alpha = 0.1f),
shape = RoundedCornerShape(6.dp)
)
.padding(horizontal = 10.dp, vertical = 4.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(6.dp),
) {
Icon(
imageVector = Icons.Default.Build,
contentDescription = "Tools enabled",
modifier = Modifier.size(10.dp),
tint = AppColors.primaryAccent,
)
Text(
text = "Tools enabled ($toolCount)",
style = AppTypography.caption2,
color = AppColors.primaryAccent,
)
}
}
}

@Composable
fun ModelSelectionPrompt(onSelectModel: () -> Unit) {
Surface(
Expand Down
Loading
Loading