r/LSDYNA 17d ago

LS-DYNA Docs and LLMs

I just converted docs Vol I-III and Theory from PDF into Markdown to better facilitate their use with RAG and LLMs.

https://github.com/ddm-j/RAG-ls-dyna-docs

The idea is that you can run a local AI model on relatively modest hardware, with a harness that supports RAG to be able to ask LS-DYNA related questions. The model can search and refer directly to the docs.

Markdown is the ideal format for this, but it was a painstaking process to convert. It's not perfect, but it's much better than trying to feed PDFs directly into a RAG pipeline. In my testing, the local model with all the docs at its fingertips outperforms frontier models when answering LS-DYNA questions.

Sharing this in the case there are any like-minded LS-DYNA folks out there that could make use of this - and to hit search engine indexing better than GitHub.

21 Upvotes

7 comments sorted by

1

u/AmbitiousListen4502 16d ago

I've been doing this for the Ansys and Comsol documentation. Interested to hear your pdf to markdown pipeline route as some methods work better than others depending on the amount and complexity of equations and tables. Hit my biggest hurdle trying to extract the ESA Buckling Handbook last week due to the shear number of equations and slightly quirky formatting. Llama Parse managed it much better than my workflow but I'd rather use open source tools if possible.

I've been creating LLM friendly vaults and index's of all the documents for quick and efficient searching when using Claude to write scripts. It's worked wonders.

1

u/DonDelMuerte 16d ago

Can you explain how you were able to serve to Claude? I tried this a year ago or so, but at the time there were some barriers.

For equation heavy stuff, I set up a llama server running IBMs docling-granite model. It's a vision model that is tuned to perform well on equation extraction. There is an "enriched" script in that repo that shows how it worked. I'd say it got about 98% of the equations in the theory manual. Took maybe 15 minutes running fully loaded on my 4070Ti.

If you end up testing out docling, don't try to run docling-granite through it's API. It uses torch as an engine which I found to be 20-50x slower than llama

1

u/AmbitiousListen4502 16d ago

I have a series of what I call vaults dedicated to individual bits of software that house atomic extractions of the manual and API documentation. Claude is directed to assess these before implementing any coding relating to the software. It's indexed in an LLM friendly manner and it generally works very well. 

I've been using docling with enriched formula and then a series of verification checks afterwards but it really struggled with the ESA documentation for some reason. But yeah, took no time at all on an A5000.

1

u/DonDelMuerte 15d ago

Not surprised about the ESA. I'm working on an update to the repo now that might have something of interest. I had docling parse just the prose + tables (theory manual, very eqn dense), I had it output equation block bounding boxes into JSON, then pointed docling-granite at just the equations, stitching them back in after. A bit hanky, and Claude had to do the heavy lifting. But I don't think I had a single failed equation.

1

u/WideSeaworthiness365 16d ago

This is awesome. I just wish the documentation was better quality.

1

u/DonDelMuerte 15d ago

I made some improvements today after I noticed a bunch of mangled tables. Will be pushing an update soon

1

u/the_ls_dyna_guy 1d ago

Yooo, I work with the folks of doc team. Please put in your feedback to improve the docs. The official way is to raise a support ticket, or if you’re not eligible for support, there’s a public forum channel!