Configure Your Model
A quick default
Midscene requires a multimodal model to operate the UI. If you just want to get running, use the environment variables in the example below.
Midscene drives the UI with a multimodal model. Set these environment variables to get started. The example below uses Qwen3.x via OpenRouter — it is easy to obtain and a solid default:
For all supported models and the different ways to set environment variables, read on.
Supported models
The following models are officially supported by Midscene. When configuring a model, in addition to the Base URL, API key, and model name typically required by an LLM, declare the correct MIDSCENE_MODEL_FAMILY to identify the model family and get the best compatibility.
- For models from the same provider, prioritize newer versions. They generally offer a better overall balance of quality, speed, and pricing; avoid spending too much tuning effort on older versions.
- Models from different providers can vary significantly in quality, speed, and pricing. Run a small comparison using representative tasks, then choose the best fit for your use case.
- Midscene supports multi-model collaboration. One default model is usually enough for UI localization and interactions, but configuring separate Planning and Insight models lets you use different models for their strengths in performance, cost, and more, for a better overall result. For more information, see Advanced: Multi-model Collaboration.
Doubao Seed Series
- Common model provider: Volcano Engine
Environment variable configuration example, using doubao-seed-2.1-turbo:
If your Volcano Engine account has fast tier quota enabled, add the extra request body below to use it. This usually improves model response speed by about 30%-50%.
For compatibility with existing configurations, MIDSCENE_MODEL_FAMILY="doubao-vision" remains supported. New configurations should use doubao-seed.
Qwen Series
- Common model provider: Alibaba Cloud
Environment variable configuration example, using qwen3.7-plus:
Google Gemini Series
- Common model provider: Google Gemini
Environment variable configuration example, using gemini-3.5-flash:
OpenAI GPT Series
- Common model provider: OpenAI
Environment variable configuration example, using gpt-5.5:
You can also use GPT through Use Codex App Server (OAuth, no API Key).
- For UI localization with GPT, Midscene currently supports
gpt-5.4and later models. To get the best localization quality, image requests need"detail": "original". According to OpenAI, this option is available ongpt-5.4and future models, while smaller GPT-5 variants such asgpt-5.4-miniandgpt-5.4-nano, as well as older models, do not supportoriginaland will fail if you send it. See the Images and Vision guide and the Computer use guide. - According to OpenAI, GPT-5 may still struggle with non-Latin text and with text that is too small in the image. See the Images and Vision guide.
- In the computer use guide, OpenAI says they observe good performance around
1440x900and1600x900. We recommend adjusting screenshot sizes accordingly. In Midscene, you can control screenshot compression withscreenshotShrinkFactorin the agent options. For browser automation, you can also control the page size and scale through the browserviewport. - With Azure OpenAI, Azure may not handle
"detail": "original"correctly, causing click-coordinate offsets. See Clicks are offset when using Azure OpenAI. - If you use an older GPT-5 model, we recommend using it only as the planning model and pairing it with another multimodal model for localization. See the multi-model combination example.
Midscene disables model-native thinking by default for the best execution speed and stability. To turn it on for any of the models above, set MIDSCENE_MODEL_REASONING_ENABLED="true". Some families accept extra controls such as MIDSCENE_MODEL_REASONING_BUDGET and MIDSCENE_MODEL_REASONING_EFFORT. See Model-Native Thinking Mode.
Moonshot Kimi Series
- Common model provider: Moonshot AI platform
Environment variable configuration example, using kimi-k3:
Xiaomi MiMo Series
- Common model provider: Xiaomi MiMo API Open Platform
Environment variable configuration example, using mimo-v2.5:
Zhipu GLM-V Series
- Common model providers: Z.AI (Global), BigModel (CN)
Environment variable configuration example, using glm-5v-turbo:
Learn more about the open-source GLM-4.6V model
- Github: https://github.com/zai-org/GLM-V
- Hugging Face: https://huggingface.co/zai-org/GLM-4.6V
Ways to set environment variables
Midscene reads all model configuration from environment variables. Below are common approaches, but feel free to adopt any method used in your project.
Method 1: Set variables in the system
The Midscene Chrome extension also accepts this
export KEY="value"format.
Method 2: Create a .env file (for CLI tools)
Create a .env file in the directory where you run the project. Midscene CLI tools load this file automatically.
Keep in mind:
- You do not need to prefix each line with
export. - Only the Midscene CLI automatically reads this file. For the JavaScript SDK, load it manually as shown below.
Method 3: Load variables via dotenv
Dotenv is a zero-dependency npm package that loads variables from .env into Node.js process.env.
Our demo project uses this method.
Create a .env file in the project root and add (no export prefix):
Import dotenv in your script; it will read .env automatically:
Other Compatible Models
The following are smaller-parameter models compatible with Midscene and designed for automation scenarios. Their smaller size lowers hardware requirements for deployment, but they may be limited when handling complex tasks or large page screenshots. Evaluate them against your tasks and deployment constraints before choosing a model.
Zhipu AutoGLM Series
Zhipu AutoGLM is an open-source mobile UI automation model (9B parameters) from Zhipu AI.
After obtaining an API key from Z.AI (Global) or BigModel (CN), configure:
About MIDSCENE_MODEL_FAMILY Configuration
AutoGLM provides two model versions, distinguished by MIDSCENE_MODEL_FAMILY:
auto-glm- Corresponds to AutoGLM-Phone-9B, optimized for Chinese mobile applicationsauto-glm-multilingual- Corresponds to AutoGLM-Phone-9B-Multilingual, supports English and other languages
Choose the appropriate version based on your application language.
AutoGLM is best suited for mobile interactions and operations. If you need to use aiAssert, aiQuery, or other APIs requiring page understanding/assertions, you should configure separate MIDSCENE_INSIGHT_MODEL_... environment variables to let an independent Insight model handle page comprehension. See Model Strategy for more information about multi-model configuration.
Learn more about Zhipu AutoGLM
- Github: https://github.com/zai-org/Open-AutoGLM
- Hugging Face: https://huggingface.co/zai-org/AutoGLM-Phone-9B
UI-TARS Series
Use the deployed doubao-1.5-ui-tars on Volcano Engine:
About MIDSCENE_MODEL_FAMILY
This variable selects the UI-TARS version. Supported values:
vlm-ui-tars– for the 1.0 releasevlm-ui-tars-doubao– for the 1.5 release deployed on Volcano Engine (equivalent tovlm-ui-tars-doubao-1.5)vlm-ui-tars-doubao-1.5– for the 1.5 release deployed on Volcano Engine
The legacy configurations MIDSCENE_USE_VLM_UI_TARS=DOUBAO or MIDSCENE_USE_VLM_UI_TARS=1.5 are still supported but deprecated. Please migrate to MIDSCENE_MODEL_FAMILY.
Migration mapping:
MIDSCENE_USE_VLM_UI_TARS=1.0→MIDSCENE_MODEL_FAMILY="vlm-ui-tars"MIDSCENE_USE_VLM_UI_TARS=1.5→MIDSCENE_MODEL_FAMILY="vlm-ui-tars-doubao-1.5"MIDSCENE_USE_VLM_UI_TARS=DOUBAO→MIDSCENE_MODEL_FAMILY="vlm-ui-tars-doubao"
Multi-model combination example
For more information on combining multiple models, see Advanced: Multi-model Collaboration.
Below is an example using GPT-5.4 for Planning/Insight and Qwen 3.5 for vision. Use GPT-5.4 for Planning and/or Insight to handle heavy reasoning, while Qwen 3.5 focuses on visual grounding. You can enable either role or both—toggle them based on your workload.
More
For additional, advanced model settings, see All configuration options.
Troubleshooting model service connectivity issues
Midscene includes a built-in model verify command for troubleshooting model service connectivity issues and basic compatibility issues.
Put your model configuration in a .env file, then run the following model verify command to verify whether the current model configuration can support Midscene:
The command reads the .env file in the current working directory. Dotenv debug logging is enabled by default, and values from .env override existing shell environment variables.
To isolate basic model service connectivity issues, you can also run the following minimal curl request.

