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.
It has integrations with:
- OpenAI models
- HuggingFace Inference API
- HuggingFace transformers: running it locally
- WebLLM
- Connect to any server using API REST requests
Then the user can chat with the LLM using the grammar defined.
The project can be run in different ways. The following sections describe how to run the project using Docker or as a standalone server.
The project can be run using Docker. To do so, execute the following commands:
Prerequisites:
- Docker
- Docker Compose
docker-compose up
This will start tha application it wil run:
- Web App:
http://localhost:5555
- API:
http://localhost:5555/api
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)
# (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:
MONGODB_URI=mongodb://localhost:27017/llm-dsl-builder
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:
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.
The API provides the following routes:
GET /models
: Get all modelsPOST /models
: Create a new modelGET /models/:id
: Get a model by idPUT /models/:id
: Update a model by idDELETE /models/:id
: Delete a model by id
-
Victor Lamas
- Email: victor.lamas@udc.es
-
Daniel Garcia-Gonzalez
- Email: d.garcia2@udc.es
This project is licensed under the MIT License - see the LICENSE.md file for details