# What is the directory that is storing the JniLib files?

**URL:** <https://forum.opensearch.org/t/what-is-the-directory-that-is-storing-the-jnilib-files/23878>\
**Category:** Machine Learning\
**Created:** [March 21, 2025, 5:48pm UTC](https://forum.opensearch.org/t/what-is-the-directory-that-is-storing-the-jnilib-files/23878 "2025-03-21T17:48:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shorrocka](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@shorrocka](https://forum.opensearch.org/u/shorrocka)\
**Post date:** [March 21, 2025, 5:48pm UTC](https://forum.opensearch.org/t/what-is-the-directory-that-is-storing-the-jnilib-files/23878/1 "2025-03-21T17:48:33Z")

</div>

I am trying to get OpenSearch to work with deploying Machine Learning Models but am running into a connection issue from the JVM that runs opensearch, when it trys download any libraries from the djl site it gives an SSL error.  
I can wget any files needed to the server and place them where they need to be but I can’t get the system to recognize the JniLibs file, libdjl\_torch.so.

I was able to get the PyTorch libs by downloading the python package and moving those library files into the directory opensearch/ml\_cache/pytorch/1.13.1-cpu-precxx11-linux-x86\_64 and it sees them and does not try and download them again.

When I put the above JNI file in that directory it still trys to download it giving an SSL error, I also tried renaming it to 0.31.1-libdjl\_torch.so as it seems that is how it gets named when put in the directory and still the file is trying to be downloaded.

Any advice or ideas would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![nateynate](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/nateynate/32/4913_2.png) [@nateynate](https://forum.opensearch.org/u/nateynate)\
**Post date:** [March 21, 2025, 9:24pm UTC](https://forum.opensearch.org/t/what-is-the-directory-that-is-storing-the-jnilib-files/23878/2 "2025-03-21T21:24:55Z")

</div>

Hi @shorrocka -

This might be of some help - [Connecting to externally hosted models - OpenSearch Documentation](https://opensearch.org/docs/latest/ml-commons-plugin/remote-models/index/) - it sounds like you’re trying to pull an externally hosted model. There’s some configuration options that have to be set first, in particular a set of trusted endpoints.

Let me know if that gets you moving in the right direction and we’ll go from there.

Thanks!

---

<div class="post-metadata">

**Author:** ![yeonghyeonKo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/yeonghyeonko/32/8202_2.png) [@yeonghyeonKo](https://forum.opensearch.org/u/yeonghyeonKo)\
**Post date:** [March 27, 2025, 7:10am UTC](https://forum.opensearch.org/t/what-is-the-directory-that-is-storing-the-jnilib-files/23878/3 "2025-03-27T07:10:25Z")

</div>

> [@How can we deploy ML model (.zip) to nodes locally, not via SSL or the firewall](https://forum.opensearch.org/t/how-can-we-deploy-ml-model-zip-to-nodes-locally-not-via-ssl-or-the-firewall/20438):
>
> Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.15.0 (both OpenSearch and its Dashboards) Kubernetes 1.25.6 Controlled by OpenSearch Operator (2.5.1) Describe the issue: PUT /\_cluster/settings { "persistent": { "plugins.ml\_commons.allow\_registering\_model\_via\_url": true } } POST /\_plugins/\_ml/models/\_register { "name": "all-MiniLM-L6-v2", "version": "1.0.0", "description": "test model", "model\_format": "TORCH\_SCRIPT", "model\_group\_id": "03jj2ZABhH7…

I faced the similar issue because of Air-gapped enviromemt. See the above link

---

<div class="post-metadata">

**Author:** ![shorrocka](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@shorrocka](https://forum.opensearch.org/u/shorrocka)\
**Post date:** [March 28, 2025, 7:28pm UTC](https://forum.opensearch.org/t/what-is-the-directory-that-is-storing-the-jnilib-files/23878/4 "2025-03-28T19:28:52Z")

</div>

I followed those steps and they got us almost all the way to where we need to be! Thank you for leading the way!

---

<div class="post-metadata">

**Author:** ![dhrubo](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@dhrubo](https://forum.opensearch.org/u/dhrubo)\
**Post date:** [March 28, 2025, 7:44pm UTC](https://forum.opensearch.org/t/what-is-the-directory-that-is-storing-the-jnilib-files/23878/5 "2025-03-28T19:44:35Z")

</div>

Awesome, @yeonghyeonKo! Would you mind creating a PR in ml-commons with a step-by-step development guide that includes detailed instructions? The community would benefit immensely from this.

---

<div class="post-metadata">

**Author:** ![yeonghyeonKo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/yeonghyeonko/32/8202_2.png) [@yeonghyeonKo](https://forum.opensearch.org/u/yeonghyeonKo)\
**Post date:** [March 29, 2025, 2:33am UTC](https://forum.opensearch.org/t/what-is-the-directory-that-is-storing-the-jnilib-files/23878/6 "2025-03-29T02:33:34Z")

</div>

Sure! @dhrubo I hope it will help others who are not familiar with the same issue.

Have you read [my comment](https://forum.opensearch.org/t/how-can-we-deploy-ml-model-zip-to-nodes-locally-not-via-ssl-or-the-firewall/20438/9) that detours Firewall issues by pre-downloading **pytorch** and **tokenizers** folders and copying them to the `opensearch/data/ml_cache` path in a ML Node?  
(and then defining a docker image for new pods or using docker copy for existing pods)

I think there might be better way instead of the above because it still needs proxy CDN or downloading files from public internet to your air-gapped environments. In my point of view, it’s quite complicated for developers who just want to follow a guide.

@dhrubo If you still think the above way is still valuable, I will create a PR as much detail as in [ml-commons/docs/tutorials at main · opensearch-project/ml-commons · GitHub](https://github.com/opensearch-project/ml-commons/tree/main/docs/tutorials)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [May 28, 2025, 2:34am UTC](https://forum.opensearch.org/t/what-is-the-directory-that-is-storing-the-jnilib-files/23878/7 "2025-05-28T02:34:09Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
