Integrating Ollama for Local AI Capabilities
Ollama is a powerful tool that allows you to run large language models locally on your machine. This is particularly useful for leveraging our platform’s AI features, such as AI Analysis and AI Chat, directly from your browser without relying on cloud-based services. By running Ollama locally, you maintain control over your data and can benefit from faster response times for real estate underwriting tasks—depending on your hardware and model choice.
This guide will walk you through:
- Installing Ollama on your machine.
- Choosing and installing AI models suited for real estate analysis.
- Configuring the
OLLAMA_ORIGINSenvironment variable to allow secure communication between your local Ollama instance and our web app hosted athttps://yourdomain.com.
Installing Ollama
Follow the instructions below to install Ollama on your system. Select the tab for your operating system.
Installing Ollama on MacOS
-
Using Homebrew (Recommended):
- If you have Homebrew installed, run the following command in your terminal:
brew install ollama
- If you have Homebrew installed, run the following command in your terminal:
-
Manual Installation:
- Download the Ollama installer from the official Ollama website.
- Open the downloaded
.dmgfile and follow the on-screen instructions to install Ollama.
-
Verify Installation:
- Open a terminal and run:
ollama --version - You should see the installed version of Ollama, confirming a successful installation.
- Open a terminal and run:
Installing Ollama on Windows
-
Download the Installer:
- Visit the official Ollama website and download the Windows installer.
-
Run the Installer:
- Execute the downloaded
.exefile and follow the on-screen instructions to complete the installation.
- Execute the downloaded
-
Verify Installation:
- Open a command prompt and run:
ollama --version - You should see the installed version of Ollama, confirming a successful installation.
- Open a command prompt and run:
Tip: Ensure your system meets the minimum requirements for running Ollama. For more details, refer to the Ollama documentation.
Choosing and Installing AI Models for Real Estate Analysis
After installing Ollama, you need to pull (download) AI models that will power the analysis. Since our users are focused on real estate investments, we recommend models that balance speed and depth of insight. Below are some options, along with their pros and cons.
Comparing Model Sizes and Performance
The model you choose affects how fast it responds and how much power your computer needs. Here’s a breakdown of two popular options:
llama3.2:3b (Smaller Model)
- Size: About 2.0 GB
- Performance: Responds quickly because it’s lightweight. This makes it a great choice if your computer isn’t super powerful (e.g., limited RAM or an older processor).
- Best For: Quick evaluations of underwriting data, like basic cash flow analysis or initial deal screening.
- Trade-Off: It might not catch all the fine details or provide deep insights for more complicated deals.
llama3.3:70b (Larger Model)
- Size: About 43 GB
- Performance: Takes longer to respond because it’s much bigger, but it delivers more detailed and thorough analysis.
- Best For: Complex tasks like in-depth risk assessments, detailed financial modeling, or predicting long-term investment outcomes.
- Trade-Off: Requires a high-performance computer with plenty of storage and memory. If your machine isn’t up to the task, it could run slowly or not work at all.
What This Means for You:
If your computer has limited resources, stick with a smaller model like llama3.2:3b for faster results. If you’ve got a powerful setup and need deeper insights for big deals, llama3.3:70b might be worth the extra wait. You can check your computer’s storage and RAM in your system settings to see what it can handle.
Other Recommended Models
mistral
- Why It’s Great: Known for being fast and efficient, it strikes a nice balance between speed and useful insights.
- Best For: Quick property evaluations or when you need answers fast without overloading your computer.
- Business Benefit: Saves time on initial deal reviews so you can move on promising opportunities faster.
grok
- Why It’s Great: Built for practical, real-world problem-solving—perfect for investment-focused users.
- Best For: Answering specific questions about a deal, like “What’s the risk here?” or “How does this property stack up?”
- Business Benefit: Helps you make smarter, data-driven decisions without getting bogged down in technical details.
Installing a Model
To install a model, open a terminal (or command prompt on Windows) and run:
ollama pull llama3.2:3b
Replace llama3.2:3b with the name of the model you wish to install (e.g., llama3.3:70b, mistral, or grok). You can explore more models on the Ollama model library.
Note: You can list all installed models by running ollama list.
Clarifying “Faster Response Times”
Running Ollama locally can be quicker than using cloud-based AI services because your data doesn’t have to travel over the internet. This saves time, especially for frequent analyses. The actual speed depends on your computer and the model you pick. A smaller model like llama3.2:3b will respond faster than a larger one like llama3.3:70b on the same machine.
Privacy Benefits with DeepSeek
Running a model like DeepSeek locally with Ollama keeps your underwriting data on your own computer. It doesn’t get sent to external servers, ensuring privacy for sensitive real estate information. To use DeepSeek, install it with Ollama:
ollama pull deepseek
Configuring Ollama Origins
Since our web app is hosted at https://yourdomain.com and Ollama runs locally on your machine, you must configure the OLLAMA_ORIGINS environment variable. This variable allows Ollama to accept requests from our web app’s domain, ensuring secure communication.
Setting the Environment Variable Persistently
Follow the instructions below to set OLLAMA_ORIGINS at the machine level, ensuring it persists across sessions. Select the tab for your operating system.
MacOS Instructions
- Open your terminal.
- Append the following line to your shell configuration file (Zsh is the default on MacOS):
echo 'export OLLAMA_ORIGINS="https://yourdomain.com"' >> ~/.zshrc - Apply the changes immediately by running:
source ~/.zshrc - Restart Ollama to ensure the new configuration takes effect.
Note: If you’re using Bash instead of Zsh, replace ~/.zshrc with ~/.bash_profile or ~/.bashrc.
Windows Instructions
- Open PowerShell as an administrator.
- Set the environment variable at the machine level:
[Environment]::SetEnvironmentVariable("OLLAMA_ORIGINS", "https://yourdomain.com", "Machine") - Restart Ollama to apply the changes.
Note: Setting the variable at the machine level ensures it persists across sessions and is available to all users.
Important: Replace https://yourdomain.com with the actual domain where your web app is hosted. If your app is hosted on multiple domains or subdomains, include them as a comma-separated list (e.g., "https://yourdomain.com,https://staging.yourdomain.com").
Using Ollama with Our Platform
Once Ollama is installed, models are pulled, and OLLAMA_ORIGINS is configured, you can use our platform’s AI features directly from your browser. Ensure that Ollama is running locally on your machine when accessing these features.
- AI Analysis: Provides a detailed, static report based on your underwriting data. Learn more.
- AI Chat: An interactive tool for asking specific questions about your deal (coming soon). Learn more.
Our platform will automatically detect and connect to your local Ollama instance, enabling powerful AI-driven insights tailored to your real estate investments.
Tip: Keep Ollama updated and periodically check for model updates to ensure optimal performance.
Additional Notes
- Security: Only include trusted domains in
OLLAMA_ORIGINSto maintain the security of your local Ollama instance. - Troubleshooting: If you encounter issues with Ollama not being detected, ensure that it is running and that the
OLLAMA_ORIGINSvariable is correctly set.
For further assistance, refer to the Ollama documentation or our AI Setup Guide.