File size: 2,962 Bytes
8412920
 
68bb241
 
 
8412920
 
 
 
a347719
526ff2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
title: LLMServer
emoji: πŸ‘Ή
colorFrom: indigo
colorTo: purple
sdk: docker
pinned: false
---

# LLM Server

This repository contains a FastAPI-based server that serves open-source Large Language Models from Hugging Face.

## Getting Started

These instructions will help you set up and run the project on your local machine.

### Prerequisites

- Python 3.10 or higher
- Git

### Cloning the Repository

Choose one of the following methods to clone the repository:

#### HTTPS
```bash
git clone https://huggingface.co/spaces/TeamGenKI/LLMServer
cd project-name
```

#### SSH
```bash
git clone git@hf.co:spaces/TeamGenKI/LLMServer
cd project-name
```

### Setting Up the Virtual Environment

#### Windows
```bash
# Create virtual environment
python -m venv myenv

# Activate virtual environment
myenv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
```

#### Linux
```bash
# Create virtual environment
python -m venv myenv

# Activate virtual environment
source myenv/bin/activate

# Install dependencies
pip install -r requirements.txt
```

#### macOS
```bash
# Create virtual environment
python3 -m venv myenv

# Activate virtual environment
source myenv/bin/activate

# Install dependencies
pip3 install -r requirements.txt
```

### Running the Application

Once you have set up your environment and installed the dependencies, you can start the FastAPI application:

```bash
uvicorn main.app:app --reload
```

The API will be available at `http://localhost:8001`

### API Documentation

Once the application is running, you can access:
- Interactive API documentation (Swagger UI) at `http://localhost:8000/docs`
- Alternative API documentation (ReDoc) at `http://localhost:8000/redoc`

### Deactivating the Virtual Environment

When you're done working on the project, you can deactivate the virtual environment:

```bash
deactivate
```

## Contributing

[Add contributing guidelines here]

## License

[Add license information here]

## Project Structure

```
.
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ main
β”‚   β”œβ”€β”€ api.py
β”‚   β”œβ”€β”€ app.py
β”‚   β”œβ”€β”€ config.yaml
β”‚   β”œβ”€β”€ env_template
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ logs
β”‚   β”‚   └── llm_api.log
β”‚   β”œβ”€β”€ models
β”‚   β”œβ”€β”€ __pycache__
β”‚   β”‚   β”œβ”€β”€ api.cpython-39.pyc
β”‚   β”‚   β”œβ”€β”€ app.cpython-39.pyc
β”‚   β”‚   β”œβ”€β”€ __init__.cpython-39.pyc
β”‚   β”‚   └── routes.cpython-39.pyc
β”‚   β”œβ”€β”€ routes.py
β”‚   β”œβ”€β”€ test_locally.py
β”‚   └── utils
β”‚       β”œβ”€β”€ errors.py
β”‚       β”œβ”€β”€ helpers.py
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ logging.py
β”‚       β”œβ”€β”€ __pycache__
β”‚       β”‚   β”œβ”€β”€ helpers.cpython-39.pyc
β”‚       β”‚   β”œβ”€β”€ __init__.cpython-39.pyc
β”‚       β”‚   β”œβ”€β”€ logging.cpython-39.pyc
β”‚       β”‚   └── validation.cpython-39.pyc
β”‚       └── validation.py
β”œβ”€β”€ README.md
└── requirements.txt
```