You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CodeTranslation/README.md
+25-31Lines changed: 25 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
## Code Translation
2
2
3
3
A full-stack code translation application that converts code between programming languages using AI.
4
-
The system integrates a FastAPI backend powered by CodeLlama-34b-instruct, alongside a modern React + Vite + Tailwind CSS frontend for an intuitive translation experience.
4
+
The system integrates a FastAPI backend, alongside a modern React + Vite + Tailwind CSS frontend for an intuitive translation experience.
5
5
6
6
## Table of Contents
7
7
@@ -17,7 +17,7 @@ The system integrates a FastAPI backend powered by CodeLlama-34b-instruct, along
17
17
18
18
## Project Overview
19
19
20
-
The **Code Translation** application demonstrates how large language models can be used to translate code between different programming languages. It accepts source code in one language, processes it through CodeLlama-34b-instruct, and returns translated code in the target language. This project integrates seamlessly with cloud-hosted APIs or local model endpoints, offering flexibility for research, enterprise, or educational use.
20
+
The **Code Translation** application demonstrates how large language models can be used to translate code between different programming languages. It accepts source code in one language, processes it and returns translated code in the target language. This project integrates seamlessly with cloud-hosted APIs or local model endpoints, offering flexibility for research, enterprise, or educational use.
21
21
22
22
---
23
23
@@ -27,9 +27,8 @@ The **Code Translation** application demonstrates how large language models can
27
27
28
28
- Code translation between 6 languages (Java, C, C++, Python, Rust, Go)
29
29
- PDF code extraction with pattern recognition
30
-
- CodeLlama-34b-instruct for accurate translations
31
30
- Enterprise inference endpoints
32
-
-Keycloak authentication for secure API access
31
+
-Token-based authentication for inference API
33
32
- Comprehensive error handling and logging
34
33
- File validation and size limits
35
34
- CORS enabled for web integration
@@ -70,8 +69,7 @@ Below is the architecture as it consists of a server that waits for code input o
70
69
end
71
70
72
71
subgraph "External Services"
73
-
E[Keycloak Auth]
74
-
F[CodeLlama-34b Model]
72
+
E[CodeLlama-34b Model]
75
73
end
76
74
77
75
A1 --> B
@@ -80,31 +78,29 @@ Below is the architecture as it consists of a server that waits for code input o
80
78
B --> C
81
79
C -->|Extracted Code| B
82
80
B --> D
83
-
D -->|Get Token| E
84
-
E -->|Access Token| D
85
-
D -->|Translate Code + Token| F
86
-
F -->|Translated Code| D
81
+
D -->|Translate Code + Token| E
82
+
E -->|Translated Code| D
87
83
D --> B
88
84
B --> A
89
85
90
86
style A fill:#e1f5ff
91
87
style B fill:#fff4e1
92
-
style F fill:#e1ffe1
88
+
style E fill:#e1ffe1
93
89
```
94
90
95
-
This application is built with enterprise inference capabilities using Keycloak for authentication and CodeLlama-34b-instruct for code translation.
91
+
This application is built with enterprise inference capabilities using token-based authentication and CodeLlama-34b-instruct for code translation.
96
92
97
93
**Service Components:**
98
94
99
95
1.**React Web UI (Port 3000)** - Provides side-by-side code comparison interface with language selection, PDF upload, and real-time translation results
100
96
101
-
2.**FastAPI Backend (Port 5001)** - Handles code validation, PDF extraction, Keycloak authentication, and orchestrates code translation through CodeLlama model
97
+
2.**FastAPI Backend (Port 5001)** - Handles code validation, PDF extraction, inference API authentication, and orchestrates code translation through CodeLlama model
102
98
103
99
**Typical Flow:**
104
100
105
101
1. User enters code or uploads a PDF through the web UI.
106
102
2. The backend validates the input and extracts code if needed.
107
-
3. The backend authenticates with Keycloak and calls CodeLlama model.
103
+
3. The backend authenticates with inference API and calls CodeLlama model.
108
104
4. The model translates the code to the target language.
109
105
5. The translated code is returned and displayed to the user.
110
106
6. User can copy the translated code with one click.
@@ -118,7 +114,13 @@ This application is built with enterprise inference capabilities using Keycloak
118
114
Before you begin, ensure you have the following installed:
0 commit comments