# Human Preference Based Multi Language Model
## Demands and Motivation
People have different preferences for different language models. Based on the selection algorithm, we have created a platform that can provide models that are more in line with user preferences for dialogue.
## Development Environment
- Language: Java 17 (Spring Boot Framework)
- Database: Firestore (Firebase)
- Language Model: GPT-3 (LangChain4j), Gemini-pro (GCP), Cohere
- Web: HTML, CSS, JavaScript
- Deployment: Maven, Docker, Artifact Registry (GCP), CloudRun (GCP)
- Version managment: Git, GitHub
## Development Operating Procedure
1. Demands List
2. Pull Request
3. Code Review
## Software Architecture
- Clean Architecture
- Entity: User domain
- Repository: DB, User repository
- UseCase: LM UseCase, User UseCase
- Presentation: MVC (Web)
- MVC
- Controller: User Controller, Web Controller
## Design Pattern
- SOLID Principle
- Clean Code: Modularization, Low Coupling
- Singleton Pattern
- Simple Factory Pattern
## LM Selection Algorithm
- Segment query in random
- Offset the weight of all models when one of models less than 0
## Presentation Layer
- Restful API
- Web API to notify controller
- Use authenticated @RequestBody to improve security
## Bottlenecks
### Previous Plan
- Too optimistic about development progress
- Overestimating the original question
### Current plan
- Each language models were not so easy to connect
- Assigning tasks to members is not simple
## Outcome

## Future Plan
- Complete the deployment
- Support more language models, e.g. Llama, HuggingFace
- Add cache with Redis
## Contributions
- 蘇東毅
- Architecture
- App deployment
- Entity
- Repository
- Data Storage
- LM UseCase
- LM Selection Algorithm
- User UseCase
- 林彥丞
- Web View
- Web Controller
- User Controller
- Entity
- 胡智涵
- LM UseCase(因為不會接被取代了)
- LM Selection Algorithm(因為寫太爛被取代了)