Sign inSign up

johnsnowlabs/jsl-llms

By johnsnowlabs

•Updated about 1 month ago

A LLM Inference server for Johnsnowlabs Medical LLM

Image
1

2.6K

johnsnowlabs/jsl-llms repository overview

This Docker image provides a deployable inference server for medical large language models (LLMs) developed by JohnSnowLabs. Designed for healthcare and medical research applications, this service enables advanced medical AI capabilities with flexible deployment options.

ā šŸ”¬ Supported Medical LLM Models

Model NameParametersTotal MemoryMax Sequence LengthModel SizeMax KV-CacheTensor Parallel Sizes
Medical-Visual-LLM-8B8B~25 GB262K17 GB8 GB1, 2, 4, 8
Medical-LLM-14B14B~40 GB16K27 GB13 GB1, 2
Medical-LLM-Small8B~25 GB262K17 GB8 GB1, 2, 4, 8
Medical-LLM-Medium27B~66 GB262K50 GB16 GB2, 4, 8
Medical-Reasoning-LLM-32B27B~66 GB262K50 GB16 GB2, 4, 8
Medical-Spanish-LLM-24B24B~145 GB128K45 GB100 GB2, 4, 8
Medical-Visual-LLM-30B30B~150 GB262K58 GB92 GB2, 4, 8
Vision-OCR-LLM1B~6 GB32K2 GB4 GB1, 2, 4
Vision-OCR-Structured-LLM7B~32 GB128K16 GB17 GB1, 2, 4

Note: Both Vision-OCR-LLM and Vision-OCR-Structured-LLM must be run with trust_remote_code=True because their model implementations include custom code.

Important Notes

Memory Calculations: All memory calculations are based on half-precision (fp16/bf16) weights. Recommended GPU Memory considers the model size and the maximum key-value cache at the model's maximum sequence length. These calculations follow the guidelines from DJL's LMI Deployment Guide.⁠

ā šŸš€ Quick Start

ā šŸ”„ Pull the Docker Image

You can pull the image from šŸ‘‰ Docker Hub⁠:

docker pull johnsnowlabs/jsl-llms:latest
⁠🐳 Run the Container
⁠Basic Docker Run Command
docker run -d \
    --gpus all \
    --env "SPARK_NLP_LICENSE=your_license_key" \
    -p 8080:8080 \
    --ipc=host \
    johnsnowlabs/jsl-llms \
    --model Medical-LLM-Small \
    --port 8080
⁠Using License File

Mount a license.json file for more secure license management:

docker run -d \
    --gpus all \
    -v "$(pwd)/license.json:/app/license.json" \
    -p 8080:8080 \
    --ipc=host \
    johnsnowlabs/jsl-llms \
    --model Medical-LLM-Small \
    --port 8080

ā āš™ļø Advanced Configuration

For detailed information about available parameters and configuration options, please refer to the official VLLM documentation: šŸ“š VLLM Server Parameters Documentation⁠

⁠Key Parameters to Customize
  • --tensor-parallel-size: Set number of GPUs for tensor parallelism
  • --max-model-len: Maximum sequence length
  • --gpu-memory-utilization: Fraction of GPU memory to be used
⁠Memory Optimization Tips
  • Use smaller sequence lengths to reduce KV-cache memory
  • Leverage tensor parallelism for large models
  • Select an appropriate model based on your GPU resources

⁠🌐 API Endpoints

⁠Health and Monitoring
  • GET /health: Check service health status
  • GET /ping: Quick server ping
  • GET /version: Retrieve server version information
⁠Model Management
⁠List Available Models
  • Endpoint: /v1/models
  • Method: GET
  • Description: Retrieve a list of available models on the server
⁠Model Interactions
⁠Chat Completions
  • Endpoint: /v1/chat/completions
  • Method: POST
  • Example Request:
payload = {
    "model": "Medical-LLM-Small",
    "messages": [
        {"role": "system", "content": "You are a professional medical assistant"},
        {"role": "user", "content": "Explain symptoms of chronic fatigue syndrome"}
    ],
    "temperature": 0.7,
    "max_tokens": 1024
}
⁠Text Completions
  • Endpoint: /v1/completions
  • Method: POST
  • Example Request:
payload = {
    "model": "Medical-LLM-Small",
    "prompt": "Provide a detailed explanation of rheumatoid arthritis treatment",
    "temperature": 0.7,
    "max_tokens": 4096
}

ā šŸ¤ Support

For technical support, inquiries, or enterprise solutions, contact:

ā šŸ“ Licensing

A valid Spark NLP license is required to use this inference server. Licenses can be obtained through JohnSnowLabs.

Tag summary

Content type

Image

Digest

sha256:280d5a61b…

Size

9.3 GB

Last updated

about 1 month ago

docker pull johnsnowlabs/jsl-llms