Use a local model
Stay organized with collections
Save and categorize content based on your preferences.
Large language models (LLMs) differ in their capabilities. To give you control
and flexibility in AI-assisted software development, Android Studio lets you
choose a local model, running on your personal machine, to power the IDE's AI
functionality.
Choose a model
A local model offers an alternative to the LLM support built into Android
Studio; however, Gemini in Android Studio typically provides the best AI
experience for Android developers because of the powerful Gemini models. You
can select from a variety of Gemini models for your Android development tasks,
including the no-cost default model or models accessed with a paid Gemini API
key.
Local model capability is a great option if you need to work offline, must
adhere to strict company policies on AI tool usage, or are interested in
experimenting with open-source research models.
Try the Gemma 4 model
If you need to use a local model, we recommend trying Gemma 4, a
state-of-the-art local model available for agentic coding in Android Studio.
The hardware requirements are as follows. We recommend using the Gemma 26B MoE
model if you have a high-performance machine.
Model
Total RAM needed
Storage
Gemma E4B
12 GB
4 GB
Gemma 26B MoE
24 GB
17 GB
See the setup guide for instructions on how to download and run Gemma 4
locally on your machine.
Install an LLM provider such as LM Studio or
Ollama on your local computer.
Add the model provider to Android Studio.
Go to Settings > Tools > AI > Model Providers
Select the add icon
Select Local Provider
Enter a description of the model provider (typically the model
provider's name)
Set the port on which the provider is listening
Enable a model
Android Studio settings dialog showing the Gemini section with an option to enable offline mode.
Figure 1. Model provider settings.
Download and install a model of your choice.
See the LM Studio and
Ollama model catalogs. For the best experience
with Agent Mode in Android Studio, select a model that has been trained for
tool use.
Android Studio settings dialog showing a list of available local models.
Figure 2. Available local models.
Start your inference environment.
The inference environment serves your model to local applications. Configure
a sufficiently large context length token window for optimal performance.
For detailed instructions on starting and configuring your environment, see
the Ollama or
LM Studio documentation.
Select a model.
Open Android Studio. Navigate to the Gemini chat window. Use the model
picker to switch from the default Gemini model to your configured local
model.
Android Studio Gemini chat window showing the model picker with options for Gemini and a local model.
Figure 3. Model picker.
After you've connected Android Studio to your local model, you can use the chat
features within the IDE. All interactions are powered entirely by the model
running on your local machine, giving you a self-contained AI development
environment.
Consider performance limitations
A local, offline model typically won't be as performant or intelligent as the
cloud-based Gemini models. Chat responses from local models are usually less
accurate and have higher latency compared to cloud-based models.
Local models are usually not fine-tuned for Android development, and local
models can return responses that are uninformed about the Android Studio user
interface. Some Android Studio AI features and Android development use cases are
nonfunctional with a local model. However, the AI chat feature in Android Studio
is generally supported by local models.
For fast, accurate responses on all aspects of Android development and support
for all Android Studio features, Gemini in Android Studio, powered by the
Gemini models, is your best solution.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026年08月31日 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026年08月31日 UTC."],[],[]]