To use the chat feature with a local LLM deployment:
-
Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh -
Start Ollama:
ollama serve
-
Pull a model (in a separate terminal):
ollama pull llama2
You can also try other models like:
ollama pull qwen:0.5b # or ollama pull phi -
Update application.properties (if needed):
llm.api.url=http://localhost:11434/v1/chat/completions llm.api.key= llm.api.model=llama2 # or the model you pulled
-
Start the application and test the chat feature
If you encounter issues with Ollama:
- Check if Ollama is running with
ps aux | grep ollama - Verify the model is downloaded with
ollama list - Check Ollama logs for errors
- The application will fall back to simulated responses if Ollama is unavailable
If you prefer not to run a local LLM, you can use alternative API endpoints by updating the application.properties file:
# ChatAnywhere API (may require VPN access)
llm.api.url=https://api.chatanywhere.com.cn/v1/chat/completions
llm.api.key=your_api_key_here
llm.api.model=gpt-3.5-turboTo run the application:
cd ~/repos/devinPractice/devin
mvn spring-boot:runThe application will be available at http://localhost:8081