diff --git a/.doc/diagram.png b/.doc/diagram.png index 34a9969..8aef66a 100644 Binary files a/.doc/diagram.png and b/.doc/diagram.png differ diff --git a/.github/workflows/ci-chat-server.yml b/.github/workflows/ci-chat-server.yml index 1e07f52..59516b8 100644 --- a/.github/workflows/ci-chat-server.yml +++ b/.github/workflows/ci-chat-server.yml @@ -22,6 +22,7 @@ jobs: uses: actions/checkout@v5 - name: Ollama cache + if: false # ollama disabled in this branch uses: actions/cache@v4 with: path: ./chat-server/.ollama @@ -42,4 +43,5 @@ jobs: run: ./gradlew build --no-daemon --info - name: Ollama cache permissions + if: false # ollama disabled in this branch run: sudo chown -R $USER:$USER ./chat-server/.ollama diff --git a/chat-server/build.gradle.kts b/chat-server/build.gradle.kts index 7b6f31d..a9d33a5 100644 --- a/chat-server/build.gradle.kts +++ b/chat-server/build.gradle.kts @@ -32,11 +32,11 @@ dependencies { implementation("org.springframework.ai:spring-ai-advisors-vector-store") // ollama - implementation("org.springframework.ai:spring-ai-starter-model-ollama") + // implementation("org.springframework.ai:spring-ai-starter-model-ollama") // bedrock - // implementation("org.springframework.ai:spring-ai-starter-model-bedrock") - // implementation("org.springframework.ai:spring-ai-starter-model-bedrock-converse") + implementation("org.springframework.ai:spring-ai-starter-model-bedrock") + implementation("org.springframework.ai:spring-ai-starter-model-bedrock-converse") implementation("org.springframework.ai:spring-ai-starter-vector-store-pgvector") runtimeOnly("org.postgresql:postgresql") diff --git a/chat-server/docker-compose.yml b/chat-server/docker-compose.yml index 8b7276a..1c44441 100644 --- a/chat-server/docker-compose.yml +++ b/chat-server/docker-compose.yml @@ -10,6 +10,8 @@ services: ollama: image: ollama/ollama:0.12.3 + profiles: + - disabled # ollama disabled in this branch volumes: - ./.ollama:/root/.ollama ports: diff --git a/chat-server/src/main/resources/application-bedrock.yml b/chat-server/src/main/resources/application-bedrock.yml new file mode 100644 index 0000000..50a190a --- /dev/null +++ b/chat-server/src/main/resources/application-bedrock.yml @@ -0,0 +1,21 @@ +spring: + ai: + model: + embedding: "bedrock-cohere" + chat: "bedrock-converse" + bedrock: + aws: + access-key: "${AWS_ACCESS_KEY_ID}" + secret-key: "${AWS_SECRET_ACCESS_KEY}" + region: "${AWS_REGION:eu-central-1}" + converse: + chat: + options: + model: "${AWS_BEDROCK_CHAT_MODEL}" + cohere: + embedding: + model: "${AWS_BEDROCK_EMBEDDING_MODEL}" + vectorstore: + pgvector: + dimensions: 1024 + initialize-schema: true diff --git a/chat-server/src/main/resources/application.yml b/chat-server/src/main/resources/application.yml index 6e20479..6bb5a5a 100644 --- a/chat-server/src/main/resources/application.yml +++ b/chat-server/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - active: "ollama" + active: "bedrock" application: name: chat-server datasource: diff --git a/chat-server/src/test/kotlin/com/rogervinas/ChatServerApplicationTest.kt b/chat-server/src/test/kotlin/com/rogervinas/ChatServerApplicationTest.kt index d71cf3f..be289b8 100644 --- a/chat-server/src/test/kotlin/com/rogervinas/ChatServerApplicationTest.kt +++ b/chat-server/src/test/kotlin/com/rogervinas/ChatServerApplicationTest.kt @@ -36,9 +36,10 @@ import java.util.UUID @SpringBootTest(webEnvironment = RANDOM_PORT) -@ActiveProfiles("test", "ollama") +@ActiveProfiles("test", "bedrock") @TestMethodOrder(MethodOrderer.OrderAnnotation::class) @Testcontainers +@DisabledIfCI class ChatServerApplicationTest { companion object { @@ -47,7 +48,7 @@ class ChatServerApplicationTest { val container = ComposeContainer(File("docker-compose.yml")) .withLocalCompose(true) .withExposedService("vectordb", 5432, forLogMessage(".*database system is ready to accept connections.*", 1)) - .withExposedService("ollama", 11434, forLogMessage(".*inference compute.*", 1)) + // .withExposedService("ollama", 11434, forLogMessage(".*inference compute.*", 1)) } @Autowired