👨‍💻 dev LLM dev ass

development

fukurou

the supreme coder
ADMIN
🧠 Step 1: Choose Your LLM

Pick a model that suits your hardware and goals. Popular choices:


  • LLaMA 3 (Meta)
  • Mistral
  • Gemma
  • GPT4All

These models are available in GGUF format and optimized for local use.




⚙️ Step 2: Install Ollama​


Ollama is a user-friendly tool to run LLMs locally.

curl -fsSL https://ollama.com/install.sh | sh


Then run your model:

ollama run llama3


This downloads and launches the model locally.




🛠️ Step 3: Set Up Your Python Project​


Create a folder like waifu-chatbot, and inside it:


  • main.py — your Python script
  • requirements.txt — dependencies

In requirements.txt, add:

fastapi
uvicorn
requests


Install them:

pip install -r requirements.txt




🚀 Step 4: Build a Local API with FastAPI​


Here’s a basic main.py to send prompts to your waifu:

from fastapi import FastAPI, Request
Python:
import requests

app = FastAPI()

@app.post("/chat")
async def chat(request: Request):
    data = await request.json()
    prompt = data.get("prompt")
    response = requests.post("http://localhost:11434/api/generate", json={"model": "llama3", "prompt": prompt})
    return response.json()


Run it with:

uvicorn main:app --reload




💖 Step 5: Customize Your Waifu​


You can fine-tune personality by:


  • Prepending a system prompt like: "You are a cute anime waifu who loves cats and ramen."
  • Using prompt engineering to shape responses
  • Saving chat history for memory simulation



🧪 Step 6: Test It!​


Use curl or Postman to send a prompt:

curl -X POST http://localhost:8000/chat -H "Content-Type: application/json" -d '{"prompt": "Hi waifu!"}'
 

fukurou

the supreme coder
ADMIN
🧰 Step 1: PyCharm Project Setup

  1. Create a new PyCharm project (e.g., waifu_chatbot).
  2. Add two files:
    • main.py
    • requirements.txt
  3. In requirements.txt, add:
    fastapi
    requests

    PyCharm will prompt you to install these — go ahead and accept.



🧠 Step 2: Install Ollama (One-Time Setup)​


  1. Download Ollama from ollama.com/download.
  2. Install it and open the app.
  3. Pull a model (e.g., LLaMA 3) by typing: ollama pull llama3

    You only need to do this once.



💬 Step 3: Write Your Chatbot Code​


Paste this into main.py:

Python:
from fastapi import FastAPI, Request
import requests
import threading
import uvicorn

app = FastAPI()

@app.post("/chat")
async def chat(request: Request):
    data = await request.json()
    prompt = data.get("prompt")
    response = requests.post(
        "http://localhost:11434/api/generate",
        json={"model": "llama3", "prompt": prompt}
    )
    return response.json()

def run_server():
    uvicorn.run("main:app", host="127.0.0.1", port=8000, reload=True)

if __name__ == "__main__":
    threading.Thread(target=run_server).start()


This way, you just run main.py like any normal Python script — no need to type uvicorn in the terminal.




💖 Step 4: Talk to Your Waifu​


You can test it with another Python script:

Python:
import requests

response = requests.post(
    "http://localhost:8000/chat",
    json={"prompt": "Hi waifu!"}
)
print(response.json())


Or use Postman/cURL if you prefer.




Want to add a cute anime-style web interface next? I can help you build one with Gradio — no command-line drama involved 😄.
 

fukurou

the supreme coder
ADMIN
🧠 Step 1: Install Ollama (One-Time Setup)

Ollama lets you run LLMs locally with ease.


  1. Go to Ollama’s download page
  2. Download the installer for your OS (Windows/macOS)
  3. Install and open the Ollama app
  4. In the Ollama terminal, pull a model: ollama pull llama3

    This downloads the LLaMA 3 model locally.



🧰 Step 2: Create Your PyCharm Project​


  1. Open PyCharm → New Project → name it waifu_terminal_chat
  2. Inside the project, create a file: chat.py
  3. Create a requirements.txt file and add: requests

  4. PyCharm will prompt you to install it — accept and let it install.



💬 Step 3: Write Your Chat Script​


Paste this into chat.py:

Python:
import requests

def talk_to_waifu(prompt):
    response = requests.post(
        "http://localhost:11434/api/generate",
        json={"model": "llama3", "prompt": prompt}
    )
    return response.json()["response"]

print("Waifu: Hello darling~ Ready to chat? Type 'exit' to leave 💕")

while True:
    user_input = input("You: ")
    if user_input.lower() in ["exit", "quit"]:
        print("Waifu: Bye bye~ I'll miss you! 💖")
        break
    reply = talk_to_waifu(user_input)
    print(f"Waifu: {reply}")




🚀 Step 4: Run It in PyCharm Terminal​


  1. Make sure Ollama is running in the background
  2. In PyCharm, click the green play button or right-click chat.py → Run
  3. Start chatting with your waifu directly in the terminal — no browser needed!



💖 Step 5: Add Personality (Optional)​


To make her more anime-like, tweak the prompt like this:

Python:
json={"model": "llama3", "prompt": "You are a sweet anime waifu who loves cats and ramen. " + prompt}


You can also:


  • Save chat history to simulate memory
  • Add emojis and cute phrases
  • Create multiple waifu personalities with different system prompts

  • Anime-style avatars with image generation
  • Memory using local file storage or SQLite
 
Top