3. Connecting your AI model
LatticeMind uses a large language model (LLM) to plan and reason about your calculations. You supply the model through an API key. OpenAI is the default, but Anthropic Claude, Google Gemini, Qwen, and a local Ollama model all work.
Important
The AI model is used only to plan and reason. Your calculations run on the RESCU/NanoDCAL/VASP solver, and your API key is never sent to a remote execution host.
3.1. What LatticeMind sends
To plan and reason about your work, LatticeMind sends requests to the LLM provider you configure (OpenAI by default). Those requests include your prompts, the calculation context it builds from them — structures, generated input decks, and short excerpts of solver logs or errors when it repairs a failed step — and any files you attach. If you turn on web research (off by default), your search queries are sent to the provider’s web-search tool as well.
What is not sent to the AI provider: the calculations themselves. They run on the RESCU/NanoDCAL/VASP solver on your own machine or the remote host you choose, and your API key is never sent to an execution host. The bundled RESCU documentation is consulted locally and never leaves your machine. If you supply a Materials Project key, structure lookups are sent to Materials Project.
Data sent to a provider is handled under that provider’s data policy — review it for retention and training terms. For fully local operation with no external LLM calls, use a local Ollama model (Choosing a provider).
3.2. Where LatticeMind looks for keys
LatticeMind reads a .env file from the folder where you start it, or
plain environment variables. Either works; environment variables win.
Using a .env file (create it in your working folder):
OPENAI_API_KEY=your_key_here
Using an environment variable instead:
export OPENAI_API_KEY="your_key_here" # macOS / Linux
$env:OPENAI_API_KEY="your_key_here" # Windows (PowerShell)
3.3. Choosing a provider
OpenAI is used unless you set RESCU_LLM_PROVIDER. Set the provider and its
matching API key:
Provider |
|
API key variable |
|---|---|---|
OpenAI (default) |
|
|
Anthropic Claude |
|
|
Google Gemini |
|
|
Qwen (DashScope) |
|
|
Local Ollama |
|
none — set |
You can also switch providers at any time from inside the app with
/provider <name>.
3.4. Choosing models
Each provider has a quick (fast, default) model and a thorough (higher-effort) model. The defaults are sensible; override them only if you need to. See Settings & configuration reference for the complete list. A typical OpenAI setup:
RESCU_LLM_PROVIDER=openai
OPENAI_API_KEY=your_key_here
OPENAI_MODEL_QUICK=gpt-5.4-mini # fast / default
OPENAI_MODEL_THOROUGH=gpt-5.4 # higher-effort
Tip
For the most capable planning, point the thorough model at your provider’s strongest model. LatticeMind uses the quick model for routine turns and escalates to the thorough model for harder reasoning.
3.5. Optional: Materials Project
LatticeMind can seed crystal structures from the Materials Project database, which improves structure sourcing for less common materials. Provide a key if you have one:
MATERIALS_PROJECT_API_KEY=your_key_here
3.6. Verifying it works
Start LatticeMind and type a trivial prompt:
What can you do?
If the key is missing or wrong, LatticeMind reports “Provider configuration required” and tells you which variable to set. Otherwise you are ready to build your first project — continue to Licenses and solver executables if you also want to run calculations, or jump to Getting started.