Code Monkey home page Code Monkey logo

scaleway-demo-chatbot's Introduction

scaleway-demo-chatbot

Simple first demo of a Chatbot based on Kapsule + L4 + Ollama

Setup

  1. Deploy infrastructure using terraform
terraform init && terraform apply -auto-approve

Needed environment variables:

SCW_ACCESS_KEY
SCW_SECRET_KEY
SCW_DEFAULT_ORGANIZATION_ID
SCW_DEFAULT_PROJECT_ID

NB: the infrastructure will be deployed on FR-PAR/FR-PAR-2

Sample output:

Outputs:

lb_ip = "X.X.X.X"
  1. Collect resulting IP address for LB and create a DNS entry

Example using Scaleway CLI and a Scaleway Managed DNS:

scw dns record add my-domain.fr type=A name=chatbot data=X.X.X.X ttl=60
  1. Add LB IP and DNS entry in deployment

Edit deploy.yaml and insert the value for the LB IP and DNS entry:

(...)
        command:
        - caddy
        args:
        - reverse-proxy
        - -f
        - <your-dns-entry>:443
        - -t
        - chatbot:8080
(...)
  - name: https
    port: 443
    protocol: TCP
    targetPort: 443
  loadBalancerIP: <your-lb-ip>
  selector:
    app: caddy
(...)
  1. Deploy the chatbot in Kapsule

We will use the created kubeconfig.yaml file to access the cluster, but you can also use the console to generate this file.

On linux or Mac OSX

export KUBECONFIG=kubeconfig.yaml

On windows

set KUBECONFIG=kubeconfig.yaml

Deploy the chat bot:

kubectl apply -f deploy.yaml

Credits

The initial code is built via create-llama. The frontend part is available in the folder frontend but has been compiled as a static JS+HTML and integrated in the FastAPI chatbot via root mount.

scaleway-demo-chatbot's People

Contributors

n-arno avatar

Stargazers

jaime Bernabe avatar

Watchers

 avatar

Forkers

monitob

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.