Skip to content

Commit 024384f

Browse files
authored
Update dev.md (#1939)
* Update dev.md * Create dev-ai-chat.md * Update maven.yml * Update maven.yml
1 parent 9ee999d commit 024384f

File tree

3 files changed

+94
-3
lines changed

3 files changed

+94
-3
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
# test against latest update of each major Java version, as well as specific updates of LTS versions:
2424
RUNTIME: [ol, wlp]
2525
RUNTIME_VERSION: [25.0.0.9,25.0.0.10]
26-
java: [25, 21, 17, 11, 8]
26+
java: [25, 21, 17]
2727
exclude:
2828
- java: 8
2929
RUNTIME: wlp
@@ -95,7 +95,7 @@ jobs:
9595
# test against latest update of each major Java version, as well as specific updates of LTS versions:
9696
RUNTIME: [ol, wlp]
9797
RUNTIME_VERSION: [ 25.0.0.9,25.0.0.10 ]
98-
java: [ 25, 21, 17, 11, 8 ]
98+
java: [ 25, 21, 17 ]
9999
exclude:
100100
- java: 8
101101
RUNTIME: wlp

docs/dev-ai-chat.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
### dev-ai-chat
2+
3+
-----
4+
5+
#### For development:
6+
7+
Do the following to build the ci.common `99.0.0-SNAPSHOT`
8+
```
9+
git clone git@github.com:OpenLiberty/ci.common.git -b dev-ai-chat
10+
cd ci.common
11+
./mvnw clean install
12+
```
13+
and do the following to build the ci.maven `99.0.0-SNAPSHOT`
14+
```
15+
git clone git@github.com:OpenLiberty/ci.maven.git -b dev-ai-chat
16+
cd ci.maven
17+
./mvnw clean install
18+
```
19+
20+
21+
#### Prerequisites
22+
23+
- Download and install [Ollama](https://ollama.com/download).
24+
- see the [README.md](https://github.com/ollama/ollama/blob/main/README.md#ollama).
25+
- Pull the following model.
26+
- `ollama pull gpt-oss`
27+
- Update the Liberty Maven Plugin version to `99.0.0-SNAPSHOT` in your Maven `pom.xml` project file.
28+
29+
#### Usages
30+
31+
After you start dev mode, you will see
32+
```
33+
[INFO] ************************************************************************
34+
[INFO] * Liberty is running in dev mode.
35+
[INFO] * Automatic generation of features: [ Off ]
36+
[INFO] * a - toggle the AI mode, type 'a' and press Enter.
37+
[INFO] * h - see the help menu for available actions, type 'h' and press Enter.
38+
[INFO] * q - stop the server and quit dev mode, press Ctrl-C or type 'q' and press Enter.
39+
[INFO] * Liberty server port information:
40+
[INFO] * Liberty server HTTP port: [ 9080 ]
41+
[INFO] * Liberty server HTTPS port: [ 9443 ]
42+
[INFO] * Liberty debug port: [ 7777 ]
43+
[INFO] ************************************************************************
44+
```
45+
46+
Press `a` and `Enter` keys to toggle the AI mode on or off.
47+
48+
When you turn it on, by default, the Ollama base URL `http://localhost:11434` and the `gpt-oss` model will be connected.
49+
50+
When the connection is established, you will see the following help:
51+
```
52+
[INFO] ************************************************************************
53+
[INFO] *
54+
[INFO] * AI information:
55+
[INFO] * model: gpt-oss
56+
[INFO] *
57+
[INFO] * To start a multi-line message, type in [ and press Enter.
58+
[INFO] * To end the multi-line message, type in ] and press Enter.
59+
[INFO] * To clear the multi-line message, press Ctrl+X followed by Ctrl+K.
60+
[INFO] * Reset chat session - type in reset chat and press Enter.
61+
[INFO] * View a previous message - press Up/Down arrow key.
62+
[INFO] *
63+
[INFO] ************************************************************************
64+
```
65+
66+
When you type in any message that is not any hotkey such as `a`, `g`, `h`, `q`, or `r` ...etc., the message will be chatted with the Ollama model. For example:
67+
```
68+
What is LLM?
69+
70+
┌───────────────────────────────────────────────────────────────────────────────
71+
72+
LLM stands for Large Language Model—a type of artificial‑intelligence model trained on vast amounts of text to generate, interpret, or manipulate natural language.
73+
74+
Source: Wikipedia – Large language model (https://en.wikipedia.org/wiki/Large\_language\_model)
75+
76+
└───────────────────────────────────────────────────────────────────────────────
77+
```
78+
79+
#### Override the Ollama setting
80+
81+
To override the Ollama base URL, start the dev mode with the `ollama.base.url` system property:
82+
```
83+
./mvnw -Dollama.base.url=<an Ollama URL> liberty:dev
84+
```
85+
86+
To override the Ollama model, start the dev mode with the `chat.model.id` system property:
87+
```
88+
./mvnw -Dchat.model.id=devstral:latest liberty:dev
89+
```

docs/dev.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
Start a Liberty instance in dev mode. This goal also invokes the `create`, `install-feature`, and `deploy` goals before starting the runtime. **Note:** This goal is designed to be executed directly from the Maven command line.
66

7-
Starting in version 3.6.1, dev mode invokes the `generate-features` goal when the `generateFeatures` configuration parameter is set to `true`. **This goal modifies the source configuration directory of your application.** See [generate-features](generate-features.md) for details. The default value for the `generateFeatures` parameter is `false`. When auto-generation of features is turned on, dev mode has a runtime dependency on IBM WebSphere Application Server Migration Toolkit for Application Binaries, which is separately licensed under IBM License Agreement for Non-Warranted Programs. For more information, see the [license](https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/wamt).
7+
Starting in version 99.0.0-SNAPSHOT, you can chat with Ollama model in dev mode. See [dev-ai-chat](dev-ai-chat.md) for details.
8+
9+
Starting in version 3.6.1, dev mode invokes the `generate-features` goal when the `generateFeatures` configuration parameter is set to `true`. **This goal modifies the source configuration directory of your application.** See [generate-features](generate-features.md) for details. The default value for the `generateFeatures` parameter is `false`. When auto-generation of features is turned on, dev mode has a runtime dependency on IBM WebSphere Application Server Migration Toolkit for Application Binaries, which is separately licensed under IBM License Agreement for Non-Warranted Programs. For more information, see the [license](https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/wamt).
810

911
Additionally, starting in version 3.5.2, [resource variable filtering](https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html) and [WAR overlays](https://maven.apache.org/plugins/maven-war-plugin/overlays.html) are supported for loose WAR applications. This is done by automatically detecting appropriate Maven WAR plugin configuration and calling the WAR plugin's [`exploded`](https://maven.apache.org/plugins/maven-war-plugin/exploded-mojo.html) goal and the Maven Resource plugin's [`resource`](https://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html) goal when appropriate. Behavior for updating/deleting resources can be configured via the [`outdatedCheckPath`](https://maven.apache.org/plugins/maven-war-plugin/exploded-mojo.html#outdatedCheckPath) parameter introduced and then enhanced in maven-war-plugin versions 3.3.1, 3.3.2.
1012

0 commit comments

Comments
 (0)