Skip to content

Commit

Permalink
feat: add ollama
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular2Guy committed Dec 13, 2023
1 parent f2d9f14 commit 5faba25
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.experimental.ai:spring-ai-openai-spring-boot-starter:0.7.1-SNAPSHOT'
implementation 'org.springframework.experimental.ai:spring-ai-tika-document-reader:0.7.1-SNAPSHOT'
implementation 'org.springframework.experimental.ai:spring-ai-pgvector-store:0.7.1-SNAPSHOT'
implementation 'org.liquibase:liquibase-core'
Expand All @@ -45,6 +44,12 @@ dependencies {
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'com.tngtech.archunit:archunit-junit5:1.1.0'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

if(project.hasProperty('useOllama') {
implementation 'org.springframework.experimental.ai:spring-ai-ollama:0.7.1-SNAPSHOT'
} else {
implementation 'org.springframework.experimental.ai:spring-ai-openai-spring-boot-starter:0.7.1-SNAPSHOT'
}
}

bootJar {
Expand Down
1 change: 1 addition & 0 deletions backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ server.servlet.session.timeout=30s

spring.jackson.parser.allow-unquoted-control-chars=true
spring.ai.openai.api-key=${OPENAI-API-KEY:23418pajkfdsadlöa}
spring.ai.ollama.base-url=${OLLAMA-BASE-URL:http://localhost:11434}
1 change: 1 addition & 0 deletions buildDocker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
#./gradlew clean build -PwithAngular=true -PuseChromium=true -PuseOllama=true
#./gradlew clean build -PwithAngular=true -PuseChromium=true
./gradlew clean build -PwithAngular=true
docker build -t angular2guy/aidocumentlibrarychat:latest --build-arg APP_FILE=build/libs/angularAndSpringWithMaps.jar --no-cache .
Expand Down
2 changes: 1 addition & 1 deletion runOllama.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
docker start ollama
docker stop ollama
docker exec -it ollama ollama run orca2:13b
#docker exec -it ollama ollama run orca2:13b
docker exec -it ollama ollama run stable-beluga:13b

0 comments on commit 5faba25

Please sign in to comment.