Giter VIP home page Giter VIP logo

talktome's Introduction

talktome

Just another PoC with local LLM and FastAPI

Built on Macbook M1 Air 2020 MacOS 14.4 primarily

Model Used

Tests

  • Primary backend test with - FastAPI.
  • Python formatter used - Black.
  • weight file is ignored for git. can be downladed from this link, 308 MB in size.
  • chathistory.txt has all the previous outcomes during the soft tests.

Project Structure

.
└── talktome/
    ├── README.md
    ├── main.py
    ├── stapp.py
    ├── index.html
    ├── model/
    │   ├── weight_file.bin
    │   └── utilities.extensions
    ├── assets/
    │   └── media_attached.extensions
    └── static/
        ├── index.html
        ├── script.js
        └── style.css

Usage

Docker

to build docker image, run: docker build -t lamini-app .

run docker container: docker run -p 8000:8000 lamini-app

locally

load server: uvicorn --host 0.0.0.0 main:app

Open: index.html

run streamlit: python3.10 -m streamlit run stapp.py

Flow of completition

0.1 - FastAPI local server test

summary_tab

load server: uvicorn main:app --reload

run primary test: python test.py

0.2 - simple streamlit test

summary_tab

load server: uvicorn --host 0.0.0.0 main:app

run streamlit: python3.10 -m streamlit run stapp.py

0.3.1 - trial with custom UI

summary_tab

load server: uvicorn --host 0.0.0.0 main:app

Open: index.html

0.3.2 - [FAILED] trial with custom UI

Requires fixing the UI, so that it can show the chain of conversation.

0.4 - Dockerfile included

talktome's People

Contributors

tashinahmed avatar

Watchers

 avatar  avatar

talktome's Issues

Code generating LLM not implemented.

Code generating LLM are under LFS that takes quite some time to download, so tried to utilize small LM to show the PoC. Goal is to deploy LLMs like, LLAMA, StarCoder, WizardLLM and so on.

Prompt Security Features Implementation

Preventing non-code o/p is implemented only.

Implementation like,

  1. Input Validation: Validate input parameters to prevent injection attacks or malformed input using FastAPI's built-in features.
  2. Output Sanitization: Remove potentially harmful information from the output before returning it to the client.
  3. Access Control: Implement mechanisms like authentication and authorization to restrict access to endpoints as needed.
  4. Secure Coding Practices: Follow best practices like avoiding hardcoded credentials and sanitizing inputs to prevent injection attacks.
  5. Review for Vulnerabilities: Regularly review code for vulnerabilities like SQL injection or XSS and address them.
  6. Regular Updates and Patch Management: Keep dependencies up-to-date to patch security vulnerabilities promptly.
  7. Monitoring and Logging: Implement logging for monitoring and audit purposes, and set up systems to detect suspicious activities.
  8. Encryption: Encrypt communication with HTTPS/TLS and sensitive data stored within the application.
  9. Threat Modeling and Risk Assessment: Identify security threats and vulnerabilities specific to the application, and prioritize security measures accordingly.
  10. Security Testing: Conduct penetration testing and vulnerability scanning, including automated testing in CI/CD pipelines.
  11. Secure Deployment and Configuration: Deploy securely, following best practices for server and network security, and apply the principle of least privilege.

Is under todo list.

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.