Update LLM model deployment scripts
State: closed | Pull request: yes
Labels: name: stale

# What does this PR do ?

Updated the LLM model conversion and deployment scripts to be in-line with OpenAI standards and for a more streamlined execution process.

**Collection**: NLP

# Changelog 
* Change /v1/completions/ endpoint to /v1/completions to be aligned with OpenAI API specs.
* Update default Triton port to be consistent between deployment and API scripts.
* Set the requested environment variables used by the API in the deployment script.

# Usage
* Deploy an existing `.nemo` model with the following:

```
python3 scripts/deploy/nlp/deploy_triton.py --nemo_checkpoint /path/to/pretrained-model.nemo --tensor_parallelism_size 4 --start_rest_service True --triton_model_name triton-model --model_type mixtral --max_input_len 4096 --max_output_len 8192
```

Then, you can send a query to the service one deployed with:

```
curl -X POST http://0.0.0.0:8080/v1/completions/ -H "Content-Type: application/json" -H "accept: application/json" -d '{"prompt": "User: Write me a story about a baby dragon learning how to fly\nAssistant:", "model": "triton-model"}'
```

# GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

# Before your PR is "Ready for review"
**Pre checks**:
- [x] Make sure you read and followed [Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md)
- [ ] Did you write any new necessary tests?
- [ ] Did you add or update any necessary documentation?
- [ ] Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
  - [ ] Reviewer: Does the PR have correct import guards for all optional libraries?
  
**PR Type**:
- [ ] New Feature
- [x] Bugfix
- [ ] Documentation


<!-- pylint-output-strict-mode-false -->

beep boop 🤖: 🙏 The following files have warnings. In case you are familiar with these, please try helping us to improve the code base.

---

Your code was analyzed with PyLint. The following annotations have been identified:

```
************* Module nemo.deploy.service.rest_model_api
nemo/deploy/service/rest_model_api.py:91:0: C0301: Line too long (155/119) (line-too-long)
nemo/deploy/service/rest_model_api.py:92:0: C0301: Line too long (152/119) (line-too-long)
nemo/deploy/service/rest_model_api.py:23:0: C0115: Missing class docstring (missing-class-docstring)
nemo/deploy/service/rest_model_api.py:41:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/deploy/service/rest_model_api.py:45:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/deploy/service/rest_model_api.py:49:4: C0116: Missing function or method docstring (missing-function-docstring)
nemo/deploy/service/rest_model_api.py:71:0: C0115: Missing class docstring (missing-class-docstring)
nemo/deploy/service/rest_model_api.py:84:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/deploy/service/rest_model_api.py:109:0: C0116: Missing function or method docstring (missing-function-docstring)
nemo/deploy/service/rest_model_api.py:12:0: W0611: Unused Path imported from pathlib (unused-import)
************* Module scripts.deploy.nlp.deploy_triton
scripts/deploy/nlp/deploy_triton.py:394:0: C0301: Line too long (121/119) (line-too-long)
scripts/deploy/nlp/deploy_triton.py:30:0: C0115: Missing class docstring (missing-class-docstring)
scripts/deploy/nlp/deploy_triton.py:49:0: C0116: Missing function or method docstring (missing-function-docstring)
scripts/deploy/nlp/deploy_triton.py:259:0: C0116: Missing function or method docstring (missing-function-docstring)
scripts/deploy/nlp/deploy_triton.py:371:0: C0116: Missing function or method docstring (missing-function-docstring)
scripts/deploy/nlp/deploy_triton.py:378:0: C0116: Missing function or method docstring (missing-function-docstring)

-----------------------------------
Your code has been rated at 9.37/10
```

---

Thank you for improving NeMo's documentation!

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

Bumping this again for a review. Thanks!

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

This PR was closed because it has been inactive for 7 days since being marked as stale.