https://github.com/lbdudc/dsl-xpert
This tool provides a web interface to define domain-specific languages and uses large language models (LLM) to interact with those grammars via chat.
https://github.com/lbdudc/dsl-xpert
dsl huggingface langium llm openai webllm
Last synced: 3 months ago
JSON representation
This tool provides a web interface to define domain-specific languages and uses large language models (LLM) to interact with those grammars via chat.
- Host: GitHub
- URL: https://github.com/lbdudc/dsl-xpert
- Owner: lbdudc
- License: mit
- Created: 2024-05-14T09:06:20.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-07-31T10:02:22.000Z (11 months ago)
- Last Synced: 2026-03-28T00:37:58.296Z (3 months ago)
- Topics: dsl, huggingface, langium, llm, openai, webllm
- Language: JavaScript
- Homepage:
- Size: 4.41 MB
- Stars: 16
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DSL-Xpert
  [](https://doi.org/10.1145/3652620.3687782)
This tool provides a web interface to define domain-specific languages and uses large language models (LLM) to interact with those grammars via chat.

It can validate the generated grammar instances while chatting with the LLM using [Langium](http://langium.org/).

It has integrations with:
- **OpenAI** models
- **HuggingFace Inference API**
- **HuggingFace transformers**: running it locally
- [WebLLM](https://webllm.mlc.ai/)
- Connect to any server using **API REST requests**

Then the user can chat with the LLM using the grammar defined.
- [Usage](#usage)
- [Docker](#docker)
- [Standalone server](#standalone-server)
- [HuggingFace custom (only for standalone server)](#huggingface-custom-only-for-standalone-server)
- [API Routes](#api-routes)
- [Author](#author)
- [License](#license)
## Usage
The project can be run in different ways. The following sections describe how to run the project using Docker or as a standalone server.
### Docker
The project can be run using Docker. To do so, execute the following commands:
Prerequisites:
- Docker
- Docker Compose
```sh
docker-compose up
```
This will start tha application it wil run:
- Web App: `http://localhost:5555`
- API: `http://localhost:5555/api`
### Standalone server
The application also can be run without docker, as a standalone application. To do so, execute the following commands:
Prerequisites:
- NVM
- Node.js
- MongoDB
- Python (optional only if the user wants to use the custom huggingface models)
```sh
# (Optional), check the .nvmrc file
# for seeing what is the node version
nvm use
npm install
npm run dev
```
This will start:
- Client at `http://localhost:5173`
- Server at `http://localhost:5173/api`
It will be necessary to have a MongoDB database running, and set the variable in the `.env` file:
```env
MONGODB_URI=mongodb://localhost:27017/llm-dsl-builder
```
### HuggingFace custom (only for standalone server)
We already have added the HuggingFace Custom Server into the `docker-compose.yml` file, so it will be running by default.
But in thr standalone version, the user can run the server using the command:
```sh
npm run dev:pyserver
```
This will start the python server at `ws://localhost:8000/ws`,the client is already configured to interact with this server.
### API Routes
The API provides the following routes:
- `GET /models`: Get all models
- `POST /models`: Create a new model
- `GET /models/:id`: Get a model by id
- `PUT /models/:id`: Update a model by id
- `DELETE /models/:id`: Delete a model by id
## Grammars
The grammars are defined using the Langium syntax. The user can define the grammar in the web interface, and it will be validated using Langium.
Examples can be found in the `/grammars` folder.
## Author
- Victor Lamas
- Email:
- Daniel Garcia-Gonzalez
- Email:
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details