|
10 | 10 | This software is provided “as is,” without any express or implied warranties. The authors and contributors shall not be held liable for any damages arising from its use. The code may be incomplete or insufficiently tested. Users are solely responsible for evaluating its suitability and assume all associated risks. <br> |
11 | 11 | Note: Contributions are welcome. Please ensure thorough testing before deploying in critical systems. |
12 | 12 |
|
13 | | -## Introduction |
| 13 | +## Introduction |
14 | 14 | This sample helps developers use C++ to build Genie based Open AI compatibility API service on Windows on Snapdragon (WoS), Mobile and Linux platforms. |
15 | 15 |
|
16 | 16 | ## Features |
17 | 17 | • Support LLM on both CPU & NPU [*NEW!*] <br> |
18 | | -• Support both stream and none stream mode <br> |
| 18 | +• Support both stream and none stream mode <br> |
19 | 19 | • Support switching between models <br> |
20 | 20 | • Support customization model <br> |
21 | | -• Support text splitter feature <br> |
22 | | -• Support tools call <br> |
23 | | -• Support enable/disable thinking mode <br> |
24 | | -• Support lora <br> |
25 | | -• Support history feature <br> |
| 21 | +• Support text splitter feature <br> |
| 22 | +• Support tools call <br> |
| 23 | +• Support enable/disable thinking mode <br> |
| 24 | +• Support lora <br> |
| 25 | +• Support history feature <br> |
26 | 26 |
|
27 | 27 | ## GenieAPIService |
28 | 28 | Genie OpenAI Compatible API Service. |
29 | 29 |
|
30 | 30 | This is an OpenAI compatible API service that can be used to access the Genie AI model. |
31 | 31 | This service can be used on multiple platforms such as Android, Windows, Linux, etc. |
32 | 32 |
|
33 | | -### Run the service on WoS: |
| 33 | +### Run the service on WoS: |
34 | 34 | You can also run the batch file from [QAI AppBuilder Launcher](../../../tools/launcher/) to setup the environment automatically. <br> |
35 | 35 | 1. [Setup LLM models](https://github.com/quic/ai-engine-direct-helper/tree/main/samples/genie/python#step-3-download-models-and-tokenizer-files) first before running this service. <br> |
36 | 36 | 2. Download [GenieAPIService](https://github.com/quic/ai-engine-direct-helper/releases/download/v2.38.0/GenieAPIService_v2.1.0_QAIRT_v2.38.0_v73.zip) and copy the subdirectory "GenieAPIService" to path "ai-engine-direct-helper\samples".<br> |
37 | | -3. Run the following commands to launch the Service (Do *not* close this terminal window while service is running). |
| 37 | +3. Run the following commands to launch the Service (Do *not* close this terminal window while service is running). |
38 | 38 |
|
39 | 39 | ``` |
40 | 40 | cd ai-engine-direct-helper\samples |
@@ -67,19 +67,11 @@ INFO: Service Is Ready Now! |
67 | 67 | ## GenieAPIService API: |
68 | 68 | Refere to [API](./API.md) for detailed information. |
69 | 69 |
|
70 | | -## Client Usage: |
71 | | - The service can be access through the ip address '127.0.0.1:8910', it's compatible with OpenAI API. |
72 | | - |
73 | | -### C++ Client Sample Code: |
74 | | - Here is a C++ client sample: [GenieAPIClient.cpp](Service/GenieAPIClient.cpp). You can get the compiled 'GenieAPIClient.exe' from [GenieAPIService](https://github.com/quic/ai-engine-direct-helper/releases/download/v2.38.0/GenieAPIService_v2.1.0_QAIRT_v2.38.0_v73.zip). The sample app depends on the dynamical library 'libcurl.dll' which also included in the 'GenieAPIService' package. |
75 | | - |
76 | | - We can run it with the command below in a new terminal window: |
77 | | -``` |
78 | | -GenieAPIService\GenieAPIClient.exe --prompt "How to fish?" --stream --model "IBM-Granite-v3.1-8B" |
79 | | -``` |
| 70 | +## GenieService & C++ Client usage: |
| 71 | +It is located at [Docs](Service/docs/USAGE.MD) |
80 | 72 |
|
81 | 73 | ### Python Client Sample Code: |
82 | | - Here is a Python client sample (You can save it to 'GenieAPIClient.py'): |
| 74 | +Here is a Python client sample (You can save it to 'GenieAPIClient.py'): |
83 | 75 |
|
84 | 76 | ``` |
85 | 77 | import argparse |
@@ -114,10 +106,10 @@ else: |
114 | 106 | print(response.choices[0].message.content) |
115 | 107 | ``` |
116 | 108 |
|
117 | | - We can run it with the command below in a new terminal window: |
| 109 | +We can run it with the command below in a new terminal window: |
118 | 110 | ``` |
119 | 111 | python GenieAPIClient.py --prompt "How to fish?" --stream |
120 | 112 | ``` |
121 | 113 |
|
122 | 114 | ### More Sample Code |
123 | | -You can find more client sample code [here](../python/README.md#sample-list). |
| 115 | +You can find more client sample code [here](../python/README.md#sample-list). |
0 commit comments