Skip to content

Commit 4c4621a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a7f9b41 commit 4c4621a

46 files changed

Lines changed: 465 additions & 404 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

EdgeCraftRAG/cli/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,14 @@ The CLI will display error messages from the API in JSON format. Network errors
329329
## Tips
330330

331331
- Use `--help` with any command to see detailed help:
332+
332333
```bash
333334
ecrag pipeline --help
334335
ecrag pipeline create --help
335336
```
336337

337338
- Pipe JSON output to other tools:
339+
338340
```bash
339341
ecrag kb list | jq '.[]' | head -n 20
340342
```

EdgeCraftRAG/cli/client.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
import json
5-
import requests
6-
from typing import Optional, Dict, Any
5+
from typing import Any, Dict, Optional
76
from urllib.parse import urljoin
87

8+
import requests
9+
910

1011
class EcragApiClient:
1112
"""API client for Edge Craft RAG."""
1213

1314
def __init__(self, host: str = "http://localhost", server_port: int = 16010, mega_port: int = 16011):
1415
"""Initialize the API client.
15-
16+
1617
Args:
1718
host: The host URL (default: http://localhost)
1819
server_port: The server port (default: 16010)
@@ -21,10 +22,10 @@ def __init__(self, host: str = "http://localhost", server_port: int = 16010, meg
2122
# Normalize host URL
2223
if not host.startswith(("http://", "https://")):
2324
host = f"http://{host}"
24-
25+
2526
# Remove trailing slash if present
2627
host = host.rstrip("/")
27-
28+
2829
self.server_url = f"{host}:{server_port}"
2930
self.mega_url = f"{host}:{mega_port}"
3031

@@ -170,12 +171,16 @@ def delete_knowledge_base(self, kb_name: str) -> Dict[str, Any]:
170171
def add_files_to_kb(self, kb_name: str, local_paths: list) -> Dict[str, Any]:
171172
"""Add files to a knowledge base."""
172173
url = urljoin(self.server_url, f"/v1/knowledge/{kb_name}/files")
173-
return self._request("POST", url, json={"local_paths": local_paths}, headers={"Content-Type": "application/json"})
174+
return self._request(
175+
"POST", url, json={"local_paths": local_paths}, headers={"Content-Type": "application/json"}
176+
)
174177

175178
def delete_files_from_kb(self, kb_name: str, local_paths: list) -> Dict[str, Any]:
176179
"""Delete files from a knowledge base."""
177180
url = urljoin(self.server_url, f"/v1/knowledge/{kb_name}/files")
178-
return self._request("DELETE", url, json={"local_paths": local_paths}, headers={"Content-Type": "application/json"})
181+
return self._request(
182+
"DELETE", url, json={"local_paths": local_paths}, headers={"Content-Type": "application/json"}
183+
)
179184

180185
# Experience Management
181186
def get_experiences(self) -> Dict[str, Any]:

EdgeCraftRAG/cli/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Copyright (C) 2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
3-
43
"""Configuration for EdgeCraft RAG CLI."""
54

65
import os

EdgeCraftRAG/cli/main.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
import json
5-
import click
65
import os
76
from pathlib import Path
87
from typing import Optional
8+
9+
import click
910
from cli.client import EcragApiClient
1011
from cli.config import get_config
1112

@@ -34,26 +35,26 @@ def run_chatqna_query(client: EcragApiClient, query: str, top_n: int, max_tokens
3435
@click.pass_context
3536
def cli(ctx, host: Optional[str], port: Optional[int], mega_port: Optional[int]):
3637
"""EdgeCraft RAG CLI Tool.
37-
38+
3839
Configure server connection via command-line options or environment variables:
3940
- ECRAG_HOST: Server host (default: http://localhost)
4041
- ECRAG_PORT: Server port (default: 16010)
4142
- ECRAG_MEGA_PORT: Mega service port (default: 16011)
4243
"""
4344
ctx.ensure_object(dict)
44-
45+
4546
# Get defaults from config
4647
config = get_config()
47-
48+
4849
# Use provided options or environment/defaults
4950
final_host = host or config.host
5051
final_port = port or config.port
5152
final_mega_port = mega_port or config.mega_port
52-
53+
5354
# Normalize host URL
5455
if not final_host.startswith(("http://", "https://")):
5556
final_host = f"http://{final_host}"
56-
57+
5758
ctx.obj["client"] = EcragApiClient(host=final_host, server_port=final_port, mega_port=final_mega_port)
5859

5960

EdgeCraftRAG/cli/quickstart.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# Copyright (C) 2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
3-
43
"""Quick start guide for EdgeCraft RAG CLI."""
54

65
import json
76
import sys
7+
88
from cli.client import EcragApiClient
99

1010

1111
def test_connection(host: str = "http://localhost", port: int = 16010):
1212
"""Test connection to EdgeCraft RAG server."""
1313
client = EcragApiClient(host=host, server_port=port)
14-
14+
1515
try:
1616
print(f"Testing connection to {client.server_url}...")
1717
result = client.get_system_info()
18-
18+
1919
if "error" in result:
2020
print(f"❌ Connection failed: {result['error']}")
2121
return False
22-
22+
2323
print("✓ Connection successful!")
2424
print(f" System Info: {json.dumps(result, indent=2)}")
2525
return True
@@ -62,7 +62,7 @@ def quick_start_guide():
6262
export ECRAG_MEGA_PORT=16011
6363
6464
COMMON COMMANDS:
65-
65+
6666
Pipeline Management:
6767
ecrag pipeline list
6868
ecrag pipeline get --name <name>

EdgeCraftRAG/cli/setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#!/usr/bin/env python3
22
# Copyright (C) 2024 Intel Corporation
33
# SPDX-License-Identifier: Apache-2.0
4-
54
"""Canonical setup script for EdgeCraft RAG CLI."""
65

76
from setuptools import setup
87

9-
108
setup(
119
name="ecrag-cli",
1210
version="0.1.0",
@@ -35,4 +33,4 @@
3533
"Programming Language :: Python :: 3.10",
3634
"Programming Language :: Python :: 3.11",
3735
],
38-
)
36+
)

EdgeCraftRAG/docker_compose/intel/gpu/arc/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,22 @@ This section describes how to quickly deploy and test the EdgeCraftRAG service m
2020

2121
### 1. Prerequisites
2222

23-
EC-RAG supports vLLM deployment(default method) and local OpenVINO deployment for Intel Arc GPU and Core Ultra Platform. Prerequisites are shown as below:
23+
EC-RAG supports vLLM deployment(default method) and local OpenVINO deployment for Intel Arc GPU and Core Ultra Platform. Prerequisites are shown as below:
2424

2525
#### Core Ultra
26+
2627
**OS**: Ubuntu 24.04 or newer
2728
**Driver & libraries**: Please refer to [Installing Client GPUs on Ubuntu Desktop](https://dgpu-docs.intel.com/driver/client/overview.html#installing-client-gpus-on-ubuntu-desktop)
2829
**Available Inferencing Framework**: openVINO
2930

3031
#### Intel Arc B60
31-
**OS**: Ubuntu 25.04 Desktop (for Core Ultra and Xeon-W), Ubuntu 25.04 Server (for Xeon-SP).
32+
33+
**OS**: Ubuntu 25.04 Desktop (for Core Ultra and Xeon-W), Ubuntu 25.04 Server (for Xeon-SP).
3234
**Driver & libraries**: Please refer to [Install Bare Metal Environment](https://github.com/intel/llm-scaler/tree/main/vllm#11-install-bare-metal-environment) for detailed setup
3335
**Available Inferencing Framework**: openVINO, vLLM
3436

3537
#### Intel Arc A770
38+
3639
**OS**: Ubuntu Server 22.04.1 or newer (at least 6.2 LTS kernel)
3740
**Driver & libraries**: Please refer to [Installing GPUs Drivers](https://dgpu-docs.intel.com/driver/client/overview.html#ubuntu-22.04) for detailed driver & libraries setup
3841
**Available Inferencing Framework**: openVINO, vLLM
@@ -48,9 +51,9 @@ cd GenAIExamples/EdgeCraftRAG
4851

4952
> **NOTE**: If you want to checkout a released version, such as v1.5:
5053
>
51-
>```
52-
>git checkout v1.5
53-
>```
54+
> ```
55+
> git checkout v1.5
56+
> ```
5457
5558
### 3. Run quick_start.sh
5659

EdgeCraftRAG/docker_compose/intel/gpu/arc/README_zh.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,19 @@
2323
EC-RAG 支持 vLLM 部署(默认方式)以及面向 Intel Arc GPU 和 Core Ultra 平台的本地 OpenVINO 部署。前置条件如下:
2424

2525
#### Core Ultra
26+
2627
**操作系统**:Ubuntu 24.04 或更高版本
2728
**驱动与库**:请参考 [Installing Client GPUs on Ubuntu Desktop](https://dgpu-docs.intel.com/driver/client/overview.html#installing-client-gpus-on-ubuntu-desktop)
2829
**可用推理框架**:openVINO
2930

3031
#### Intel Arc B60
32+
3133
**操作系统**:Ubuntu 25.04 Desktop(适用于 Core Ultra 和 Xeon-W),Ubuntu 25.04 Server(适用于 Xeon-SP)。
3234
**驱动与库**:详细安装请参考 [Install Bare Metal Environment](https://github.com/intel/llm-scaler/tree/main/vllm#11-install-bare-metal-environment)
3335
**可用推理框架**:openVINO、vLLM
3436

3537
#### Intel Arc A770
38+
3639
**操作系统**:Ubuntu Server 22.04.1 或更高版本(至少 6.2 LTS 内核)
3740
**驱动与库**:详细驱动与库安装请参考 [Installing GPUs Drivers](https://dgpu-docs.intel.com/driver/client/overview.html#ubuntu-22.04)
3841
**可用推理框架**:openVINO、vLLM
@@ -48,9 +51,9 @@ cd GenAIExamples/EdgeCraftRAG
4851

4952
> **注意**:如果你想切换到某个发布版本,例如 v1.5:
5053
>
51-
>```
52-
>git checkout v1.5
53-
>```
54+
> ```
55+
> git checkout v1.5
56+
> ```
5457
5558
### 3. 运行 quick_start.sh
5659
@@ -112,11 +115,11 @@ If you are accessing from another machine, replace ${HOST_IP} with your server's
112115

113116
下表全面概述了示例 Docker Compose 文件中各类部署所使用的 EdgeCraftRAG 服务。表中每一行代表一个独立服务,详细说明了可用镜像及其在部署架构中的功能描述。
114117

115-
| 服务名称 | 可选镜像名称 | 可选 | 描述 |
116-
| ------------------- | ---------------------------------------- | ---- | ------------------------------------------------------------------------------------------------ |
117-
| etcd | quay.io/coreos/etcd:v3.5.5 || 提供分布式键值存储,用于服务发现和配置管理。 |
118-
| minio | minio/minio:RELEASE.2023-03-20T20-16-18Z || 提供对象存储服务,用于存储文档和模型文件。 |
119-
| milvus-standalone | milvusdb/milvus:v2.4.6 || 提供向量数据库能力,用于管理 embedding 和相似度检索。 |
120-
| edgecraftrag-server | opea/edgecraftrag-server:latest || 作为 EdgeCraftRAG 服务后端,具体形态随部署方式不同而变化。 |
121-
| edgecraftrag-ui | opea/edgecraftrag-ui:latest || 提供 EdgeCraftRAG 服务的用户界面。 |
122-
| ecrag | opea/edgecraftrag:latest || 作为反向代理,管理 UI 与后端服务之间的流量。 |
118+
| 服务名称 | 可选镜像名称 | 可选 | 描述 |
119+
| ------------------- | ---------------------------------------- | ---- | ---------------------------------------------------------- |
120+
| etcd | quay.io/coreos/etcd:v3.5.5 || 提供分布式键值存储,用于服务发现和配置管理。 |
121+
| minio | minio/minio:RELEASE.2023-03-20T20-16-18Z || 提供对象存储服务,用于存储文档和模型文件。 |
122+
| milvus-standalone | milvusdb/milvus:v2.4.6 || 提供向量数据库能力,用于管理 embedding 和相似度检索。 |
123+
| edgecraftrag-server | opea/edgecraftrag-server:latest || 作为 EdgeCraftRAG 服务后端,具体形态随部署方式不同而变化。 |
124+
| edgecraftrag-ui | opea/edgecraftrag-ui:latest || 提供 EdgeCraftRAG 服务的用户界面。 |
125+
| ecrag | opea/edgecraftrag:latest || 作为反向代理,管理 UI 与后端服务之间的流量。 |

EdgeCraftRAG/docs/API_Guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Edge Craft Retrieval-Augmented Generation API Guide
22

33
> **Base URLs**
4+
>
45
> - EC-RAG Server: `http://${HOST_IP}:16010`
56
> - EC-RAG Mega Service: `http://${HOST_IP}:16011`
67

EdgeCraftRAG/docs/Advanced_Setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ optimum-cli export openvino -m BAAI/bge-reranker-large ${MODEL_PATH}/BAAI/bge-re
4242
#### LLM
4343

4444
##### openVINO
45+
4546
If you have Core Ultra platform only, please prepare openVINO models:
4647
You can also run openVINO models on discrete GPU.
4748

@@ -51,6 +52,7 @@ optimum-cli export openvino --model Qwen/Qwen3-8B ${MODEL_PATH}/OpenVINO/Qwen3-8
5152
```
5253

5354
##### vLLM
55+
5456
Alternatively, if you have discrete GPU and want to use vLLM, please prepare models for vLLM:
5557

5658
```bash
@@ -178,5 +180,3 @@ export TP=4 # for multi GPU, you can change TP value
178180
export ZE_AFFINITY_MASK=0,1,2,3 # for multi GPU, you can export ZE_AFFINITY_MASK=0,1,2...
179181
docker compose --profile b60 -f docker_compose/intel/gpu/arc/compose.yaml up -d
180182
```
181-
182-

0 commit comments

Comments
 (0)