Skip to content

Commit c4ae8ff

Browse files
authored
Merge pull request #1712 from quarkiverse/#1692
Take OLLAMA_MODELS env var into account in the Dev Service
2 parents 50196a4 + 83458c8 commit c4ae8ff

File tree

2 files changed

+4
-2
lines changed
  • integration-tests/openai
  • model-providers/ollama/deployment/src/main/java/io/quarkiverse/langchain4j/ollama/deployment/devservices

2 files changed

+4
-2
lines changed

integration-tests/openai/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<name>Quarkus LangChain4j - Integration Tests - OpenAI</name>
1111
<properties>
1212
<skipITs>true</skipITs>
13-
<quarkus-langchain4j.version>999-SNAPSHOT</quarkus-langchain4j.version>
13+
<quarkus-langchain4j.version>1.1.1</quarkus-langchain4j.version>
1414
</properties>
1515
<dependencies>
1616
<dependency>

model-providers/ollama/deployment/src/main/java/io/quarkiverse/langchain4j/ollama/deployment/devservices/OllamaContainer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public class OllamaContainer extends org.testcontainers.ollama.OllamaContainer {
4646
super.withLabel(OllamaDevServicesProcessor.DEV_SERVICE_LABEL, OllamaDevServicesProcessor.PROVIDER)
4747
.withStartupTimeout(Duration.ofMinutes(1));
4848

49-
var localOllamaDir = Paths.get(System.getProperty("user.home"), ".ollama").normalize();
49+
// if the OLLAMA_MODELS env var is set, use it - see https://github.com/ollama/ollama/blob/main/docs%2Ffaq.md#how-do-i-configure-ollama-server
50+
var localOllamaDir = (System.getenv("OLLAMA_MODELS") != null ? Paths.get(System.getenv("OLLAMA_MODELS"))
51+
: Paths.get(System.getProperty("user.home"), ".ollama")).normalize();
5052
createLocalOllamaDirIfNeeded(localOllamaDir);
5153

5254
if (Files.isDirectory(localOllamaDir)) {

0 commit comments

Comments
 (0)