LiteRT (Lite 런타임의 줄임말)는 이전에 TensorFlow Lite로 알려졌던 Google의 기기 내 AI용 고성능 런타임입니다. 다양한 ML/AI 작업을 위한 실행 준비가 완료된 LiteRT 모델을 찾거나 AI Edge 변환 및 최적화 도구를 사용하여 TensorFlow, PyTorch, JAX 모델을 TFLite 형식으로 변환하고 실행할 수 있습니다.
주요 특징
기기 내 머신러닝에 최적화됨: LiteRT는 지연 시간 (서버 왕복이 없음), 개인 정보 보호 (기기에서 개인 정보가 유출되지 않음), 연결성 (인터넷 연결이 필요하지 않음), 크기 (모델 및 바이너리 크기가 축소됨), 전원 소모(효율적인 추론 및 네트워크 연결 없음)라는 5가지 주요 ODML 제약 조건을 해결합니다.
다중 프레임워크 모델 옵션: AI Edge는 TensorFlow, PyTorch, JAX 모델을 FlatBuffers 형식(.tflite)으로 변환하는 도구를 제공하므로 LiteRT에서 다양한 최신 모델을 사용할 수 있습니다. 또한 정량화 및 메타데이터를 처리할 수 있는 모델 최적화 도구에 액세스할 수 있습니다.
다양한 언어 지원: Java/Kotlin, Swift, Objective-C, C++, Python용 SDK를 포함합니다.
LiteRT 개발 워크플로는 ML/AI 문제를 식별하고, 이 문제를 해결하는 모델을 선택하고, 기기에서 모델을 구현하는 과정을 포함합니다. 다음 단계에서는 워크플로를 안내하고 추가 안내 링크를 제공합니다.
1. ML 문제에 가장 적합한 솔루션 파악
LiteRT는 머신러닝 문제 해결과 관련하여 사용자에게 높은 수준의 유연성과 맞춤설정 기능을 제공하므로 특정 모델이나 전문적인 구현이 필요한 사용자에게 적합합니다. 플러그 앤 플레이 솔루션을 찾는 사용자는 객체 감지, 텍스트 분류, LLM 추론과 같은 일반적인 머신러닝 태스크를 위한 기성 솔루션을 제공하는 MediaPipe Tasks를 선호할 수 있습니다.
다음 AI Edge 프레임워크 중 하나를 선택합니다.
LiteRT: 다양한 모델을 실행할 수 있는 유연하고 맞춤설정이 가능한 런타임입니다. 사용 사례에 맞는 모델을 선택하고 필요한 경우 LiteRT 형식으로 변환한 후 기기에서 실행합니다. LiteRT를 사용하려면 계속 읽어보세요.
MediaPipe Tasks: 맞춤설정이 가능한 기본 모델이 포함된 플러그 앤 플레이 솔루션입니다. AI/ML 문제를 해결하는 태스크를 선택하고 여러 플랫폼에 구현합니다. MediaPipe Tasks를 사용하려면 MediaPipe Tasks 문서를 참고하세요.
2. 모델 선택
LiteRT 모델은 .tflite 파일 확장자를 사용하는 FlatBuffers라는 효율적으로 이동 가능한 형식으로 표현됩니다.
다음과 같은 방법으로 LiteRT 모델을 사용할 수 있습니다.
기존 LiteRT 모델 사용: 가장 간단한 방법은 이미 .tflite 형식인 LiteRT 모델을 사용하는 것입니다. 이러한 모델에는 추가 전환 단계가 필요하지 않습니다. Kaggle 모델에서 LiteRT 모델을 찾을 수 있습니다.
모델을 LiteRT 모델로 변환:TensorFlow 변환기, PyTorch 변환기 또는 JAX 변환기를 사용하여 모델을 FlatBuffers 형식(.tflite)으로 변환하고 LiteRT에서 실행할 수 있습니다. 시작하려면 다음 사이트에서 모델을 찾아보세요.
Android와 iOS 기기에서 하드웨어 가속을 사용하여 성능을 향상할 수 있습니다. 두 플랫폼 모두 GPU 위임을 사용할 수 있으며 iOS에서는 Core ML 위임을 사용할 수 있습니다. 최신 하드웨어 가속기 지원을 추가하려면 자체 위임을 정의하면 됩니다.
모델 유형에 따라 다음과 같은 방법으로 추론을 실행할 수 있습니다.
메타데이터가 없는 모델: LiteRT Interpreter API를 사용합니다.
Java, Swift, C++, Objective-C, Python과 같은 여러 플랫폼과 언어에서 지원됩니다.
메타데이터가 있는 모델: LiteRT 지원 라이브러리를 사용하여 맞춤 추론 파이프라인을 빌드할 수 있습니다.
TF Lite에서 이전
TF Lite 라이브러리를 사용하는 애플리케이션은 계속 작동하지만 모든 새로운 활성 개발 및 업데이트는 LiteRT 패키지에만 포함됩니다. LiteRT API는 TF Lite API와 동일한 메서드 이름을 포함하므로 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-05-26(UTC)"],[],[],null,["# LiteRT overview\n\n| **Note:** LiteRT Next is available in Alpha. The new APIs improve and simplify on-device hardware acceleration. For more information, see the [LiteRT\n| Next documentation](./next/overview).\n\nLiteRT (short for Lite Runtime), formerly known as TensorFlow Lite, is Google's\nhigh-performance runtime for on-device AI. You can find ready-to-run LiteRT\nmodels for a wide range of ML/AI tasks, or convert and run TensorFlow, PyTorch,\nand JAX models to the TFLite format using the AI Edge conversion and\noptimization tools.\n\nKey features\n------------\n\n- **Optimized for on-device machine learning**: LiteRT addresses five key ODML\n constraints: latency (there's no round-trip to a server), privacy (no\n personal data leaves the device), connectivity (internet connectivity is not\n required), size (reduced model and binary size) and power consumption\n (efficient inference and a lack of network connections).\n\n- **Multi-platform support** : Compatible with [Android](./android) and\n [iOS](./ios/quickstart) devices, [embedded\n Linux](./microcontrollers/python), and\n [microcontrollers](./microcontrollers/overview).\n\n- **Multi-framework model options** : AI Edge provides tools to convert models\n from TensorFlow, PyTorch, and JAX models into the FlatBuffers format\n (`.tflite`), enabling you to use a wide range of state-of-the-art models on\n LiteRT. You also have access to model optimization tools that can handle\n quantization and metadata.\n\n- **Diverse language support**: Includes SDKs for Java/Kotlin, Swift,\n Objective-C, C++, and Python.\n\n- **High performance** : [Hardware acceleration](./performance/delegates)\n through specialized delegates like GPU and iOS Core ML.\n\nDevelopment workflow\n--------------------\n\nThe LiteRT development workflow involves identifying an ML/AI problem, choosing\na model that solves that problem, and implementing the model on-device. The\nfollowing steps walk you through the workflow and provides links to further\ninstructions.\n\n### 1. Identify the most suitable solution to the ML problem\n\nLiteRT offers users a high level of flexibility and customizability when it\ncomes to solving machine learning problems, making it a good fit for users who\nrequire a specific model or a specialized implementation. Users looking for\nplug-and-play solutions may prefer [MediaPipe\nTasks](https://ai.google.dev/edge/mediapipe/solutions/tasks), which provides\nready-made solutions for common machine learning tasks like object detection,\ntext classification, and LLM inference.\n\nChoose one of the following AI Edge frameworks:\n\n- **LiteRT**: Flexible and customizable runtime that can run a wide range of models. Choose a model for your use case, convert it to the LiteRT format (if necessary), and run it on-device. If you intend to use LiteRT, keep reading.\n- **MediaPipe Tasks** : Plug-and-play solutions with default models that allow for customization. Choose the task that solves your AI/ML problem, and implement it on multiple platforms. If you intend to use MediaPipe Tasks, refer to the [MediaPipe\n Tasks](https://ai.google.dev/edge/mediapipe/solutions/tasks) documentation.\n\n### 2. Choose a model\n\nA LiteRT model is represented in an efficient portable format known as\n[FlatBuffers](https://google.github.io/flatbuffers/), which uses the `.tflite`\nfile extension.\n\nYou can use a LiteRT model in the following ways:\n\n- **Use an existing LiteRT model:** The simplest approach is to use a LiteRT\n model already in the `.tflite` format. These models do not require any added\n conversion steps. You can find LiteRT models on [Kaggle\n Models](https://www.kaggle.com/models?framework=tfLite).\n\n- **Convert a model into a LiteRT model:** You can use the [TensorFlow\n Converter](./models/convert_tf), [PyTorch\n Converter](./models/convert_pytorch), or [JAX\n converter](./models/convert_jax) to convert models to the FlatBuffers format\n (`.tflite`) and run them in LiteRT. To get started, you can find models on\n the following sites:\n\n - **TensorFlow models** on [Kaggle\n Models](https://www.kaggle.com/models?framework=tensorFlow2) and [Hugging Face](https://huggingface.co/models?library=tf)\n - **PyTorch models** on [Hugging\n Face](https://huggingface.co/models?library=pytorch) and [`torchvision`](https://pytorch.org/vision/0.9/models.html)\n - **JAX models** on [Hugging Face](https://huggingface.co/models?library=jax)\n\nA LiteRT model can optionally include *metadata* that contains human-readable\nmodel descriptions and machine-readable data for automatic generation of pre-\nand post-processing pipelines during on-device inference. Refer to [Add\nmetadata](./models/metadata) for more details.\n\n### 3. Integrate the model into your app\n\nYou can implement your LiteRT models to run inferences completely on-device on\nweb, embedded, and mobile devices. LiteRT contains APIs for\n[Python](https://ai.google.dev/edge/api/tflite/python/tf/lite), [Java and\nKotlin](https://ai.google.dev/edge/api/tflite/java/org/tensorflow/lite/package-summary)\nfor Android, [Swift](https://ai.google.dev/edge/api/tflite/swift/Classes) for\niOS, and [C++](https://ai.google.dev/edge/api/tflite/cc) for micro-devices.\n\nUse the following guides to implement a LiteRT model on your preferred platform:\n\n- [Run on Android](./android/index): Run models on Android devices using the Java/Kotlin APIs.\n- [Run on iOS](./ios/quickstart): Run models on iOS devices using the Swift APIs.\n- [Run on Micro](./microcontrollers/overview): Run models on embedded devices using the C++ APIs.\n\nOn Android and iOS devices, you can improve performance using hardware\nacceleration. On either platform you can use a [GPU\nDelegate](./performance/gpu), and on iOS you can use the [Core ML\nDelegate](./ios/coreml). To add support for new hardware accelerators, you can\n[define your own delegate](./performance/implementing_delegate).\n\nYou can run inference in the following ways based on the model type:\n\n- **Models without metadata** : Use the [LiteRT Interpreter](/edge/litert/inference) API.\n Supported on multiple platforms and languages such as Java, Swift, C++,\n Objective-C and Python.\n\n- **Models with metadata** : You can build custom inference pipelines with the\n [LiteRT Support Library](./android/metadata/lite_support).\n\nMigrate from TF Lite\n--------------------\n\nApplications that use TF Lite libraries will continue to function, but all new\nactive development and updates will only be included in LiteRT packages. The\nLiteRT APIs contain the same method names as the TF Lite APIs, so migrating to\nLiteRT does not require detailed code changes.\n\nFor more information, refer to the [migration guide](./migration).\n\nNext steps\n----------\n\nNew users should get started with the [LiteRT quickstart](./inference). For\nspecific information, see the following sections:\n\n**Model conversion**\n\n- [Convert TensorFlow models](./models/convert_tf)\n- [Convert PyTorch models](./models/convert_pytorch)\n- [Convert PyTorch Generative AI models](./models/edge_generative)\n- [Convert JAX models](./models/convert_jax)\n\n**Platform guides**\n\n- [Run on Android](./android/index)\n- [Run on iOS](./ios/quickstart)\n- [Run on Micro](./microcontrollers/overview)"]]