diff --git a/docs/source/internal.mdx b/docs/source/internal.mdx
index 94803a62f..9b496b30e 100644
--- a/docs/source/internal.mdx
+++ b/docs/source/internal.mdx
@@ -67,3 +67,5 @@ The main work on your PyTorch `DataLoader` is done by the following function:
 [[autodoc]] utils.synchronize_rng_states
 
 [[autodoc]] utils.wait_for_everyone
+
+[[autodoc]] utils.write_basic_config
diff --git a/src/accelerate/utils/__init__.py b/src/accelerate/utils/__init__.py
index 58b33c1ad..f65b6b115 100644
--- a/src/accelerate/utils/__init__.py
+++ b/src/accelerate/utils/__init__.py
@@ -72,5 +72,12 @@
 
 from .launch import PrepareForLaunch
 from .memory import find_executable_batch_size
-from .other import extract_model_from_parallel, get_pretty_name, patch_environment, save, wait_for_everyone
+from .other import (
+    extract_model_from_parallel,
+    get_pretty_name,
+    patch_environment,
+    save,
+    wait_for_everyone,
+    write_basic_config,
+)
 from .random import set_seed, synchronize_rng_state, synchronize_rng_states
diff --git a/src/accelerate/utils/other.py b/src/accelerate/utils/other.py
index 35c96a21a..0d4f5b7e2 100644
--- a/src/accelerate/utils/other.py
+++ b/src/accelerate/utils/other.py
@@ -14,9 +14,12 @@
 
 import os
 from contextlib import contextmanager
+from pathlib import Path
 
 import torch
 
+from ..commands.config.cluster import ClusterConfig
+from ..commands.config.config_args import default_json_config_file
 from ..state import AcceleratorState
 from .dataclasses import DistributedType
 from .imports import is_deepspeed_available, is_tpu_available
@@ -109,3 +112,45 @@ def get_pretty_name(obj):
     if hasattr(obj, "__name__"):
         return obj.__name__
     return str(obj)
+
+
+def write_basic_config(mixed_precision="no", save_location: str = default_json_config_file):
+    """
+    Creates and saves a basic cluster config to be used on a local machine with potentially multiple GPUs. Will also
+    set CPU if it is a CPU-only machine.
+
+    Args:
+        mixed_precision (`str`, *optional*, defaults to "no"):
+            Mixed Precision to use. Should be one of "no", "fp16", or "bf16"
+        save_location (`str`, *optional*, defaults to `default_json_config_file`):
+            Optional custom save location. Should be passed to `--config_file` when using `accelerate launch`. Default
+            location is inside the huggingface cache folder (`~/.cache/huggingface`) but can be overriden by setting
+            the `HF_HOME` environmental variable, followed by `accelerate/default_config.yaml`.
+    """
+    path = Path(save_location)
+    path.parent.mkdir(parents=True, exist_ok=True)
+    if path.exists():
+        print(
+            f"Configuration already exists at {save_location}, will not override. Run `accelerate config` manually or pass a different `save_location`."
+        )
+        return
+    mixed_precision = mixed_precision.lower()
+    if mixed_precision not in ["no", "fp16", "bf16"]:
+        raise ValueError(f"`mixed_precision` should be one of 'no', 'fp16', or 'bf16'. Received {mixed_precision}")
+    config = {"compute_environment": "LOCAL_MACHINE", "mixed_precision": mixed_precision}
+    if torch.cuda.is_available():
+        num_gpus = torch.cuda.device_count()
+        config["num_processes"] = num_gpus
+        config["use_cpu"] = False
+        if num_gpus > 1:
+            config["distributed_type"] = "MULTI_GPU"
+        else:
+            config["distributed_type"] = "NO"
+    else:
+        num_gpus = 0
+        config["use_cpu"] = True
+        config["num_processes"] = 1
+        config["distributed_type"] = "NO"
+    if not path.exists():
+        config = ClusterConfig(**config)
+        config.to_json_file(path)


Review comments: body: This utility should take an optional path to store the config (you can pass any config file to `accelerate launch` with the arg `--config_file`.
diff_hunk: @@ -109,3 +112,41 @@ def get_pretty_name(obj):
     if hasattr(obj, "__name__"):
         return obj.__name__
     return str(obj)
+
+
+def write_basic_config(mixed_precision="no"):
+    """
+    Creates and saves a basic cluster config to be used on a local machine with potentially multiple GPUs. Will also
+    set CPU if it is a CPU-only machine.
+
+    Args:
+        mixed_precision (`str`, *optional*, defaults to "no"):
+            Mixed Precision to use. Should be one of "no", "fp16", or "bf16"
+    """
+    path = Path(default_json_config_file)
+    path.parent.mkdir(parents=True, exist_ok=True)
+    if path.exists():
+        print(
+            "User configuration already setup, will not override existing configuration. Run `accelerate config` manually."
+        )
+        return
body: This is the default already, so I don't think this part is useful.
diff_hunk: @@ -109,3 +112,45 @@ def get_pretty_name(obj):
     if hasattr(obj, "__name__"):
         return obj.__name__
     return str(obj)
+
+
+def write_basic_config(mixed_precision="no", save_location: str = default_json_config_file):
+    """
+    Creates and saves a basic cluster config to be used on a local machine with potentially multiple GPUs. Will also
+    set CPU if it is a CPU-only machine.
+
+    Args:
+        mixed_precision (`str`, *optional*, defaults to "no"):
+            Mixed Precision to use. Should be one of "no", "fp16", or "bf16"
+        save_location (`str`, *optional*):
+            Optional custom save location. Should be passed to `--config_file` when using `accelerate launch`.
+    """
+    if save_location is None:
+        save_location = default_json_config_file
body: The default should be indicated there.
diff_hunk: @@ -109,3 +112,45 @@ def get_pretty_name(obj):
     if hasattr(obj, "__name__"):
         return obj.__name__
     return str(obj)
+
+
+def write_basic_config(mixed_precision="no", save_location: str = default_json_config_file):
+    """
+    Creates and saves a basic cluster config to be used on a local machine with potentially multiple GPUs. Will also
+    set CPU if it is a CPU-only machine.
+
+    Args:
+        mixed_precision (`str`, *optional*, defaults to "no"):
+            Mixed Precision to use. Should be one of "no", "fp16", or "bf16"
+        save_location (`str`, *optional*):
+            Optional custom save location. Should be passed to `--config_file` when using `accelerate launch`.
body: This won't be the default location for everyone, so I'd just say defaults to the default config path and expand a bit in the docstring that it's inside the default cache of hugging face, and may add which env variable control it.
diff_hunk: @@ -122,11 +122,9 @@ def write_basic_config(mixed_precision="no", save_location: str = default_json_c
     Args:
         mixed_precision (`str`, *optional*, defaults to "no"):
             Mixed Precision to use. Should be one of "no", "fp16", or "bf16"
-        save_location (`str`, *optional*):
+        save_location (`str`, *optional*, defaults to "~/.cache/huggingface/accelerate/default_config.yaml"):
body: ```suggestion
            location is inside the huggingface cache folder (`~/.cache/huggingface` but can be overriden by setting the 
            `HF_HOME` environmental variable) followed by `accelerate/default_config.yaml`.
```
diff_hunk: @@ -122,8 +122,10 @@ def write_basic_config(mixed_precision="no", save_location: str = default_json_c
     Args:
         mixed_precision (`str`, *optional*, defaults to "no"):
             Mixed Precision to use. Should be one of "no", "fp16", or "bf16"
-        save_location (`str`, *optional*, defaults to "~/.cache/huggingface/accelerate/default_config.yaml"):
-            Optional custom save location. Should be passed to `--config_file` when using `accelerate launch`.
+        save_location (`str`, *optional*, defaults to `default_json_config_file`):
+            Optional custom save location. Should be passed to `--config_file` when using `accelerate launch`. Default
+            location is inside the huggingface cache folder as default_config.yaml, can be overriden by setting the 
+            `HF_HOME` environmental variable.

Discussion: body: _The documentation is not available anymore as the PR was closed or merged._