To let other students/faculty access your local CIS instance on the same Wi-Fi network:
- Bind to 0.0.0.0: Run uvicorn with host
0.0.0.0.uvicorn app.main:app --host 0.0.0.0 --port 8000
- Firewall: Ensure port
8000is open on your firewall. - Find IP: Run
ip addr(Linux) oripconfig(Windows) to find your local IP (e.g.,192.168.1.15).
- Update API URL: In
frontend/.env(or config), changelocalhostto your IP:NEXT_PUBLIC_API_URL="http://192.168.1.15:8000"
- Run with Network Access:
Or build for production:
npm run dev -- -H 0.0.0.0
npm run build && npm start.
- Must also run on
0.0.0.0if accessing from another backend machine. - Recommended Command (Run this in your
llama.cppdirectory):./build/bin/llama-server \ -m models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf \ -c 2048 \ --host 0.0.0.0 \ --port 8080 \ -t 8
Note: Cloud deployment generally requires Cloud LLMs (Gemini/OpenAI) because standard free-tier servers (Render) cannot run local LLMs like BitNet.
- Dockerize: Ensure
Dockerfileis present in backend root. - Push to GitHub: Commit your changes.
- Render Blueprint:
- Create a Web Service for Backend (
python 3.10). - Build Command:
pip install -r requirements.txt. - Start Command:
uvicorn app.main:app --host 0.0.0.0 --port $PORT. - Env Vars:
AI_PROVIDER=google,GOOGLE_API_KEY=....
- Create a Web Service for Backend (
- Static Site for Frontend:
- Build Command:
npm run build. - Publish directory:
.nextorout.
- Build Command:
- Run Backend + AI locally (Ngrok tunnel).
- Frontend on Vercel/Netlify pointing to Ngrok URL.
ngrok http 8000-> gives public URL.
This is the best way to run BitNet/Llama with high speed if you don't have a GPU locally.
- Download Notebook: Download
cis_colab.ipynbfrom this project. - Upload to Colab: Go to colab.research.google.com -> Upload.
- Select GPU Runtime (CRITICAL):
- In Colab, go to top menu: Runtime -> Change runtime type.
- Select T4 GPU.
- Click Save.
- If you don't do this, the notebook will fail with
nvidia-smi not found.
- Upload Backend:
- Zip your
backendfolder. - Upload it to the Colab files section (left sidebar).
- Unzip it:
!unzip backend.zip.
- Zip your
- Ngrok Token:
- Sign up at ngrok.com.
- Copy your Authtoken.
- Paste it in the notebook code where it says
YOUR_NGROK_AUTH_TOKEN.
- Run All Cells:
- The notebook will install everything, download the model, and start the server.
- Note on Build: The notebook is now optimized using Ninja and ccache. It builds only the
llama-servertarget to significantly reduce installation time. - It will print a Public URL (e.g.,
https://xyz.ngrok-free.app).
- Connect Frontend:
- Update your local
frontend/.env:NEXT_PUBLIC_API_URL="https://xyz.ngrok-free.app"
- Run your frontend locally:
npm run dev.
- Update your local