Skip to content

.dstack.yml (service)

A service is a web app accessible from the Internet.

The configuration file name must end with .dstack.yml (e.g., .dstack.yml or service.dstack.yml are both acceptable).

Example

type: service

image: ghcr.io/huggingface/text-generation-inference:latest

env: 
  - MODEL_ID=TheBloke/Llama-2-13B-chat-GPTQ 

port: 80

commands:
  - text-generation-launcher --hostname 0.0.0.0 --port 80 --trust-remote-code

YAML reference

ServiceConfiguration

Property Description Type Default value
type Literal['service'] required
image The name of the Docker image to run Optional[str] None
entrypoint The Docker entrypoint Optional[str] None
home_dir The absolute path to the home directory inside the container str /root
registry_auth Credentials for pulling a private container Optional[RegistryAuth] None
python The major version of Python
Mutually exclusive with the image
Optional[PythonVersion] None
env The mapping or the list of environment variables Union[List[ConstrainedStrValue],Dict[str, str]] {}
setup The bash commands to run on the boot List[str] []
commands The bash commands to run List[str] required
port The port, that application listens to or the mapping Union[ConstrainedIntValue,ConstrainedStrValue,PortMapping] required