components/camel-ai/camel-langchain4j-tools/test-execution.md
If ollama is already installed on the system execute the test with
mvn verify -Dollama.endpoint=http://localhost:11434/ -Dollama.model=granite4:tiny-h -Dollama.instance.type=remote
The Ollama docker image is really slow on macbook without nvidia hardware acceleration
The hardware acceleration can be used, and the test can be executed with
mvn verify -Dollama.container.enable.gpu=enabled
To run tests against OpenAI or any OpenAI-compatible endpoint (including local Ollama via its OpenAI-compatible API):
# Using real OpenAI
mvn verify -Dollama.instance.type=openai \
-Dopenai.api.key=sk-your-api-key \
-Dopenai.model=gpt-4o-mini
# Using local Ollama as OpenAI-compatible endpoint
mvn verify -Dollama.instance.type=openai \
-Dopenai.endpoint=http://localhost:11434/v1/ \
-Dopenai.model=granite4:tiny-h \
-Dopenai.api.key=dummy
Available OpenAI properties:
openai.api.key - API key (required for real OpenAI, use "dummy" for Ollama)openai.endpoint - Base URL (defaults to https://api.openai.com/v1/)openai.model - Model name (defaults to gpt-4o-mini)