Instructions to use litert-community/functiongemma-270m-ft-mobile-actions with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT-LM
How to use litert-community/functiongemma-270m-ft-mobile-actions with LiteRT-LM:
# LiteRT-LM runs on various platforms (Android, iOS, Windows, Linux, macOS, IoT, Web/WASM) # and supports many APIs (C++, Python, Kotlin, Swift, JavaScript, Flutter). # For platform-specific integration guides, please refer to the official developer website: # https://ai.google.dev/edge/litert-lm # To try LiteRT-LM, the easiest way is to use our CLI tool. # 1. Install the LiteRT-LM CLI tool: pip install litert-lm # 2. Download and run this model locally: # See: https://ai.google.dev/edge/litert-lm/cli litert-lm run \ --from-huggingface-repo=litert-community/functiongemma-270m-ft-mobile-actions \ model.litertlm \ --prompt="Write me a poem"
- Notebooks
- Google Colab
- Kaggle
Unexpected output <eos><eos>.... on ios
Hi, I’m a developer based in mainland China. I’m using this model on iOS, and I’m running mobile_actions_q8_ekv1024.litertlm with the LiteRT-LM Swift API and native Tool calling, but I’m seeing an intermittent issue and would really appreciate any help identifying the cause.
Sometimes sendMessage() succeeds, but the returned model output degenerates into repeated <eos> tokens instead of producing either a valid tool call or a normal final response after tool execution.
Environment:
- Platform: iOS app / iOS Simulator
- Runtime: LiteRT-LM Swift API
- Model:
mobile_actions_q8_ekv1024.litertlm - Tool mode: native LiteRT-LM
ToolAPI - Config:
ConversationConfig(tools: ...) - Sampling:
topK = 20,topP = 0.9,temperature = 0.1 - Flags:
convertCamelToSnakeCaseInToolDescription = trueenableConversationConstrainedDecoding = true
Current flow:
- Swift tools are registered with
ConversationConfig(tools: ...) - LiteRT-LM renders the tool schema internally
- LiteRT-LM executes the matched Swift tool
- Tool responses are fed back to the model automatically
- The app reads executed intents from local runtime state
This is not the old/manual path where the app parses raw FunctionGemma <start_function_call>... text.
Inputs that may trigger it include:
太暗了,要亮点再亮一点放大一点打开补光灯恢复默认
Example:
let result = try await agent.handleUserUtterance("太暗了,要亮点")
print(result.intents)
print(result.responseText)
Actual output preview:
...
Has anyone seen this behavior with LiteRT-LM Swift native tools, constrained decoding, or this mobile-actions model? Any suggestions on how to debug whether this comes from decoding, tool schema rendering, tool response formatting, or model behavior would be very helpful. Thank you!