### Start Frontend Development Server Source: https://opentutorai.com/docs/getting-started Commands to install dependencies and start the SvelteKit frontend in development mode. ```bash cd ui npm install npm run dev ``` -------------------------------- ### Clone Repository for Manual Setup Source: https://opentutorai.com/docs/getting-started Initial steps to fork and clone the repository for local development. ```bash git clone https://github.com/YOUR_USERNAME/open-tutor-ai-CE.git cd open-tutor-ai-CE ``` -------------------------------- ### Install Backend Dependencies Source: https://opentutorai.com/docs/getting-started Install required Python packages from the requirements file. ```bash pip install -r requirements.txt ``` -------------------------------- ### Start Backend API Source: https://opentutorai.com/docs/getting-started Commands to launch the FastAPI backend with hot-reload enabled. ```bash ./devops/scripts/dev.sh ``` ```bash cp .env.example .env # first run only uvicorn main:app --reload --port 8080 --host 0.0.0.0 ``` -------------------------------- ### Build Frontend Assets Source: https://opentutorai.com/docs/troubleshooting Install dependencies and build the frontend static files if the build directory is missing. ```bash cd ui && npm install && npm run build ``` -------------------------------- ### Run Open TutorAI with Docker Source: https://opentutorai.com/docs/getting-started Commands to clone the repository, prepare the environment, and launch the full stack using Docker Compose. ```bash # 1. Clone git clone https://github.com/Open-TutorAi/open-tutor-ai-CE.git cd open-tutor-ai-CE # 2. Create your environment file cp .env.example .env # 3. Build and start the stack docker compose --env-file .env -f devops/docker/docker-compose.yaml up --build ``` -------------------------------- ### Run Open TutorAI with GPU Acceleration Source: https://opentutorai.com/docs/getting-started Commands to launch the stack with specific Docker Compose overlays for NVIDIA or AMD GPU support. ```bash # NVIDIA docker compose --env-file .env \ -f devops/docker/docker-compose.yaml \ -f devops/docker/docker-compose.gpu.yaml up --build # AMD docker compose --env-file .env \ -f devops/docker/docker-compose.yaml \ -f devops/docker/docker-compose.amdgpu.yaml up --build ``` -------------------------------- ### Deploy OpenTutorAI with Docker Source: https://opentutorai.com Use these commands to clone the repository, set up the environment file, and build the full stack. ```bash $git clone https://github.com/Open-TutorAi/open-tutor-ai-CE.git && cd open-tutor-ai-CE $cp .env.example .env $docker compose --env-file .env -f devops/docker/docker-compose.yaml up --build ``` -------------------------------- ### Configure Python Virtual Environment Source: https://opentutorai.com/docs/getting-started Commands to create and activate a Python virtual environment for the backend. ```bash python3 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate ``` -------------------------------- ### View Backend Logs Source: https://opentutorai.com/docs/troubleshooting Monitor container logs to diagnose startup or runtime errors. ```bash docker compose -f devops/docker/docker-compose.yaml logs -f ``` -------------------------------- ### Run Standalone Docker Container Source: https://opentutorai.com/docs/troubleshooting Use the host network to allow the container to access Ollama on the host machine. ```bash docker run -d --network=host \ -v open-tutorai-var:/app/var \ -e OLLAMA_BASE_URL=http://127.0.0.1:11434 \ -e SECRET_KEY=$(openssl rand -hex 32) \ --name open-tutorai --restart always \ open-tutorai ``` -------------------------------- ### Configure Ollama Base URL for Local Development Source: https://opentutorai.com/docs/troubleshooting Set the environment variable for direct local access to the Ollama service. ```bash OLLAMA_BASE_URL=http://localhost:11434 ``` -------------------------------- ### Validate Changes Source: https://opentutorai.com/docs/getting-started Commands to run linting and testing suites to verify the local environment. ```bash make check # runs pre-commit lint + pytest + frontend tests # or individually: pytest -q cd ui && npm run test:frontend ``` -------------------------------- ### Generate and Set Secret Key Source: https://opentutorai.com/docs/troubleshooting Generate a secure random hex string and append it to the .env file for production startup. ```bash echo "SECRET_KEY=$(openssl rand -hex 32)" >> .env ``` -------------------------------- ### Restart Backend Services Source: https://opentutorai.com/docs/troubleshooting Refresh the model list cache by restarting the backend container. ```bash # Docker Compose docker compose -f devops/docker/docker-compose.yaml restart open-tutorai # Standalone container docker restart open-tutorai ``` -------------------------------- ### Configure Ollama Base URL for Docker Compose Source: https://opentutorai.com/docs/troubleshooting Set the environment variable to point to the Ollama service within the shared Docker network. ```bash OLLAMA_BASE_URL=http://ollama:11434 ``` -------------------------------- ### Reset Database for Development Source: https://opentutorai.com/docs/troubleshooting Remove the SQLite database file to resolve schema incompatibility issues during development. ```bash rm var/tutorai.db ``` -------------------------------- ### Configure CORS Origins Source: https://opentutorai.com/docs/troubleshooting Specify allowed frontend origins in the .env file to resolve browser CORS errors. ```bash CORS_ALLOW_ORIGIN=http://localhost:5173,https://your-domain.com ``` -------------------------------- ### Reset Docker Database Volumes Source: https://opentutorai.com/docs/troubleshooting Tear down and recreate Docker services to clear database volumes after updates. ```bash docker compose -f devops/docker/docker-compose.yaml down -v docker compose -f devops/docker/docker-compose.yaml up --build ``` -------------------------------- ### Increase HTTPX Timeout Source: https://opentutorai.com/docs/troubleshooting Adjust the proxy request timeout in the .env file to prevent premature connection termination. ```bash HTTPX_TIMEOUT=600 # seconds ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.