- Aplikasi obrolan roleplay yang terhubung ke server LLM mandiri (llama.cpp /
llama-server) yang kamu jalankan sendiri di Google Colab atau Kaggle, lalu diekspos publik lewat Cloudflare Tunnel.
- A roleplay chat application that connects to a self-hosted LLM server (llama.cpp /
llama-server) you run yourself on Google Colab or Kaggle, exposed publicly via Cloudflare Tunnel.
-
Proyek ini memungkinkan Anda menjalankan server LLM mandiri di GPU gratis Colab/Kaggle dan menghubungkannya ke klien obrolan lokal ini. Jalur aktif proyek: AIChat → Cloudflare Tunnel →
llama-server(llama.cpp) → model GGUF — tanpa lapisan proxy tambahan. Salin skripCollab-Llama.py(Colab) atauKaggle-Llama.py(Kaggle) ke sel notebook, jalankan, lalu tempelBASE_URL/API_KEYyang dicetak ke.envlokal Anda.Stack lama (Ollama + LiteLLM, via
colab_llm_server.py/kaggle_llm_server.py) masih ada di repo ini sebagai alternatif opsional — lihat bagian "Pilihan Stack Server LLM" di bawah — tapi bukan lagi jalur default proyek ini.
-
This project lets you run a self-hosted LLM server on Colab/Kaggle's free GPU and connect it to this local chat client. This project's active path: AIChat → Cloudflare Tunnel →
llama-server(llama.cpp) → GGUF model — no extra proxy layer. CopyCollab-Llama.py(Colab) orKaggle-Llama.py(Kaggle) into a notebook cell, run it, then paste the printedBASE_URL/API_KEYinto your local.env.The older stack (Ollama + LiteLLM, via
colab_llm_server.py/kaggle_llm_server.py) is still in this repo as an optional alternative — see "LLM Server Stack Options" below — but it is no longer this project's default path.
- RAM: 12 GB (Bawaan standar tier gratis Google Colab)
- VRAM: 16 GB (Tersedia pada runtime GPU gratis Google Colab)
- RAM: 12 GB (Standard default on Google Colab free tier)
- VRAM: 16 GB (Available on Google Colab free GPU runtime)
- Akun Google (untuk Colab) atau akun Kaggle, untuk mengakses GPU gratis.
- Koneksi internet yang stabil.
- Node.js terinstal pada perangkat lokal Anda.
- A Google account (for Colab) or a Kaggle account, to access free GPU compute.
- A stable internet connection.
- Node.js installed on your local machine.
Ada dua pilihan stack untuk menjalankan server LLM di Colab/Kaggle. Keduanya menghasilkan BASE_URL + API_KEY yang bisa langsung ditempel ke .env — pilih salah satu, tidak perlu keduanya.
There are two stack options for running the LLM server on Colab/Kaggle. Both produce a BASE_URL + API_KEY you paste straight into .env — pick one, you don't need both.
colab_llm_server.py / kaggle_llm_server.py (Ollama + LiteLLM) |
Collab-Llama.py / Kaggle-Llama.py (llama.cpp langsung) |
|
|---|---|---|
| Setup | Lebih cepat (binary Ollama siap pakai) — faster (prebuilt Ollama binary) | Perlu compile dari source pertama kali, ~5-10 menit ekstra — needs a source build first run, ~5-10 min extra |
| Kontrol parameter sampling | Lewat 2 lapis translasi (LiteLLM → Ollama), bisa ambigu — through 2 translation layers, can be ambiguous | Native, langsung ke model, tanpa translasi — native, direct to the model, no translation |
| Kontrol repetisi teks panjang | frequency_penalty/presence_penalty gaya OpenAI, terakumulasi di seluruh riwayat chat — bisa menekan kata umum ("the", "it", "is") makin lama makin sering di chat panjang — OpenAI-style, accumulates over the whole chat history — can suppress common words the longer a chat gets |
Punya DRY sampling — menghukum pengulangan frasa/pola, bukan kata umum individual; lebih cocok untuk roleplay panjang — has DRY sampling — penalizes repeated phrases/patterns, not individual common words; better suited for long roleplay |
| Jumlah proses | 2 (Ollama + LiteLLM) | 1 (llama-server saja) — 1 (llama-server only) |
| Rekomendasi | Kalau ingin setup tercepat — if you want the fastest setup | Kalau chat roleplay-mu panjang dan mulai terasa repetitif — if your roleplay chats run long and start feeling repetitive |
Cloudflare Tunnel dipakai di kedua stack dengan cara yang sama persis — tinggal tunnel port HTTP lokal, tidak ada perbedaan cara kerja.
Cloudflare Tunnel is used identically in both stacks — it just tunnels a local HTTP port either way, no difference in how it works.
PANDUAN INSTALASI: SERVER LLM (GOOGLE COLAB, OLLAMA + LITELLM) - INSTALLATION GUIDE: LLM SERVER (GOOGLE COLAB, OLLAMA + LITELLM)
- Persiapan Skrip: Unggah berkas
colab_llm_server.ipynbke Google Colab, atau salin seluruh isi skrip daricolab_llm_server.pyke dalam sel notebook baru di environment Colab Anda. - Konfigurasi Runtime: Pada bilah menu Google Colab, navigasikan ke Runtime > Ubah jenis runtime (Change runtime type) dan pastikan akselerator perangkat keras disetel ke GPU.
- Eksekusi: Jalankan (Run) sel yang berisi skrip tersebut untuk memulai proses instalasi dependensi dan menginisialisasi server. Tunggu hingga proses ini selesai sepenuhnya.
- Pengambilan Kredensial: Setelah server berhasil berjalan, sistem akan mencetak nilai
API_KEYdanBASE_URLpada output terminal/sel. - Konfigurasi Lokal: Buka berkas
.env.exampleyang terdapat pada direktori proyek lokal Anda. Perbarui variabel environment yang relevan dengan menempelkan nilaiAPI_KEYdanBASE_URLyang telah didapatkan. Terakhir, ubah nama berkas.env.examplemenjadi.env.
- Script Preparation: Upload the
colab_llm_server.ipynbfile to Google Colab, or copy the entire script contents fromcolab_llm_server.pyinto a new notebook cell in your Colab environment. - Runtime Configuration: In the Google Colab menu bar, navigate to Runtime > Change runtime type and ensure the hardware accelerator is set to GPU.
- Execution: Run the cell containing the script to initiate the dependency installation and server initialization process. Wait for this process to complete entirely.
- Credential Retrieval: Once the server is successfully running, the system will output the
API_KEYandBASE_URLvalues in the cell/terminal output. - Local Configuration: Open the
.env.examplefile located in your local project directory. Update the relevant environment variables by pasting the acquiredAPI_KEYandBASE_URLvalues. Finally, rename the.env.examplefile to.env.
PANDUAN INSTALASI: SERVER LLM (KAGGLE, OLLAMA + LITELLM, DUAL T4) - INSTALLATION GUIDE: LLM SERVER (KAGGLE, OLLAMA + LITELLM, DUAL T4)
- Persiapan Skrip: Buat notebook baru di Kaggle dan salin seluruh isi skrip dari
kaggle_llm_server.pyke dalam sel notebook. - Konfigurasi Akselerator: Di panel Notebook options (sisi kanan), atur Accelerator ke GPU T4 x2, dan pastikan Internet dalam posisi On.
- Eksekusi: Jalankan sel tersebut. Model 32B yang dipakai butuh kedua T4 untuk muat di VRAM — proses pull model + load pertama kali cukup lama.
- Pengambilan Kredensial & Konfigurasi Lokal: Sama seperti panduan Colab di atas — salin
BASE_URL/API_KEYdari output ke.env. - Pembersihan Otomatis: Skrip ini punya cleanup otomatis (RAM/VRAM) saat sel dihentikan atau kernel di-kill dari UI Kaggle — tidak perlu langkah manual tambahan.
- Script Preparation: Create a new notebook on Kaggle and copy the entire script contents from
kaggle_llm_server.pyinto a notebook cell. - Accelerator Configuration: In the Notebook options panel (right side), set Accelerator to GPU T4 x2, and make sure Internet is On.
- Execution: Run the cell. The 32B model used needs both T4s to fit in VRAM — the first pull + load takes a while.
- Credential Retrieval & Local Configuration: Same as the Colab guide above — copy
BASE_URL/API_KEYfrom the output into.env. - Automatic Cleanup: This script has automatic RAM/VRAM cleanup when the cell is stopped or the kernel is killed from the Kaggle UI — no extra manual step needed.
PANDUAN INSTALASI: SERVER LLM (COLAB, LLAMA.CPP LANGSUNG) - INSTALLATION GUIDE: LLM SERVER (COLAB, LLAMA.CPP DIRECT)
- Persiapan Skrip: Salin seluruh isi skrip dari
Collab-Llama.pyke dalam sel notebook baru di Google Colab. - Konfigurasi Runtime: Runtime > Change runtime type > GPU (T4).
- Eksekusi: Jalankan sel. Pada run pertama, skrip akan meng-compile llama.cpp dari source (~5-10 menit) sebelum mengunduh model — run berikutnya melewati langkah compile ini kalau kernel tidak di-restart.
- Pengambilan Kredensial & Konfigurasi Lokal: Sama seperti panduan lain — salin
BASE_URL/API_KEYdari output ke.env.
- Script Preparation: Copy the entire script contents from
Collab-Llama.pyinto a new notebook cell in Google Colab. - Runtime Configuration: Runtime > Change runtime type > GPU (T4).
- Execution: Run the cell. On the first run, the script compiles llama.cpp from source (~5-10 min) before downloading the model — subsequent runs skip the compile step as long as the kernel isn't restarted.
- Credential Retrieval & Local Configuration: Same as the other guides — copy
BASE_URL/API_KEYfrom the output into.env.
PANDUAN INSTALASI: SERVER LLM (KAGGLE, LLAMA.CPP LANGSUNG, DUAL T4) - INSTALLATION GUIDE: LLM SERVER (KAGGLE, LLAMA.CPP DIRECT, DUAL T4)
- Persiapan Skrip: Buat notebook baru di Kaggle dan salin seluruh isi skrip dari
Kaggle-Llama.py. - Konfigurasi Akselerator: Accelerator → GPU T4 x2, Internet → On.
- Eksekusi: Jalankan sel. Model default (32B, Q6_K) butuh kedua T4 — skrip otomatis memverifikasi keduanya benar-benar terpakai setelah model dimuat.
- Pengambilan Kredensial & Konfigurasi Lokal: Sama seperti panduan lain — salin
BASE_URL/API_KEYdari output ke.env. - Pembersihan Otomatis: Cleanup RAM/VRAM otomatis saat sel dihentikan, sama seperti
kaggle_llm_server.py.
- Script Preparation: Create a new notebook on Kaggle and copy the entire script contents from
Kaggle-Llama.py. - Accelerator Configuration: Accelerator → GPU T4 x2, Internet → On.
- Execution: Run the cell. The default model (32B, Q6_K) needs both T4s — the script automatically verifies both are actually being used after the model loads.
- Credential Retrieval & Local Configuration: Same as the other guides — copy
BASE_URL/API_KEYfrom the output into.env. - Automatic Cleanup: Automatic RAM/VRAM cleanup when the cell is stopped, same as
kaggle_llm_server.py.
- Prasyarat: Pastikan lingkungan sistem Anda telah memiliki Node.js.
- Instalasi Dependensi: Buka terminal atau command prompt dan arahkan ke direktori root proyek ini. Jalankan perintah
npm installuntuk mengunduh seluruh pustaka yang diperlukan. - Menjalankan Server: Eksekusi perintah
npm startuntuk menghidupkan server web lokal. - Akses Aplikasi (Lokal): Buka peramban web (browser) favorit Anda dan kunjungi
http://localhost:3000. - Akses Aplikasi (Jaringan WiFi Sama): Aplikasi ini dapat diakses oleh perangkat apa pun (seperti ponsel pintar atau tablet) yang terhubung ke jaringan WiFi yang sama dengan komputer host. Cukup masukkan alamat IP lokal dari komputer host diikuti dengan port server pada peramban perangkat tersebut (contoh:
http://192.168.1.15:3000).
- Prerequisites: Ensure your system environment has Node.js installed.
- Dependency Installation: Open a terminal or command prompt and navigate to this project's root directory. Run the
npm installcommand to download all required libraries. - Starting the Server: Execute the
npm startcommand to boot up the local web server. - Accessing the Application (Local): Open your preferred web browser and navigate to
http://localhost:3000. - Accessing the Application (Same WiFi Network): This application can be accessed by any device (such as a smartphone or tablet) connected to the same WiFi network as the host computer. Simply enter the local IP address of the host computer followed by the server port into the device's browser (e.g.,
http://192.168.1.15:3000).
See CHANGELOG.md for a detailed history of changes.
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license. This means you are free to use it for individual or non-commercial purposes, but commercial/corporate use requires a separate arrangement.
See the LICENSE file for the full text.