forked from opea-project/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deployment example for CodeTrans (opea-project#281)
* Add deployment example for CodeTrans Signed-off-by: devpramod <[email protected]> * fix doc build Signed-off-by: devpramod <[email protected]> * fix typos, grammar - xeon Signed-off-by: devpramod <[email protected]> * fix typos, grammar - gaudi Signed-off-by: devpramod <[email protected]> --------- Signed-off-by: devpramod <[email protected]> Co-authored-by: Ying Hu <[email protected]> Signed-off-by: rbrygaro <[email protected]>
- Loading branch information
Showing
4 changed files
with
834 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.. _CodeTrans_Guide: | ||
|
||
Code Translation Sample Guide | ||
############################## | ||
|
||
.. note:: This guide is in its early development and is a work-in-progress with | ||
placeholder content. | ||
|
||
Overview | ||
******** | ||
|
||
This example showcases a code translation system that converts code from one programming language to another while preserving the original logic and functionality. The primary component is the CodeTrans MegaService, which encompasses an LLM microservice that performs the actual translation. | ||
A lightweight Gateway service and a User Interface allow users to submit their source code in a given language and receive the translated output in another language. | ||
|
||
Purpose | ||
******* | ||
* **Enable code conversion and modernization**: Developers can seamlessly migrate legacy code to newer languages or frameworks, leveraging modern best practices without having to rewrite large code bases from scratch. | ||
|
||
* **Facilitate multi-language support**: By providing a system that understands multiple programming languages, organizations can unify their development approaches and reduce the barrier to adopting new languages. | ||
|
||
* **Improve developer productivity**: Automated code translation drastically reduces manual, time-consuming porting efforts, allowing developers to focus on higher-level tasks like feature design and optimization. | ||
|
||
How It Works | ||
************ | ||
|
||
.. figure:: /GenAIExamples/CodeTrans/assets/img/code_trans_architecture.png | ||
:alt: ChatQnA Architecture Diagram | ||
|
||
1. A user specifies the source language, the target language, and the snippet of code to be translated. This request is handled by the front-end UI or via a direct API call. | ||
|
||
|
||
2. The user’s request is sent to the CodeTrans Gateway, which orchestrates the call to the LLM MicroService. The gateway handles details like constructing prompts and managing responses. | ||
|
||
|
||
3. The large language model processes the user’s code snippet, analyzing syntax and semantics before generating an equivalent snippet in the target language. | ||
|
||
4. The gateway formats the model’s output and returns the translated code to the user, either via an API response or rendered within the UI. | ||
|
||
|
||
Deployment | ||
********** | ||
Here are some deployment options, depending on your hardware and environment: | ||
|
||
Single Node | ||
+++++++++++++++ | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
Xeon Scalable Processor <deploy/xeon> | ||
Gaudi <deploy/gaudi> |
Oops, something went wrong.