# Which AI model should I use for writing Rust?
Source: https://ruststudio.org/community/t/156/which-ai-model-should-i-use-for-writing-rust
Author: Ruststudio Team (staff) | Published: 2026-12-05 | Updated: 2026-12-05 | Checked with: Ruststudio source code (core/rs-core/src/ai.rs); no model was tested for this thread
Category: Help and questions | Kind: FAQ | Tags: ai, models, assistant | Views: 0

## Short answer
No model stays best for long, and Ruststudio does not rank them. Pick two or three models you can use, run the same small set of tasks from your own code through each, and compare how often the result compiles, passes tests and handles ownership correctly. Switch when results change.

## Answer
## Answer
Model quality, price and speed change often, so any ranking printed here would be out of date soon. A test on your own code stays valid. The model name is a field in the provider entry (**AI > AI Providers...**), so trying another one means editing one text field, and the presets only suggest a default.

## How to do it
1. Choose a handful of real tasks, small enough to check in minutes:
   - fix a compiler error about borrowing or lifetimes;
   - write tests for a function you wrote;
   - convert a small function from another language;
   - explain a piece of code with unsafe or async.
2. Run the same prompts through each candidate, with the same context.
3. Score each result with checks you can repeat:
   - Does it compile on the first try (`cargo check`)?
   - Do the tests pass?
   - Does it use APIs that exist in the crate versions in your `Cargo.toml`?
   - Did it make the smallest change that solves the problem, or rewrite everything?
   - Does it explain a trade-off honestly, such as when `clone()` is only a shortcut?
4. Note the cost and the waiting time as well. A cheaper, faster model that fixes most errors may serve better than the largest one for everyday work.
5. Repeat after a provider announces a new model. Keep the task list in a file so the comparison is the same each time.

## Things to consider
- A local model (see the thread on Ollama, LM Studio and llama.cpp) is private and free to run but usually weaker on hard ownership problems.
- Several providers can sit in the list at once; use **Use this one** to switch the active provider.
- A very large file or very long chat uses more of the model's context. Start a new chat (**AI > New AI Chat**) when you change topic.

## Common mistakes
- Judging a model by one impressive answer. Ten ordinary tasks tell you more.
- Comparing prompts that differ. Keep the question and the attached context identical.
