Skip to main content

Cerebrium

还没翻译译自英文(docs.vllm.ai)本页 14 段都还没译

Cerebrium

vLLM_plus_cerebrium

vLLM can be run on a cloud based GPU machine with Cerebrium, a serverless AI infrastructure platform that makes it easier for companies to build and deploy AI based applications.

To install the Cerebrium client, run:

pip install cerebrium
cerebrium login

Next, create your Cerebrium project, run:

cerebrium init vllm-project

Next, to install the required packages, add the following to your cerebrium.toml:

[cerebrium.deployment]
docker_base_image_url = "nvidia/cuda:12.1.1-runtime-ubuntu22.04"

[cerebrium.dependencies.pip]
vllm = "latest"

Next, let us add our code to handle inference for the LLM of your choice (mistralai/Mistral-7B-Instruct-v0.1 for this example), add the following code to your main.py:

Code

Then, run the following code to deploy it to the cloud:

cerebrium deploy

If successful, you should be returned a CURL command that you can call inference against. Just remember to end the url with the function name you are calling (in our case /run)

Command

You should get a response like:

Response

You now have an autoscaling endpoint where you only pay for the compute you use!