การพัฒนาใหม่ทั้งหมดสำหรับรันไทม์ประสิทธิภาพสูงของ Google สำหรับ AI ในอุปกรณ์จะอยู่ใน LiteRT เท่านั้น แอปพลิเคชันที่ใช้แพ็กเกจ TensorFlow Lite จะยังคงทํางานต่อไป แต่การอัปเดตใหม่ทั้งหมดจะรวมอยู่ในแพ็กเกจ LiteRT เท่านั้น LiteRT API มีชื่อเมธอดเหมือนกับ TF Lite API ดังนั้นการย้ายข้อมูลไปยัง LiteRT จึงไม่ต้องเปลี่ยนแปลงโค้ดอย่างละเอียด
LiteRT ในรันไทม์ของบริการ Google Play จะยังคงใช้play-services-tflite
ข้อกําหนดต่อไป หากแอปใช้รันไทม์ของ Play Services กับ TensorFlow Lite อยู่แล้ว คุณก็ไม่จำเป็นต้องเปลี่ยนแปลงโค้ดใดๆ
หากต้องการใช้ LiteRT ใน Play Services ให้เพิ่มรายการต่อไปนี้ลงในbuild.gradle
dependencies
dependencies{...// LiteRT dependencies for Google Play servicesimplementation'com.google.android.gms:play-services-tflite-java:16.4.0'// Optional: include LiteRT Support Libraryimplementation'com.google.android.gms:play-services-tflite-support:16.4.0'...}
Swift และ Objective-C SDK สำหรับ iOS, C++ SDK, ไลบรารีงาน และไลบรารี Model Maker จะยังคงอยู่ใน TensorFlow Lite API แอปพลิเคชันที่ใช้ SDK หรือไลบรารีเหล่านี้ไม่ควรย้ายข้อมูลไปยัง LiteRT
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-24 UTC"],[],[],null,["# Migrate to LiteRT from TensorFlow Lite\n\n| **Note:** This page is for users migrating from TF Lite to LiteRT. To migrate to LiteRT Next, see [Get Started with LiteRT Next](./next/get_started).\n\nAll new development for Google's high-performance runtime for on-device AI will\nbe exclusively on LiteRT. Applications that use TensorFlow Lite packages will\ncontinue to function, but all new updates will only be included in LiteRT\npackages. The LiteRT APIs contain the same method names as the TF Lite APIs, so\nmigrating to LiteRT does not require detailed code changes.\n\nFor package name changes, see the following migration guides for specific\nplatforms.\n\nMigrate with Android\n--------------------\n\nTo migrate an Android application using Tensorflow Lite, replace the dependency\nfrom `org.tensorflow:tensorflow-lite` to `com.google.ai.edge.litert`. The\n[LiteRT Maven repository](https://maven.google.com/web/index.html#com.google.ai.edge.litert)\nincludes the following packages:\n\n- [`com.google.ai.edge.litert:litert`](https://maven.google.com/web/index.html#com.google.ai.edge.litert:litert)\n- [`com.google.ai.edge.litert:litert-gpu`](https://maven.google.com/web/index.html#com.google.ai.edge.litert:litert-gpu)\n- [`com.google.ai.edge.litert:litert-metadata`](https://maven.google.com/web/index.html#com.google.ai.edge.litert:litert-metadata)\n- [`com.google.ai.edge.litert:litert-support`](https://maven.google.com/web/index.html#com.google.ai.edge.litert:litert-support)\n\nYou can make this change in your `build.gradle` dependencies: \n\n dependencies {\n ...\n implementation `com.google.ai.edge.litert:litert:1.0.1`\n }\n\n### Play Services\n\nLiteRT in the Play Services runtime continues to use the `play-services-tflite`\ndependency. If your app is already using the Play Services runtime with\nTensorFlow Lite, you don't need to make any code changes.\n\nTo use LiteRT in Play Services, add the following to your `build.gradle`\ndependencies: \n\n dependencies {\n ...\n // LiteRT dependencies for Google Play services\n implementation 'com.google.android.gms:play-services-tflite-java:16.4.0'\n // Optional: include LiteRT Support Library\n implementation 'com.google.android.gms:play-services-tflite-support:16.4.0'\n ...\n }\n\nMigrate with Python\n-------------------\n\nTo migrate Python code using Tensorflow Lite, replace the PIP package from\n`tflite-runtime` to `ai-edge-litert`.\n\nInstall LiteRT with PIP: \n\n $ python3 -m pip install ai-edge-litert\n\nImport LiteRT with the following: \n\n from ai_edge_litert.interpreter import Interpreter\n interpreter = Interpreter(model_path=args.model_file)\n\nOther Libraries\n---------------\n\nThe Swift and Objective-C SDKs for iOS, C++ SDK, Task Library, and Model Maker\nlibrary continues to exist in the TensorFlow Lite APIs. Applications using these\nSDKs or libraries shouldn't migrate to LiteRT."]]