class_docstr: High-level API client for interacting with dstack server
  
  Attributes:
      runs: Operations with runs.
      repos: Operations with repositories.
      backends: Operations with backends.
class_docstr_tok: ["High-level","API","client","for","interacting","with","dstack","server","Attributes",":","runs",":","Operations","with","runs",".","repos",":","Operations","with","repositories",".","backends",":","Operations","with","backends","."]
docstr: Creates a Client using the default configuration from `~/.dstack/config.yml` if it exists.
  
  Args:
      project_name: The name of the project, required if `server_url` and `user_token` are specified
      server_url: The dstack server URL (e.g. `http://localhost:3000/` or `https://cloud.dstack.ai`)
      user_token: The dstack user token
      ssh_identity_file: The private SSH key path for SSH tunneling
  
  Returns:
      A client instance
docstr_tok: ["Creates","a","Client","using","the","default","configuration","from","`","~\/.dstack\/config.yml","`","if","it","exists",".","Args",":","project_name",":","The","name","of","the","project",",","required","if","`","server_url","`","and","`","user_token","`","are","specified","server_url",":","The","dstack","server","URL","(","e.g",".","`","http",":","\/\/localhost:3000\/","`","or","`","https",":","\/\/cloud.dstack.ai","`",")","user_token",":","The","dstack","user","token","ssh_identity_file",":","The","private","SSH","key","path","for","SSH","tunneling","Returns",":","A","client","instance"]
code: def from_config(
      project_name: Optional[str] = None,
      server_url: Optional[str] = None,
      user_token: Optional[str] = None,
      ssh_identity_file: Optional[PathLike] = None,
  ) -> "Client":
      """
      Creates a Client using the default configuration from `~/.dstack/config.yml` if it exists.
  
      Args:
          project_name: The name of the project, required if `server_url` and `user_token` are specified
          server_url: The dstack server URL (e.g. `http://localhost:3000/` or `https://cloud.dstack.ai`)
          user_token: The dstack user token
          ssh_identity_file: The private SSH key path for SSH tunneling
  
      Returns:
          A client instance
      """
      if server_url is not None and user_token is not None:
          if project_name is None:
              raise ConfigurationError(
                  f"The project name is not specified"
              )
          api_client = APIClient(server_url, user_token)
      else:
          api_client, project_name = api_client_service.get_api_client(
              project_name=project_name
          )
      return Client(
          api_client=api_client,
          project_name=project_name,
          ssh_identity_file=ssh_identity_file,
      )
  
file_path: dstack/src/dstack/api/_public/__init__.py
imports: from typing import Optional
  import dstack._internal.core.services.api_client
  from dstack._internal.core.errors import ConfigurationError
  from dstack._internal.core.services.configs import ConfigManager
  from dstack._internal.utils.logging import get_logger
  from dstack._internal.utils.path import PathLike
  from dstack.api._public.backends import BackendCollection
  from dstack.api._public.repos import RepoCollection, get_ssh_keypair
  from dstack.api._public.runs import RunCollection
  from dstack.api.server import APIClient
label_desc: Use image node_id 2 for calling the Client obj's underlying member method code with example usage: obj.from_config(project_name, server_url, user_token, ssh_identity_file) and returns: Client