Upload 7 files
Browse filesFiles changed (7)
- DockerfileAdded+27
- GPTInferenceService.protoAdded+48
- VertexInferenceService.protoAdded+39
- cloud_model.jsonAdded+975
- index.jsAdded+270
- package-lock.jsonAdded+463
- package.jsonAdded+18
123456789101112131415161718192021222324252627# 使用 node:20.16.0-alpine 作为基础镜像
FROM node:20.16.0-alpine
# 设置工作目录
WORKDIR /app
# 复制 package.json 和 package-lock.json 到工作目录
COPY package*.json ./
# 设置环境变量
ENV API_PREFIX="" \
API_KEY="" \
MAX_RETRY_COUNT=3 \
RETRY_DELAY=10000 \
PORT=8787
# 安装项目依赖
RUN npm install
# 复制项目的源代码到工作目录
COPY . .
# 暴露应用运行的端口(假设应用运行在 3000 端口)
EXPOSE 8787
# 启动应用
CMD ["npm", "run", "dev"]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748syntax = "proto3"; // 使用Protobuf版本3
package runtime.aot.machine_learning.parents.gpt;
service GPTInferenceService {
rpc Predict (Request) returns (Response);
rpc PredictWithStream (Request) returns (stream Response);
}
// Global
message Message {
uint64 role = 1; // 值 0 为 system,1 为普通,回复中只有 1
string message = 2;
}
// Requests
message Request {
string models = 1; // 模型名称
repeated Message messages = 2; // 消息列表
double temperature = 3; // 采样温度
double top_p = 4; // 核心采样
}
// Response
message Response {
uint64 response_code = 2; // 返回状态码,200,439 等,204 为终止
optional Body body = 4;
}
message Body{
string id = 1; // eg.chatcmpl-ANcM3OsoLf6AXJpO76pDoW7Ry68oc
string object = 2; // eg. chat.completion
uint64 time = 3; // UNIX时间戳
MessageWarpper message_warpper = 4;
Unknown unknown = 5;
}
message MessageWarpper {
int64 arg1 = 1; // 也许是常量1
Message message = 2; // 回应的消息 wt u need
}
message Unknown {
// 都不知道
int64 arg1 = 1;
int64 arg2 = 2;
int64 arg3 = 3;
}123456789101112131415161718192021222324252627282930313233343536373839syntax = "proto3"; // 使用Protobuf版本3
package runtime.aot.machine_learning.parents.vertex;
service VertexInferenceService {
rpc Predict (Requests) returns (Response);
rpc PredictWithStream (Requests) returns (stream Response);
}
//Global
message Messages{
int64 unknown = 1; // 也许只是常量1(请求)/3(回应)
string message = 2; // 消息
}
// Requests
message Requests {
string models = 1; // 模型名称
Args args = 2;
}
message Args {
reserved 1;
Messages messages = 2; // 消息,可以视作user
string rules = 3; // 规则,可以视作system
}
// Response
message Response {
int64 response_code = 2; // 返回状态码,200,439等
Args1 args = 4;
}
message Args1{
Args2 args = 1; // 不知道什么意义的套一层
}
message Args2{
Messages args = 2; // 不知道什么意义的套一层
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975{
"iterable": [
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "031da359-0208-426f-97b2-5a701fd5562f",
"version": "t11-v09-i01",
"created": {
"value": "2024-05-22T16:00:00.000Z",
"readable": "5 months ago"
},
"name": "Phi-3-mini-4k-instruct",
"type": "SPEED",
"usage": "CODE_CONVERSATION",
"foundation": "PHI_3_MINI",
"loaded": false,
"unique": "Phi-3-mini-4k-instruct.q4_K_M",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 2560,
"input": 2048,
"output": 512
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "06bb0f96-6fbf-4668-ab5e-7b8ec17e5298",
"version": "t16-v01-i01",
"created": {
"value": "2023-09-15T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "(PaLM2) Chat Model",
"cloud": true,
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "CHAT_BISON",
"loaded": false,
"unique": "chat-bison",
"provider": "GOOGLE",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 9000,
"input": 8000,
"output": 1000
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "0f1828ec-143f-4407-81b2-3bec18f8e5e7",
"version": "t31-v01-i01",
"created": {
"value": "2024-07-17T16:00:00.000Z",
"readable": "3 months ago"
},
"name": "GPT-4o Mini Chat Model",
"cloud": true,
"type": "SPEED",
"usage": "CODE_CONVERSATION",
"foundation": "GPT_4",
"loaded": false,
"unique": "gpt-4o-mini",
"provider": "OPENAI",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 80384,
"input": 64000,
"output": 16384
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "12b21e42-65fc-4e86-939e-f25e8cdc9d53",
"version": "t09-v01-i01",
"created": {
"value": "2023-05-22T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "Extractive Tags Model",
"type": "BALANCED",
"usage": "CODE_EXTRACTIVE_TAGS",
"foundation": "T5",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "135883b4-a624-49bc-a179-e59a5eac66a8",
"version": "t06-v03-i01",
"created": {
"value": "2023-05-31T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "Neural Code Search Model",
"type": "BALANCED",
"usage": "TLP_NEURAL_CODE_SEARCH",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "187c5a80-8cf4-4e4a-85b3-7d297f1c792c",
"version": "t01-v04-i00",
"created": {
"value": "2022-01-11T16:00:00.000Z",
"readable": "3 years ago"
},
"name": "Code Classification Model - 43 languages",
"type": "BALANCED",
"usage": "CODE_CLASSIFICATION",
"foundation": "T5",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "187dacfd-1fcd-4779-94a0-382f4c0e2812",
"version": "t25-v01-i01",
"created": {
"value": "2024-05-27T16:00:00.000Z",
"readable": "5 months ago"
},
"name": "Gemini-1.5 Pro Chat Model",
"cloud": true,
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "GEMINI_1.5",
"loaded": false,
"unique": "gemini-1.5-pro",
"provider": "GOOGLE",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 128000,
"input": 119808,
"output": 8192
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "1abb21be-3d6a-4723-84d6-81de6f171a98",
"version": "t24-v01-i01",
"created": {
"value": "2024-05-14T16:00:00.000Z",
"readable": "5 months ago"
},
"name": "GPT-4o Chat Model",
"cloud": true,
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "GPT_4",
"loaded": false,
"unique": "gpt-4o",
"provider": "OPENAI",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 68096,
"input": 64000,
"output": 4096
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "1bd2525e-5ba4-41cd-b4ba-255d2faac66e",
"version": "t15-v01-i01",
"created": {
"value": "2023-09-15T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "Codey (PaLM2) Chat Model",
"cloud": true,
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "CODECHAT_BISON",
"loaded": false,
"unique": "codechat-bison",
"provider": "GOOGLE",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 7000,
"input": 6000,
"output": 1000
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "253ef645-535f-4980-875c-70ce8c88ce0d",
"version": "t03-v05-i03",
"created": {
"value": "2023-05-14T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "OCR Model",
"type": "BALANCED",
"usage": "OCR",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "257c8c88-e81c-427f-8e6f-f3026b363dcf",
"version": "t28-v01-i01",
"created": {
"value": "2024-02-28T16:00:00.000Z",
"readable": "8 months ago"
},
"name": "Claude 3 Sonnet Chat Model",
"cloud": true,
"type": "SPEED",
"usage": "CODE_CONVERSATION",
"foundation": "CLAUDE_3",
"loaded": false,
"unique": "claude-3-sonnet@20240229",
"provider": "ANTHROPIC",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 40000,
"input": 35000,
"output": 4096
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "34fd0e2b-5bd1-413d-b768-de52d9ba3b6e",
"version": "t02-v02-i03",
"created": {
"value": "2022-02-16T16:00:00.000Z",
"readable": "3 years ago"
},
"name": "Text vs. Code Model",
"type": "SPEED",
"usage": "TEXT_VS_CODE",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "3b4d25f6-12ba-42bb-bcb9-9eb98c6a893e",
"version": "t11-v06-i01",
"created": {
"value": "2024-01-21T16:00:00.000Z",
"readable": "9 months ago"
},
"name": "NeuralHermes-2.5-Mistral-7B Chat Model",
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "MISTRAL_7B",
"loaded": false,
"unique": "neuralhermes-2.5-mistral-7b.q4_K_M",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 2560,
"input": 2048,
"output": 512
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "40930f41-1275-448d-be46-768f180e9425",
"version": "t21-v01-i01",
"created": {
"value": "2023-11-09T16:00:00.000Z",
"readable": "12 months ago"
},
"name": "FastText Text Embedding Model",
"type": "SPEED",
"usage": "TEXT_EMBEDDING",
"foundation": "FAST_TEXT",
"loaded": false,
"provider": "META",
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "420b7401-9c99-4109-acda-733258dc24d7",
"version": "t11-v04-i01",
"created": {
"value": "2023-08-30T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "CodeLlama Chat Model",
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "CODE_LLAMA_2_7B",
"loaded": false,
"unique": "codellama-7b-instruct.Q4_K_M",
"cpu": false,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "42aa3109-d147-4b66-a265-c3dac3104ce0",
"version": "t11-v08-i01",
"created": {
"value": "2024-05-21T16:00:00.000Z",
"readable": "5 months ago"
},
"name": "Llama-3 8B Instruct",
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "LLAMA_3_8B",
"loaded": false,
"unique": "llama-3-8b-instruct.q4_K_M",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 2560,
"input": 2048,
"output": 512
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "463169d9-c8e9-4e3d-936b-54cd3f65344a",
"version": "t11-v12-i01",
"created": {
"value": "2024-05-23T16:00:00.000Z",
"readable": "5 months ago"
},
"name": "gemma-1.1-7b-it",
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "GEMMA_1.1_7B",
"loaded": false,
"unique": "gemma-1.1-7b-it.q4_K_M",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 2560,
"input": 2048,
"output": 512
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "4b5abcef-e526-4dc2-b697-e5669074487e",
"version": "t10-v01-i01",
"created": {
"value": "2023-06-14T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "Extractive Links Model",
"type": "BALANCED",
"usage": "CODE_EXTRACTIVE_LINKS",
"foundation": "T5",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "4dc08c68-4c4c-46b8-b047-e4e92b491b45",
"version": "t20-v01-i01",
"created": {
"value": "2023-11-09T16:00:00.000Z",
"readable": "12 months ago"
},
"name": "Jina Text Embedding Model",
"type": "ACCURACY",
"usage": "TEXT_EMBEDDING",
"loaded": false,
"provider": "JINA",
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "58df6d22-49ab-4dc2-9b41-17114429bef3",
"version": "t18-v01-i01",
"created": {
"value": "2023-11-09T16:00:00.000Z",
"readable": "12 months ago"
},
"name": "Unixcoder Code Search Model",
"type": "ACCURACY",
"usage": "CODE_SEARCH",
"foundation": "UNIXCODER",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "5a5ca381-2115-424a-8bb3-6e519bd2c685",
"version": "t04-v02-i01",
"created": {
"value": "2022-10-04T16:00:00.000Z",
"readable": "2 years ago"
},
"name": "Tagify Code Model",
"type": "BALANCED",
"usage": "TAGIFY_CODE",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "5b17e353-f1de-4c41-aa1d-414411a853ce",
"version": "t08-v01-i01",
"created": {
"value": "2023-05-22T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "Suggested Search Queries Model",
"type": "BALANCED",
"usage": "CODE_SEARCH_QUERIES",
"foundation": "T5",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "5eeebada-ba38-461d-a3ed-a80684f96f41",
"version": "t22-v01-i01",
"created": {
"value": "2024-01-07T16:00:00.000Z",
"readable": "10 months ago"
},
"name": "(Gemini) Chat Model",
"cloud": true,
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "GEMINI",
"loaded": false,
"unique": "gemini-pro",
"provider": "GOOGLE",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 32000,
"input": 20000,
"output": 8000
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "642c5822-f19d-4eb6-af53-7cea68987e37",
"version": "t11-v14-i01",
"created": {
"value": "2024-05-27T16:00:00.000Z",
"readable": "5 months ago"
},
"name": "codegemma-1.1-7b-it",
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "CODE_GEMMA_7B",
"loaded": false,
"unique": "codegemma-1.1-7b-it.q4_K_M",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 2560,
"input": 2048,
"output": 512
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "66d4b152-651f-4b91-a195-2d0db32e63d7",
"version": "t12-v01-i01",
"created": {
"value": "2023-06-14T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "Related People Model",
"type": "BALANCED",
"usage": "CODE_RELATED_PEOPLE",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "670e74c0-acbd-4daa-a356-e4565f2e0c5d",
"version": "t29-v01-i01",
"created": {
"value": "2024-02-28T16:00:00.000Z",
"readable": "8 months ago"
},
"name": "Claude 3 Opus Chat Model",
"cloud": true,
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "CLAUDE_3",
"loaded": false,
"unique": "claude-3-opus@20240229",
"provider": "ANTHROPIC",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 40000,
"input": 35000,
"output": 4096
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "6cf576b1-2a97-40bd-b06d-941c41c6db1d",
"version": "t11-v11-i01",
"created": {
"value": "2024-05-23T16:00:00.000Z",
"readable": "5 months ago"
},
"name": "gemma-1.1-2b-it",
"type": "SPEED",
"usage": "CODE_CONVERSATION",
"foundation": "GEMMA_1.1_2B",
"loaded": false,
"unique": "gemma-1.1-2b-it.q4_K_M",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 2560,
"input": 2048,
"output": 512
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "6fd521ff-faeb-46b2-8c3d-9d01c16845a4",
"version": "t23-v01-i01",
"created": {
"value": "2024-02-08T16:00:00.000Z",
"readable": "9 months ago"
},
"name": "GPT-4 Turbo Chat Model",
"cloud": true,
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "GPT_4",
"loaded": false,
"unique": "gpt-4-turbo",
"provider": "OPENAI",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 68096,
"input": 64000,
"output": 4096
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "76f39fed-8aa8-4176-b991-e09ab7354a72",
"version": "t11-v07-i01",
"created": {
"value": "2024-02-12T16:00:00.000Z",
"readable": "8 months ago"
},
"name": "Phi-2 Chat Model",
"type": "SPEED",
"usage": "CODE_CONVERSATION",
"foundation": "PHI_2",
"loaded": false,
"unique": "dolphin-2_6-phi-2.q4_K_M",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 2048,
"input": 1536,
"output": 512
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "79c76775-4c58-4f97-a1e0-f9de69041854",
"version": "t11-v02-i01",
"created": {
"value": "2023-08-17T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "Llama-2 7B Chat Model",
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "LLAMA_2_7B",
"loaded": false,
"unique": "llama-2-7b-chat.q4_K_M",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 2560,
"input": 2048,
"output": 512
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "898f57a2-90f9-42bb-bc3b-c3dbb4b89559",
"version": "t05-v01-i02",
"created": {
"value": "2023-05-13T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "Code Description Model",
"type": "BALANCED",
"usage": "CODE_DESCRIPTION",
"foundation": "T5",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "8f9183eb-34e7-418d-828f-e2fc0e1d655d",
"version": "t11-v10-i01",
"created": {
"value": "2024-05-23T16:00:00.000Z",
"readable": "5 months ago"
},
"name": "Phi-3-mini-128k-instruct",
"type": "SPEED",
"usage": "CODE_CONVERSATION",
"foundation": "PHI_3_MINI",
"loaded": false,
"unique": "Phi-3-mini-128k-instruct.q4_K_M",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 2560,
"input": 2048,
"output": 512
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "9c296470-1094-4a73-b236-02d5a5203a25",
"version": "t26-v01-i01",
"created": {
"value": "2024-05-27T16:00:00.000Z",
"readable": "5 months ago"
},
"name": "Gemini-1.5 Flash Chat Model",
"cloud": true,
"type": "SPEED",
"usage": "CODE_CONVERSATION",
"foundation": "GEMINI_1.5",
"loaded": false,
"unique": "gemini-1.5-flash",
"provider": "GOOGLE",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 128000,
"input": 119808,
"output": 8192
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "a249403b-87f2-4b75-9d99-cde24e70d9c5",
"version": "t11-v15-i01",
"created": {
"value": "2024-06-13T16:00:00.000Z",
"readable": "4 months ago"
},
"name": "granite-3b-code-instruct",
"type": "SPEED",
"usage": "CODE_CONVERSATION",
"foundation": "GRANITE_3B",
"loaded": false,
"unique": "granite-3b-code-instruct.q4_K_M",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 2048,
"input": 1536,
"output": 512
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "c70725a7-f8a7-4189-8572-65e91a9fbf32",
"version": "t27-v01-i01",
"created": {
"value": "2024-06-19T16:00:00.000Z",
"readable": "4 monmodel.jsonths ago"
},
"name": "Claude 3.5 Sonnet Chat Model",
"cloud": true,
"type": "SPEED",
"usage": "CODE_CONVERSATION",
"foundation": "CLAUDE_3.5",
"loaded": false,
"unique": "claude-3-5-sonnet@20240620",
"provider": "ANTHROPIC",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 40000,
"input": 35000,
"output": 4096
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "c974b66a-4f97-434b-8d05-2c20f3ea2b00",
"version": "t30-v01-i01",
"created": {
"value": "2024-03-26T16:00:00.000Z",
"readable": "7 months ago"
},
"name": "Claude 3 Haiku Chat Model",
"cloud": true,
"type": "SPEED",
"usage": "CODE_CONVERSATION",
"foundation": "CLAUDE_3",
"loaded": false,
"unique": "claude-3-haiku@20240307",
"provider": "ANTHROPIC",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 40000,
"input": 35000,
"output": 4096
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "cfb463c1-c82e-4f2b-b9c9-65eeecf3e8d0",
"version": "t19-v01-i01",
"created": {
"value": "2023-11-09T16:00:00.000Z",
"readable": "12 months ago"
},
"name": "VideoOCR Model",
"type": "BALANCED",
"usage": "VIDEO_OCR",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "d53cfc04-0648-4821-8f0e-fae0ef9f1a82",
"version": "t07-v01-i02",
"created": {
"value": "2023-05-13T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "Code Titles Model",
"type": "BALANCED",
"usage": "CODE_TITLE",
"foundation": "T5",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "d5c4edcf-8761-4c46-bf50-1100646014c3",
"version": "t13-v01-i01",
"created": {
"value": "2023-09-15T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "GPT-3.5-turbo Chat Model",
"cloud": true,
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "GPT_3.5",
"loaded": false,
"unique": "gpt-3.5-turbo",
"provider": "OPENAI",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 16000,
"input": 12000,
"output": 4000
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "d6dd5fb4-5d6d-411d-bb96-c0899ace97d4",
"version": "t14-v01-i01",
"created": {
"value": "2023-09-15T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "GPT-4 Chat Model",
"cloud": true,
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "GPT_4",
"loaded": false,
"unique": "gpt-4",
"provider": "OPENAI",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 8000,
"input": 4100,
"output": 3900
}
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "e9c08f55-f5d1-45ef-b7fd-0aadcc96e77e",
"version": "t17-v01-i01",
"created": {
"value": "2022-11-07T16:00:00.000Z",
"readable": "about a year ago"
},
"name": "Text vs. Code Segmentation Model",
"type": "SPEED",
"usage": "TEXT_VS_CODE_SEGMENTATION",
"loaded": false,
"cpu": true,
"downloading": false
},
{
"schema": {
"migration": 0,
"semantic": "MAJOR_0_MINOR_0_PATCH_1"
},
"id": "eaace961-244a-441e-8283-5d0edac70e2b",
"version": "t11-v15-i01",
"created": {
"value": "2024-06-13T16:00:00.000Z",
"readable": "4 months ago"
},
"name": "granite-8b-code-instruct",
"type": "BALANCED",
"usage": "CODE_CONVERSATION",
"foundation": "GRANITE_8B",
"loaded": false,
"unique": "granite-8b-code-instruct.q4_K_M",
"cpu": false,
"downloading": false,
"maxTokens": {
"total": 2560,
"input": 2048,
"output": 512
}
}
]
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270import grpc from '@grpc/grpc-js';
import protoLoader from '@grpc/proto-loader';
import { AutoRouter, json, error, cors } from 'itty-router';
import dotenv from 'dotenv';
import { createServerAdapter } from '@whatwg-node/server';
import { createServer } from 'http';
// 加载环境变量
dotenv.config();
// 初始化配置
class Config {
constructor() {
this.API_PREFIX = process.env.API_PREFIX || '/';
this.API_KEY = process.env.API_KEY || '';
this.MAX_RETRY_COUNT = process.env.MAX_RETRY_COUNT || 3;
this.RETRY_DELAY = process.env.RETRY_DELAY || 5000;
this.COMMON_GRPC = 'runtime-native-io-vertex-inference-grpc-service-lmuw6mcn3q-ul.a.run.app';
this.COMMON_PROTO = './VertexInferenceService.proto';
this.GPT_GRPC = 'runtime-native-io-gpt-inference-grpc-service-lmuw6mcn3q-ul.a.run.app';
this.GPT_PROTO = './GPTInferenceService.proto';
this.PORT = process.env.PORT || 8787;
}
}
const config = new Config();
// 中间件
// 添加运行回源
const { preflight, corsify } = cors({
origin: '*',
allowMethods: '*',
exposeHeaders: '*',
});
// 添加认证
const withAuth = (request) => {
if (config.API_KEY) {
const authHeader = request.headers.get('Authorization');
if (!authHeader || !authHeader.startsWith('Bearer ')) {
return error(401, 'Unauthorized: Missing or invalid Authorization header');
}
const token = authHeader.substring(7);
if (token !== config.API_KEY) {
return error(403, 'Forbidden: Invalid API key');
}
}
};
// 返回运行信息
const logger = (res, req) => {
console.log(req.method, res.status, req.url, Date.now() - req.start, 'ms');
};
const router = AutoRouter({
before: [preflight, withAuth],
missing: () => error(404, '404 not found.'),
finally: [corsify, logger],
});
// Router路径
router.get('/', () => json({ message: 'API 服务运行中~' }));
router.get('/ping', () => json({ message: 'pong' }));
router.post(config.API_PREFIX + '/v1/chat/completions', (req) => handleCompletion(req));
async function GrpcToPieces(models, message, rules,stream,temperature,top_p) {
// 在非GPT类型的模型中,temperature和top_p是无效的
// 使用系统的根证书
const credentials = grpc.credentials.createSsl();
if (models.includes('gpt')){
// 加载proto文件
const packageDefinition = protoLoader.loadSync(config.GPT_PROTO, {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
});
// 构建请求消息
const request = {
models: models,
messages: [
{role: 0, message: rules}, // system
{role: 1, message: message} // user
],
temperature:temperature || 0.1,
top_p:top_p ?? 1,
}
// 获取gRPC对象
const GRPCobjects = grpc.loadPackageDefinition(packageDefinition).runtime.aot.machine_learning.parents.gpt;
const client = new GRPCobjects.GPTInferenceService(config.GPT_GRPC, credentials);
for (let retryCount = 0; retryCount <= config.MAX_RETRY_COUNT; retryCount++) {
try {
// 使用 Promise 包装异步 gRPC 调用
const response = await new Promise((resolve, reject) => {
client.Predict(request, (err, response) => {
if (err) {
reject(err);
} else {
resolve(response);
}
});
});
// 处理响应
let response_code = response.response_code;
let response_message = response.body.message_warpper.message;
// 检查解构结果
if (!response_code || !response_message) {
console.error('Invalid response format, retrying...');
continue; // 继续重试
}
console.log('Received response from server', response);
// 如果响应成功,返回结果
if (+response_code === 200) {
return { response_code, response_message };
} else {
// 如果响应码不是200,继续重试
console.error('Non-success response code, retrying...');
}
} catch (err) {
// 捕获错误并重试
console.error('Error occurred during gRPC call:', err);
}
}
} else {
// 加载proto文件
const packageDefinition = protoLoader.loadSync(config.COMMON_PROTO,{
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
});
// 构建请求消息
const request = {
models: models,
args: {
messages: {
unknown: 1,
message: message
},
rules: rules
}
};
// 获取gRPC对象
const GRPCobjects = grpc.loadPackageDefinition(packageDefinition).runtime.aot.machine_learning.parents.vertex;
const client = new GRPCobjects.VertexInferenceService(config.COMMON_GRPC, credentials);
for (let retryCount = 0; retryCount <= config.MAX_RETRY_COUNT; retryCount++) {
try {
// 使用 Promise 包装异步 gRPC 调用
const response = await new Promise((resolve, reject) => {
client.Predict(request, (err, response) => {
if (err) {
reject(err);
} else {
resolve(response);
}
});
});
// 处理响应
let response_code = response.response_code;
let response_message = response.args.args.args.message;
// 检查解构结果
if (!response_code || !response_message) {
console.error('Invalid response format, retrying...');
continue; // 继续重试
}
console.log('Received response from server', response);
// 如果响应成功,返回结果
if (+response_code === 200) {
return { response_code, response_message };
} else {
// 如果响应码不是200,继续重试
console.error('Non-success response code, retrying...');
}
} catch (err) {
// 捕获错误并重试
console.error('Error occurred during gRPC call:', err);
}
}
}
}
async function messagesProcess(messages) {
let rules = '';
let message = '';
for (const msg of messages) {
let role = msg.role;
// 格式化为字符串
const contentStr = Array.isArray(msg.content)
? msg.content
.filter((item) => item.text)
.map((item) => item.text)
.join('') || ''
: msg.content;
// 判断身份
if (role === 'system') {
rules += `system:${contentStr};\r\n`;
} else if (['user', 'assistant'].includes(role)) {
message += `${role}:${contentStr};\r\n`;
}
}
return { rules, message };
}
async function ConvertOpenai(messages,response_code,stream) {
if (response_code !== 200) {
//todo 不知道返回什么
}
if (stream){
// todo
} else {
return new Response(JSON.stringify(ChatCompletionWithModel(messages, response_code)), {
headers: {
'Content-Type': 'application/json',
},
});
}
}
function ChatCompletionWithModel(message, model) {
return {
id: 'Chat-Nekohy',
object: 'chat.completion',
created: Date.now(),
model,
usage: {
prompt_tokens: 0,
completion_tokens: 0,
total_tokens: 0,
},
choices: [
{
message: {
content: message,
role: 'assistant',
},
index: 0,
},
],
};
}
async function handleCompletion(request) {
try {
// todo stream逆向接口
// 解析openai格式API请求
const { model: inputModel, messages, stream:todo,temperature,top_p} = await request.json();
console.log(inputModel,messages,todo)
let stream = false;
// 解析system和user/assistant消息
const { rules, message:content } = await messagesProcess(messages);
console.log(rules,content)
// 响应码,回复的消息
const { response_code, response_message } = await GrpcToPieces(inputModel, content, rules, stream, temperature, top_p);
// 转换为OpenAi格式
return await ConvertOpenai(response_message,response_code,stream)
} catch (err) {
return error(500, err.message);
}
}
(async () => {
//For Cloudflare Workers
if (typeof addEventListener === 'function') return;
// For Nodejs
const ittyServer = createServerAdapter(router.fetch);
console.log(`Listening on http://localhost:${config.PORT}`);
const httpServer = createServer(ittyServer);
httpServer.listen(config.PORT);
})();123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463{
"name": "pieces-os",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "pieces-os",
"version": "1.0.0",
"dependencies": {
"@grpc/grpc-js": "^1.12.2",
"@grpc/proto-loader": "^0.7.13",
"@whatwg-node/server": "^0.9.50",
"dotenv": "^16.4.5",
"itty-router": "^5.0.18"
}
},
"node_modules/@grpc/grpc-js": {
"version": "1.12.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@grpc/grpc-js/-/grpc-js-1.12.2.tgz",
"integrity": "sha512-bgxdZmgTrJZX50OjyVwz3+mNEnCTNkh3cIqGPWVNeW9jX6bn1ZkU80uPd+67/ZpIJIjRQ9qaHCjhavyoWYxumg==",
"license": "Apache-2.0",
"dependencies": {
"@grpc/proto-loader": "^0.7.13",
"@js-sdsl/ordered-map": "^4.4.2"
},
"engines": {
"node": ">=12.10.0"
}
},
"node_modules/@grpc/proto-loader": {
"version": "0.7.13",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@grpc/proto-loader/-/proto-loader-0.7.13.tgz",
"integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==",
"license": "Apache-2.0",
"dependencies": {
"lodash.camelcase": "^4.3.0",
"long": "^5.0.0",
"protobufjs": "^7.2.5",
"yargs": "^17.7.2"
},
"bin": {
"proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@js-sdsl/ordered-map": {
"version": "4.4.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz",
"integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==",
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/js-sdsl"
}
},
"node_modules/@kamilkisiela/fast-url-parser": {
"version": "1.1.4",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@kamilkisiela/fast-url-parser/-/fast-url-parser-1.1.4.tgz",
"integrity": "sha512-gbkePEBupNydxCelHCESvFSFM8XPh1Zs/OAVRW/rKpEqPAl5PbOM90Si8mv9bvnR53uPD2s/FiRxdvSejpRJew==",
"license": "MIT"
},
"node_modules/@protobufjs/aspromise": {
"version": "1.1.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
"integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",
"license": "BSD-3-Clause"
},
"node_modules/@protobufjs/base64": {
"version": "1.1.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@protobufjs/base64/-/base64-1.1.2.tgz",
"integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",
"license": "BSD-3-Clause"
},
"node_modules/@protobufjs/codegen": {
"version": "2.0.4",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@protobufjs/codegen/-/codegen-2.0.4.tgz",
"integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==",
"license": "BSD-3-Clause"
},
"node_modules/@protobufjs/eventemitter": {
"version": "1.1.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
"integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==",
"license": "BSD-3-Clause"
},
"node_modules/@protobufjs/fetch": {
"version": "1.1.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@protobufjs/fetch/-/fetch-1.1.0.tgz",
"integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",
"license": "BSD-3-Clause",
"dependencies": {
"@protobufjs/aspromise": "^1.1.1",
"@protobufjs/inquire": "^1.1.0"
}
},
"node_modules/@protobufjs/float": {
"version": "1.0.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@protobufjs/float/-/float-1.0.2.tgz",
"integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",
"license": "BSD-3-Clause"
},
"node_modules/@protobufjs/inquire": {
"version": "1.1.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@protobufjs/inquire/-/inquire-1.1.0.tgz",
"integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==",
"license": "BSD-3-Clause"
},
"node_modules/@protobufjs/path": {
"version": "1.1.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@protobufjs/path/-/path-1.1.2.tgz",
"integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",
"license": "BSD-3-Clause"
},
"node_modules/@protobufjs/pool": {
"version": "1.1.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@protobufjs/pool/-/pool-1.1.0.tgz",
"integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",
"license": "BSD-3-Clause"
},
"node_modules/@protobufjs/utf8": {
"version": "1.1.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@protobufjs/utf8/-/utf8-1.1.0.tgz",
"integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==",
"license": "BSD-3-Clause"
},
"node_modules/@types/node": {
"version": "22.7.9",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@types/node/-/node-22.7.9.tgz",
"integrity": "sha512-jrTfRC7FM6nChvU7X2KqcrgquofrWLFDeYC1hKfwNWomVvrn7JIksqf344WN2X/y8xrgqBd2dJATZV4GbatBfg==",
"license": "MIT",
"dependencies": {
"undici-types": "~6.19.2"
}
},
"node_modules/@whatwg-node/fetch": {
"version": "0.9.22",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@whatwg-node/fetch/-/fetch-0.9.22.tgz",
"integrity": "sha512-+RIBffgoaRlWV9cKV6wAX71sbeoU2APOI3G13ZRMkabYHwkvDMeZDTyxJcsMXA5CpieJ7NFXF9Xyu72jwvdzqA==",
"license": "MIT",
"dependencies": {
"@whatwg-node/node-fetch": "^0.5.27",
"urlpattern-polyfill": "^10.0.0"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/@whatwg-node/node-fetch": {
"version": "0.5.27",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@whatwg-node/node-fetch/-/node-fetch-0.5.27.tgz",
"integrity": "sha512-0OaMj5W4fzWimRSFq07qFiWfquaUMNB+695GwE76LYKVuah+jwCdzSgsIOtwPkiyJ35w0XGhXmJPiIJCdLwopg==",
"license": "MIT",
"dependencies": {
"@kamilkisiela/fast-url-parser": "^1.1.4",
"busboy": "^1.6.0",
"fast-querystring": "^1.1.1",
"tslib": "^2.6.3"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/@whatwg-node/server": {
"version": "0.9.50",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@whatwg-node/server/-/server-0.9.50.tgz",
"integrity": "sha512-7Vd8k6iu+ps8bkZT+Y/wPm42EDh8KojAL+APKa79mntgkyPtdq0r1//CO+0eYqQBz6HGrDxHRT4KChSOy4jGIw==",
"license": "MIT",
"dependencies": {
"@whatwg-node/fetch": "^0.9.22",
"tslib": "^2.6.3"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/busboy": {
"version": "1.6.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/busboy/-/busboy-1.6.0.tgz",
"integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==",
"dependencies": {
"streamsearch": "^1.1.0"
},
"engines": {
"node": ">=10.16.0"
}
},
"node_modules/cliui": {
"version": "8.0.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/cliui/-/cliui-8.0.1.tgz",
"integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
"license": "ISC",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.1",
"wrap-ansi": "^7.0.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"license": "MIT",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
"node_modules/dotenv": {
"version": "16.4.5",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/dotenv/-/dotenv-16.4.5.tgz",
"integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==",
"license": "BSD-2-Clause",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://dotenvx.com"
}
},
"node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"license": "MIT"
},
"node_modules/escalade": {
"version": "3.2.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/escalade/-/escalade-3.2.0.tgz",
"integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/fast-decode-uri-component": {
"version": "1.0.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz",
"integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==",
"license": "MIT"
},
"node_modules/fast-querystring": {
"version": "1.1.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/fast-querystring/-/fast-querystring-1.1.2.tgz",
"integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==",
"license": "MIT",
"dependencies": {
"fast-decode-uri-component": "^1.0.1"
}
},
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"license": "ISC",
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/itty-router": {
"version": "5.0.18",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/itty-router/-/itty-router-5.0.18.tgz",
"integrity": "sha512-mK3ReOt4ARAGy0V0J7uHmArG2USN2x0zprZ+u+YgmeRjXTDbaowDy3kPcsmQY6tH+uHhDgpWit9Vqmv/4rTXwA==",
"license": "MIT"
},
"node_modules/lodash.camelcase": {
"version": "4.3.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
"integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==",
"license": "MIT"
},
"node_modules/long": {
"version": "5.2.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/long/-/long-5.2.3.tgz",
"integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==",
"license": "Apache-2.0"
},
"node_modules/protobufjs": {
"version": "7.4.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/protobufjs/-/protobufjs-7.4.0.tgz",
"integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==",
"hasInstallScript": true,
"license": "BSD-3-Clause",
"dependencies": {
"@protobufjs/aspromise": "^1.1.2",
"@protobufjs/base64": "^1.1.2",
"@protobufjs/codegen": "^2.0.4",
"@protobufjs/eventemitter": "^1.1.0",
"@protobufjs/fetch": "^1.1.0",
"@protobufjs/float": "^1.0.2",
"@protobufjs/inquire": "^1.1.0",
"@protobufjs/path": "^1.1.2",
"@protobufjs/pool": "^1.1.0",
"@protobufjs/utf8": "^1.1.0",
"@types/node": ">=13.7.0",
"long": "^5.0.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/streamsearch": {
"version": "1.1.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/streamsearch/-/streamsearch-1.1.0.tgz",
"integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==",
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/tslib": {
"version": "2.8.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/tslib/-/tslib-2.8.0.tgz",
"integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==",
"license": "0BSD"
},
"node_modules/undici-types": {
"version": "6.19.8",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/undici-types/-/undici-types-6.19.8.tgz",
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
"license": "MIT"
},
"node_modules/urlpattern-polyfill": {
"version": "10.0.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz",
"integrity": "sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==",
"license": "MIT"
},
"node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/y18n": {
"version": "5.0.8",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/y18n/-/y18n-5.0.8.tgz",
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
"license": "ISC",
"engines": {
"node": ">=10"
}
},
"node_modules/yargs": {
"version": "17.7.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/yargs/-/yargs-17.7.2.tgz",
"integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
"license": "MIT",
"dependencies": {
"cliui": "^8.0.1",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.3",
"y18n": "^5.0.5",
"yargs-parser": "^21.1.1"
},
"engines": {
"node": ">=12"
}
},
"node_modules/yargs-parser": {
"version": "21.1.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/yargs-parser/-/yargs-parser-21.1.1.tgz",
"integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
"license": "ISC",
"engines": {
"node": ">=12"
}
}
}
}123456789101112131415161718{
"name": "pieces-os",
"version": "1.0.0",
"type": "module",
"description": "",
"main": "index.js",
"scripts": {
"dev": "node index.js"
},
"private": true,
"dependencies": {
"@grpc/grpc-js": "^1.12.2",
"@grpc/proto-loader": "^0.7.13",
"@whatwg-node/server": "^0.9.50",
"dotenv": "^16.4.5",
"itty-router": "^5.0.18"
}
}DockerfileAdded+27
GPTInferenceService.protoAdded+48
VertexInferenceService.protoAdded+39
cloud_model.jsonAdded+975
index.jsAdded+270
package-lock.jsonAdded+463
package.jsonAdded+18