Skip to content

autoharness/CarToolPlayground

Repository files navigation

🛝Car Tool Playground

By empowering a Large Language Model (LLM) with CarToolForge, the Car Tool Playground showcases how an LLM can interact with vehicle functions through a conversational chat interface.

DEMO_1_1

DEMO_1_2

Features

  • Free Chat: Engage in an open-ended conversation with the LLM.
  • Auto Play: Run a scripted, multi-turn conversation from a pre-configured dataset.

Prerequisites

1. Install CarToolForge

Follow the CarToolForge installation guide.

2. Set up a Firebase project

This project uses Firebase AI Logic to make calls to the Gemini API. You'll need to create a Firebase project in the Firebase console and register this app with it.

For detailed instructions, see Step 1: Set up a Firebase project and connect your app.

After configuration, download the generated google-services.json file and place it in the project's app/ directory. If this file is missing, the build will fail with the following error:

Execution failed for task ':app:processDebugGoogleServices'.
> File google-services.json is missing.

Tip

It is highly recommended to build and run the AppFunctionsPilot and firebase-ai sample projects first. This will help you familiarize yourself with the dependencies and potentially save debugging time.

Build

You can build the project using Gradle:

./gradlew clean assembleDebug

Installation

The app requires privileged permissions to access vehicle properties and execute function calls. To install it, you'll need a rooted device or emulator.

  1. Disable Permission Enforcement: First, modify the build.prop file to disable privileged permission enforcement.
adb root
adb remount
adb shell "sed -i 's/ro.control_privapp_permissions=enforce/ro.control_privapp_permissions=log/g' /vendor/build.prop"
  1. Install as a Privileged App: Push the APK to the privileged apps directory, such as /system/priv-app:
adb push app-debug.apk /system/priv-app
adb reboot
  1. Grant Runtime Permissions: To simplify development (a admittedly bad practice 😜), the app skips runtime permission requests. Instead, using adb install -g to directly grant all necessary runtime permissions:
adb install -g app-debug.apk

Note

After the initial privileged installation, you can update the agent app using a standard adb install command, provided its permissions in the manifest do not change.

Large Language Model

API-based Model

Firebase AI Logic is currently integrated. For a list of available models, see Learn about supported models. The specific model utilized can be changed in FirebaseInference.kt.

On-device Model

The application supports local inference via LiteRT-LM. Push the model file to the application's external storage directory. On Android Automotive (AAOS) device, the path is typically user-specific, for example:

adb push qwen3_4b_q8.litertlm /mnt/user/10/emulated/10/Android/data/org.autoharness.cartoolplayground/files

Select LiteRT-LM as the preferred inference engine and choose the uploaded model from the file selection menu in the settings.

Dataset

The dataset for Auto Play mode can be found in the test_set.csv. You can edit this file to customize the conversational script.

Contributing

Take a look at the CONTRIBUTING.md.

References

About

A demo application showcasing an LLM-powered chat assistant for controlling vehicle functions using CarToolForge on Android Automotive.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages