Skip to content

Commit 6edae5f

Browse files
authored
Merge pull request #38 from hemajv/add-milvus
Update llamastack to use in-line milvus
2 parents f70a7d2 + cfbbc62 commit 6edae5f

File tree

3 files changed

+43
-7
lines changed

3 files changed

+43
-7
lines changed

kubernetes/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,43 @@ podman tag localhost/distribution-remote-vllm:dev quay.io/redhat-et/llama:2-27-2
7878
podman push quay.io/redhat-et/llama:2-27-2025
7979
```
8080

81+
## Building Llamastack with Milvus (in-line)
82+
83+
If you need to build Llamastack to use Milvus as the default in-line vector db provider in your container image, you can run the following steps:
84+
85+
```
86+
git clone [email protected]:meta-llama/llama-stack.git
87+
cd llama-stack
88+
89+
# Create the venv to install llamastack locally
90+
python -m venv venv
91+
source venv/bin/activate
92+
pip install -U .
93+
```
94+
95+
Edit the `build.yaml` in the `llama_stack/template/remote-vllm/build.yaml` to update the `vector_io` provider field and `image_type` field as shown below:
96+
97+
```
98+
providers:
99+
vector_io:
100+
- inline::milvus
101+
image_type: container
102+
```
103+
104+
Now, we can build the container.
105+
106+
```
107+
export CONTAINER_BINARY = podman
108+
USE_COPY_NOT_MOUNT=true LLAMA_STACK_DIR=. llama stack build --config llama_stack/templates/remote-vllm/build.yaml --image-type container --image-name remote-vllm-milvus
109+
```
110+
111+
Once the image is built successfully you can push it to quay:
112+
113+
```
114+
podman tag localhost/remote-vllm-milvus:<version tag> quay.io/<quay user name or org name>/<image name>
115+
podman push quay.io/<quay user name or org/<image name>
116+
```
117+
81118
Update the [`deployment.yaml`](https://github.com/redhat-et/agent-frameworks/blob/main/prototype/frameworks/llamastack/kubernetes/llama-stack/deployment.yaml#L28) file using the image generated above.
82119

83120
## Configmap

kubernetes/llama-stack/configmap.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,10 @@ data:
3636
provider_type: inline::sentence-transformers
3737
config: {}
3838
vector_io:
39-
- provider_id: faiss
40-
provider_type: inline::faiss
39+
- provider_id: milvus
40+
provider_type: inline::milvus
4141
config:
42-
kvstore:
43-
type: sqlite
44-
namespace: null
45-
db_path: ${env.SQLITE_STORE_DIR:~/.llama/distributions/remote-vllm}/faiss_store.db
42+
db_path: ${env.MILVUS_DB_PATH}
4643
safety:
4744
- provider_id: llama-guard
4845
provider_type: inline::llama-guard

kubernetes/llama-stack/deployment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ spec:
3333
value: http://otel-collector-collector.observability-hub.svc.cluster.local:4318/v1/traces
3434
- name: OTEL_METRIC_ENDPOINT
3535
value: http://otel-collector-collector.observability-hub.svc.cluster.local:4318/v1/metrics
36-
image: llamastack/distribution-remote-vllm:0.1.8
36+
- name: MILVUS_DB_PATH
37+
value: 'milvus.db'
38+
image: quay.io/redhat-et/llama:vllm-0.1.9
3739
imagePullPolicy: Always
3840
name: llamastack
3941
ports:

0 commit comments

Comments
 (0)