diff --git a/api.py b/api.py
new file mode 100644
index 000000000..81dc9539a
--- /dev/null
+++ b/api.py
@@ -0,0 +1,93 @@
+from fastapi import FastAPI, HTTPException
+from fastapi.responses import Response
+from pydantic import BaseModel
+import os
+from io import BytesIO
+from core import run_tts_script
+from tabs.inference.inference import (
+    extract_model_and_epoch,
+    names,
+    match_index,
+    get_speakers_id,
+)
+
+# Initialize FastAPI app
+app = FastAPI()
+print(names)
+# Default values
+default_voice_name = "ur-PK-UzmaNeural"
+default_model_file = sorted(names, key=lambda x: extract_model_and_epoch(x))[1]
+print(f"Using default model: {default_model_file}")
+default_index_file = match_index(default_model_file)
+default_sid = get_speakers_id(default_model_file)[0] if get_speakers_id(default_model_file) else 0
+
+
+# Input model
+class TTSRequest(BaseModel):
+    tts_text: str  # Only text is required
+
+
+def gen_random_string(length=5):
+    import random
+    import string
+    return "".join(random.choices(string.ascii_lowercase + string.digits, k=length))
+
+@app.post("/tts")
+async def tts_endpoint(request: TTSRequest):
+    try:
+        ran_file_name = gen_random_string(5)
+        output_tts_path = os.path.join(os.getcwd(), "assets", "audios", f"{ran_file_name}_tts_output.wav")
+        output_rvc_path = os.path.join(os.getcwd(), "assets", "audios", f"{ran_file_name}_tts_rvc_output.wav")
+
+        # Run the TTS script with default parameters
+        _, audio_file_path = run_tts_script(
+            tts_file=None,
+            tts_text=request.tts_text,
+            tts_voice=default_voice_name,
+            tts_rate=1,  # Default TTS speed
+            pitch=5,  # Default pitch
+            filter_radius=5,
+            index_rate=0.65,
+            volume_envelope=1,
+            protect=0.5,
+            hop_length=128,
+            f0_method="rmvpe",
+            output_tts_path=output_tts_path,
+            output_rvc_path=output_rvc_path,
+            pth_path=default_model_file,
+            index_path=default_index_file,
+            split_audio=False,
+            f0_autotune=False,
+            f0_autotune_strength=1.0,
+            clean_audio=True,
+            clean_strength=0.5,
+            export_format="WAV",
+            f0_file=None,
+            embedder_model="contentvec",
+            embedder_model_custom=None,
+            sid=default_sid,
+        )
+
+        # Check if the audio file exists
+        if not os.path.exists(audio_file_path):
+            raise HTTPException(
+                status_code=500, detail="Audio file was not generated successfully."
+            )
+
+        # Read the audio file as bytes
+        with open(audio_file_path, "rb") as audio_file:
+            audio_bytes = audio_file.read()
+
+        # Cleanup: Delete the generated files after reading
+        try:
+            os.remove(audio_file_path)
+            os.remove(output_rvc_path)  # Ensure to delete both files if applicable
+        except Exception as cleanup_error:
+            # Log or handle cleanup errors if necessary
+            print(f"Error during cleanup: {cleanup_error}")
+
+        # Return audio bytes
+        return Response(content=audio_bytes, media_type="audio/wav")
+    except Exception as e:
+        raise HTTPException(status_code=500, detail=f"Error during TTS conversion: {str(e)}")
+
diff --git a/app.py b/app.py
index 82958dbf0..c464c0087 100644
--- a/app.py
+++ b/app.py
@@ -120,6 +120,7 @@ def launch_gradio(port):
         share="--share" in sys.argv,
         inbrowser="--open" in sys.argv,
         server_port=port,
+        server_name="0.0.0.0"
     )
 
 
diff --git a/client.py b/client.py
new file mode 100644
index 000000000..cb56695c7
--- /dev/null
+++ b/client.py
@@ -0,0 +1,61 @@
+import requests
+import sounddevice as sd
+import wave
+from io import BytesIO
+import numpy as np
+
+def tts_client(api_url: str, text: str):
+    """
+    Sends text to the TTS API, receives audio, and plays it.
+    
+    Args:
+        api_url (str): The URL of the TTS API endpoint.
+        text (str): The text to synthesize into speech.
+    """
+    try:
+        # Send text to the API
+        response = requests.post(api_url, json={"tts_text": text})
+        response.raise_for_status()  # Raise exception for HTTP errors
+        
+        # Convert response bytes to a WAV file object
+        audio_bytes = BytesIO(response.content)
+        with wave.open(audio_bytes, "rb") as wav_file:
+            # Extract audio parameters
+            sample_rate = wav_file.getframerate()
+            n_channels = wav_file.getnchannels()
+            audio_data = wav_file.readframes(wav_file.getnframes())
+
+        # Convert audio data to NumPy array for playback
+        audio_array = np.frombuffer(audio_data, dtype=np.int16)
+        
+        # Play audio using sounddevice
+        print("Playing audio...")
+        sd.play(audio_array, samplerate=sample_rate)
+        sd.wait()  # Wait until playback is finished
+        print("Audio playback finished.")
+
+    except requests.exceptions.RequestException as e:
+        print(f"Error communicating with the TTS API: {e}")
+    except Exception as e:
+        print(f"An error occurred: {e}")
+
+if __name__ == "__main__":
+    # Define the API URL
+    api_url = "http://5.9.81.185:9033/tts"
+
+    # Input text for TTS
+    text = """
+ایک دور دراز گاؤں میں ایک ننھا شہزادہ رہتا تھا جس کا نام ارحم تھا۔ ارحم نہایت ذہین، بہادر اور دل کا نرم تھا۔ گاؤں کے لوگ اس سے بہت محبت کرتے تھے کیونکہ وہ ہمیشہ دوسروں کی مدد کے لئے تیار رہتا تھا۔
+
+ایک دن گاؤں کے قریب ایک خوفناک دیو آگیا جو گاؤں کے کھیتوں اور گھروں کو تباہ کر رہا تھا۔ گاؤں کے لوگ خوف زدہ تھے اور کوئی بھی دیو کا سامنا کرنے کو تیار نہ تھا۔ بزرگوں نے کہا کہ صرف کسی بہادر شخص کی قربانی ہی دیو کو روک سکتی ہے۔
+
+ارحم نے یہ سنا تو اس کے دل میں گاؤں کو بچانے کا عزم پیدا ہوا۔ وہ اپنے والدین کے پاس گیا اور ان سے کہا، "مجھے دیو کا سامنا کرنا ہے تاکہ گاؤں محفوظ ہو جائے۔" والدین کے آنکھوں میں آنسو تھے لیکن انہوں نے اپنے بیٹے کے عزم کو سلام کیا۔
+
+ارحم نے اپنی تلوار اٹھائی اور دیو کے غار کی طرف روانہ ہو گیا۔ راستے میں اس نے خوب دعائیں کیں اور اپنے اللہ پر بھروسہ رکھا۔ جب وہ دیو کے سامنے پہنچا تو دیو ہنسا اور کہا، "ایک ننھا لڑکا میری طاقت کا مقابلہ کرے گا؟"
+
+لیکن ارحم نے ہمت نہیں ہاری۔ اس نے اپنے دل کی طاقت سے دیو کا مقابلہ کیا۔ آخر کار دیو کو شکست ہوئی اور وہ غائب ہو گیا۔ ارحم نے گاؤں کو بچا لیا۔
+
+جب وہ واپس آیا تو گاؤں کے لوگ خوشی سے جھوم اٹھے۔ ارحم کی بہادری کی کہانی ہر طرف مشہور ہو گئی اور وہ گاؤں کے ہیرو بن گیا۔
+"""
+    # Call the client function
+    tts_client(api_url, text)
diff --git a/requirements.txt b/requirements.txt
index 5167f3766..c3f8316dc 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,45 +1,41 @@
 # Core dependencies
-pip>=23.3; sys_platform == 'darwin'
-wheel; sys_platform == 'darwin'
-PyYAML; sys_platform == 'darwin'
-numpy==1.23.5
-requests>=2.31.0,<2.32.0
+PyYAML
+numpy
+requests
 tqdm
 wget
 
 # Audio processing
-ffmpeg-python>=0.2.0
-faiss-cpu==1.7.3
-librosa==0.9.2
-scipy==1.11.1
-soundfile==0.12.1
+ffmpeg-python
+faiss-cpu
+librosa
+scipy
+soundfile
 noisereduce
 pedalboard
 stftpitchshift
 soxr
 
 # Machine learning and deep learning
-omegaconf>=2.0.6; sys_platform == 'darwin' 
-numba; sys_platform == 'linux'
-numba==0.57.0; sys_platform == 'darwin' or sys_platform == 'win32'
-torch==2.3.1
-torchaudio==2.3.1
-torchvision==0.18.1
-torchcrepe==0.0.23
+omegaconf
+numba
+torch
+torchaudio
+torchvision
+torchcrepe
 torchfcpe
 einops
 libf0
-transformers==4.44.2
+transformers
 
 # Visualization and UI
-matplotlib==3.7.2
+matplotlib
 tensorboard
-gradio==5.5.0
+gradio
 
 # Miscellaneous utilities
-certifi>=2023.07.22; sys_platform == 'darwin'  
-antlr4-python3-runtime==4.8; sys_platform == 'darwin'
-tensorboardX
-edge-tts==6.1.9
+certifi
+antlr4-python3-runtime
+edge-tts
 pypresence
 beautifulsoup4
\ No newline at end of file
diff --git a/run-api.py b/run-api.py
new file mode 100644
index 000000000..de762d2bc
--- /dev/null
+++ b/run-api.py
@@ -0,0 +1,9 @@
+#!/bin/sh
+printf "\033]0;Applio\007"
+. .venv/bin/activate
+
+ export PYTORCH_ENABLE_MPS_FALLBACK=1
+ export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0
+ 
+clear
+python api.py --open
diff --git a/run-api.sh b/run-api.sh
new file mode 100755
index 000000000..50bee854f
--- /dev/null
+++ b/run-api.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+printf "\033]0;Applio\007"
+. .venv/bin/activate
+
+ export PYTORCH_ENABLE_MPS_FALLBACK=1
+ export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0
+ 
+uvicorn  api:app  --host 0.0.0.0 --port 9033
diff --git a/run-applio.bat b/run-applio.bat
deleted file mode 100644
index 86de62e18..000000000
--- a/run-applio.bat
+++ /dev/null
@@ -1,13 +0,0 @@
-@echo off
-setlocal
-title Applio
-
-if not exist env (
-    echo Please run 'run-install.bat' first to set up the environment.
-    pause
-    exit /b 1
-)
-
-env\python.exe app.py --open
-echo.
-pause
\ No newline at end of file
diff --git a/run-applio.sh b/run-applio.sh
old mode 100644
new mode 100755
diff --git a/run-install.bat b/run-install.bat
deleted file mode 100644
index 8637a2a66..000000000
--- a/run-install.bat
+++ /dev/null
@@ -1,88 +0,0 @@
-@echo off
-setlocal enabledelayedexpansion
-title Applio Installer
-
-echo Welcome to the Applio Installer!
-echo.
-
-set "INSTALL_DIR=%cd%"
-set "MINICONDA_DIR=%UserProfile%\Miniconda3"
-set "ENV_DIR=%INSTALL_DIR%\env"
-set "MINICONDA_URL=https://repo.anaconda.com/miniconda/Miniconda3-py310_24.7.1-0-Windows-x86_64.exe"
-set "CONDA_EXE=%MINICONDA_DIR%\Scripts\conda.exe"
-
-call :cleanup
-call :install_miniconda
-call :create_conda_env
-call :install_dependencies
-
-echo Applio has been installed successfully!
-echo To start Applio, please run 'run-applio.bat'.
-echo.
-pause
-exit /b 0
-
-:cleanup
-echo Cleaning up unnecessary files...
-for %%F in (Makefile Dockerfile docker-compose.yaml *.sh) do if exist "%%F" del "%%F"
-echo Cleanup complete.
-echo.
-exit /b 0
-
-:install_miniconda
-if exist "%CONDA_EXE%" (
-    echo Miniconda already installed. Skipping installation.
-    exit /b 0
-)
-
-echo Miniconda not found. Starting download and installation...
-powershell -Command "& {Invoke-WebRequest -Uri '%MINICONDA_URL%' -OutFile 'miniconda.exe'}"
-if not exist "miniconda.exe" goto :download_error
-
-start /wait "" miniconda.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%MINICONDA_DIR%
-if errorlevel 1 goto :install_error
-
-del miniconda.exe
-echo Miniconda installation complete.
-echo.
-exit /b 0
-
-:create_conda_env
-echo Creating Conda environment...
-call "%MINICONDA_DIR%\_conda.exe" create --no-shortcuts -y -k --prefix "%ENV_DIR%" python=3.10
-if errorlevel 1 goto :error
-echo Conda environment created successfully.
-echo.
-
-if exist "%ENV_DIR%\python.exe" (
-    echo Installing specific pip version...
-    "%ENV_DIR%\python.exe" -m pip install "pip<24.1"
-    if errorlevel 1 goto :error
-    echo Pip installation complete.
-    echo.
-)
-exit /b 0
-
-:install_dependencies
-echo Installing dependencies...
-call "%MINICONDA_DIR%\condabin\conda.bat" activate "%ENV_DIR%" || goto :error
-pip install --upgrade setuptools || goto :error
-pip install -r "%INSTALL_DIR%\requirements.txt" || goto :error
-pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --upgrade --index-url https://download.pytorch.org/whl/cu121 || goto :error
-call "%MINICONDA_DIR%\condabin\conda.bat" deactivate
-echo Dependencies installation complete.
-echo.
-exit /b 0
-
-:download_error
-echo Download failed. Please check your internet connection and try again.
-goto :error
-
-:install_error
-echo Miniconda installation failed.
-goto :error
-
-:error
-echo An error occurred during installation. Please check the output above for details.
-pause
-exit /b 1
diff --git a/run-install.sh b/run-install.sh
old mode 100644
new mode 100755
diff --git a/run-tensorboard.bat b/run-tensorboard.bat
deleted file mode 100644
index b879c3912..000000000
--- a/run-tensorboard.bat
+++ /dev/null
@@ -1,13 +0,0 @@
-@echo off
-setlocal
-title Tensorboard
-
-if not exist env (
-    echo Please run 'run-install.bat' first to set up the environment.
-    pause
-    exit /b 1
-)
-
-env\python.exe core.py tensorboard
-echo.
-pause
diff --git a/rvc/train/utils.py b/rvc/train/utils.py
index cd4051630..0912f1fd9 100644
--- a/rvc/train/utils.py
+++ b/rvc/train/utils.py
@@ -171,6 +171,9 @@ def plot_spectrogram_to_numpy(spectrogram):
 
     Args:
         spectrogram (numpy.ndarray): The spectrogram to plot.
+
+    Returns:
+        numpy.ndarray: The rendered spectrogram as an image array.
     """
     global MATPLOTLIB_FLAG
     if not MATPLOTLIB_FLAG:
@@ -184,13 +187,24 @@ def plot_spectrogram_to_numpy(spectrogram):
     plt.ylabel("Channels")
     plt.tight_layout()
 
+    # Render the figure
     fig.canvas.draw()
-    data = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8)
-    data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
-    plt.close(fig)
+    
+    # Get ARGB data from canvas
+    data = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8)
+    width, height = fig.canvas.get_width_height()
+
+    # Reshape data to include 4 channels (ARGB)
+    data = data.reshape((height, width, 4))
+
+    # Convert ARGB to RGB by dropping the alpha channel
+    data = data[..., 1:]  # Retain R, G, B channels only
+
+    plt.close(fig)  # Close the figure to release memory
     return data
 
 
+
 def load_wav_to_torch(full_path):
     """
     Load a WAV file into a PyTorch tensor.
diff --git a/tabs/tts/tts.py b/tabs/tts/tts.py
index f700fbbc6..20b2481f6 100644
--- a/tabs/tts/tts.py
+++ b/tabs/tts/tts.py
@@ -48,6 +48,7 @@ def process_input(file_path):
 def tts_tab():
     with gr.Column():
         with gr.Row():
+            # getting the default voice model
             model_file = gr.Dropdown(
                 label=i18n("Voice Model"),
                 info=i18n("Select the voice model to use for the conversion."),
@@ -56,6 +57,7 @@ def tts_tab():
                 value=default_weight,
                 allow_custom_value=True,
             )
+            # getting the default index file respective to model
             best_default_index_path = match_index(model_file.value)
             index_file = gr.Dropdown(
                 label=i18n("Index File"),
@@ -89,6 +91,7 @@ def tts_tab():
             f"Applio is a Speech-to-Speech conversion software, utilizing EdgeTTS as middleware for running the Text-to-Speech (TTS) component. Read more about it [here!](https://docs.applio.org/applio/getting-started/tts)"
         )
     )
+    # getting tts voice name
     tts_voice = gr.Dropdown(
         label=i18n("TTS Voices"),
         info=i18n("Select the TTS voice to use for the conversion."),
@@ -96,7 +99,7 @@ def tts_tab():
         interactive=True,
         value=random.choice(short_names),
     )
-
+    # tts speed
     tts_rate = gr.Slider(
         minimum=-100,
         maximum=100,
@@ -109,12 +112,14 @@ def tts_tab():
 
     with gr.Tabs():
         with gr.Tab(label="Text to Speech"):
+            # tts text
             tts_text = gr.Textbox(
                 label=i18n("Text to Synthesize"),
                 info=i18n("Enter the text to synthesize."),
                 placeholder=i18n("Enter text to synthesize"),
                 lines=3,
             )
+
         with gr.Tab(label="File to Speech"):
             txt_file = gr.File(
                 label=i18n("Upload a .txt file"),