Run Gravity with local models: Ollama and LM Studio
Keep your code on your machine. Connect Gravity to Ollama or LM Studio, pick a coding model that fits your RAM and test the connection.
Gravity does not ship its own model. It talks to whichever OpenAI-compatible provider you configure. That makes one setup especially attractive for people who care about privacy: run the model on your own computer with Ollama or LM Studio, so the prompts and the code in them never leave the machine.
Option 1: Ollama
Install Ollama, then download a coding model. Ollama listens on http://localhost:11434 by default, and Gravity detects a running instance.
ollama pull qwen2.5-coder:7b
In Gravity, open Settings (Ctrl+Comma), choose Ollama, keep the default base URL, select the model and press Test Connection.
Option 2: LM Studio
LM Studio gives you a model manager with a graphical interface and can run a local server. Start the server, which listens on http://localhost:1234 by default, load a model and choose LM Studio in Gravity. No API key is needed for either local option.
Picking a model that fits your machine
The documentation lists these local coding models as a starting point:
- qwen2.5-coder:1.5b: fast, good for simple tasks
- qwen2.5-coder:7b: a balanced choice
- deepseek-coder:6.7b: strong code generation
- codellama:7b: Meta's code-specialised model
- deepseek-coder:33b: the best local quality, and it needs 24 GB or more of RAM
Start small. A 7B model is a reasonable first try on a machine with 8 GB or more, and you can move up if the results are not good enough for your tasks. Smaller models follow multi-step plans less reliably, so keep the first tasks simple and use Review mode to see what they do.
What stays local, and what does not
With a local provider, requests to the model go to your own machine. Gravity itself runs on your computer and works on the files in your workspace. Two things are worth knowing. The Gravity app asks you to sign in to your account at startup. And if you use the web search agent, it fetches pages from the internet, because that is its job. Leave it out of a task when you want the task to stay entirely offline.
Mixing local and cloud
Every provider connection remembers its own URL, key and model, so you can keep a local setup for private code and a cloud connection for the days you need a stronger model. Cloud options include OpenRouter, OpenAI, Groq, Google AI Studio, TogetherAI and GitHub Models, and any other endpoint that speaks the OpenAI-compatible API works as a custom provider.
Gravity is free to download with an account, and the local setup costs nothing beyond your hardware.