[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10760":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},10760,"langchain-serve","jina-ai\u002Flangchain-serve","jina-ai","⚡ Langchain apps in production using Jina & FastAPI","https:\u002F\u002Fcloud.jina.ai",null,"Python",1641,134,5,15,0,3,54.69,"Apache License 2.0",true,false,"main",[24,25,26,27,28,29,30,31,32,33,34],"autogpt","autonomous-agents","babyagi","chatbot","fastapi","gpt","langchain","llm","production","python","slack","2026-06-12 04:00:52","> :warning: **IMPORTANT NOTICE:** This repository is no longer maintained. \n\n\u003Cp align=\"center\">\n\u003Ch2 align=\"center\">⚡ LangChain Apps on Production with Jina & FastAPI 🚀\u003C\u002Fh2>\n\u003C\u002Fp>\n\n\u003Cp align=center>\n\u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Flangchain-serve\u002F\">\u003Cimg alt=\"PyPI\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Flangchain-serve?label=Release&style=flat-square\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdiscord.jina.ai\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1106542220112302130?logo=discord&logoColor=white&style=flat-square\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fpypistats.org\u002Fpackages\u002Flangchain-serve\">\u003Cimg alt=\"PyPI - Downloads from official pypistats\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdm\u002Flangchain-serve?style=flat-square\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fjina-ai\u002Flangchain-serve\u002Factions\u002Fworkflows\u002Fcd.yml\">\u003Cimg alt=\"Github CD status\" src=\"https:\u002F\u002Fgithub.com\u002Fjina-ai\u002Flangchain-serve\u002Factions\u002Fworkflows\u002Fcd.yml\u002Fbadge.svg\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\n[Jina](https:\u002F\u002Fgithub.com\u002Fjina-ai\u002Fjina) is an open-source framework for building scalable multi modal AI apps on Production. [LangChain](https:\u002F\u002Fpython.langchain.com\u002Fen\u002Flatest\u002Findex.html) is another open-source framework for building applications powered by LLMs.\n\n**langchain-serve** helps you deploy your LangChain apps on Jina AI Cloud in a matter of seconds. You can benefit from the scalability and serverless architecture of the cloud without sacrificing the ease and convenience of local development. And if you prefer, you can also deploy your LangChain apps on your own infrastructure to ensure data privacy. With langchain-serve, you can craft REST\u002FWebsocket APIs, spin up LLM-powered conversational Slack bots, or wrap your LangChain apps into FastAPI packages on cloud or on-premises.\n\n> Give us a :star: and tell us what more you'd like to see! \n\n# ☁️ LLM Apps as-a-service\n\nlangchain-serve currently wraps following apps as a service to be deployed on Jina AI Cloud with one command.\n\n## 🔮 AutoGPT-as-a-service\n\n[AutoGPT](https:\u002F\u002Fgithub.com\u002FSignificant-Gravitas\u002FAuto-GPT) is an \"AI agent\" that given a goal in natural language, will attempt to achieve it by breaking it into sub-tasks and using the internet and other tools in an automatic loop.\n\n\u003Cdetails>\n\u003Csummary>Show usage\u003C\u002Fsummary>\n\n- Deploy `autogpt` on Jina AI Cloud with one command\n\n  ```bash\n  lc-serve deploy autogpt\n  ```\n\n  \u003Cdetails>\n  \u003Csummary>Show command output\u003C\u002Fsummary>\n\n  ```text\n  ╭──────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n  │ App ID       │                                           autogpt-6cbd489454                                           │\n  ├──────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n  │ Phase        │                                                Serving                                                 │\n  ├──────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n  │ Endpoint     │                                 wss:\u002F\u002Fautogpt-6cbd489454.wolf.jina.ai                                  │\n  ├──────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n  │ App logs     │                                        dashboards.wolf.jina.ai                                         │\n  ├──────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n  │ Swagger UI   │                              https:\u002F\u002Fautogpt-6cbd489454.wolf.jina.ai\u002Fdocs                              │\n  ├──────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────┤\n  │ OpenAPI JSON │                          https:\u002F\u002Fautogpt-6cbd489454.wolf.jina.ai\u002Fopenapi.json                          │\n  ╰──────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n  ```\n\n  \u003C\u002Fdetails>\n\n- Integrate autogpt with external services using APIs. Get a flavor of the integration on your CLI with \n    \n  ```bash\n  lc-serve playground autogpt\n  ```\n\n  \u003Cdetails>\n  \u003Csummary>Show playground\u003C\u002Fsummary>\n  \u003Cimg src=\".github\u002Fimages\u002Fautogpt-playground.gif\" title=\"autogpt-as-a-service Playground\">\n  \u003C\u002Fdetails>\n\n\u003C\u002Fdetails>\n\n## 🧠 Babyagi-as-a-service\n\n[Babyagi](https:\u002F\u002Fgithub.com\u002Fyoheinakajima\u002Fbabyagi) is a task-driven autonomous agent that uses LLMs to create, prioritize, and execute tasks. It is a general-purpose AI agent that can be used to automate a wide variety of tasks.\n\n\u003Cdetails>\n\u003Csummary>Show usage\u003C\u002Fsummary>\n\n- Deploy `babyagi` on Jina AI Cloud with one command\n\n  ```bash\n  lc-serve deploy babyagi\n  ```\n\n- Integrate babyagi with external services using our Websocket API. Get a flavor of the integration on your CLI with \n    \n  ```bash\n  lc-serve playground babyagi\n  ```\n\n  \u003Cdetails>\n  \u003Csummary>Show playground\u003C\u002Fsummary>\n  \u003Cimg src=\".github\u002Fimages\u002Fbabyagi-playground.gif\" title=\"Babyagi-as-a-service Playground\">\n  \u003C\u002Fdetails>\n\n\u003C\u002Fdetails>\n\n## :panda_face: pandas-ai-as-a-service\n\n[pandas-ai](https:\u002F\u002Fgithub.com\u002Fgventuri\u002Fpandas-ai) integrates LLM capabilities into Pandas, to make dataframes conversational in Python code. Thanks to langchain-serve, we can now expose pandas-ai APIs on Jina AI Cloud in just a matter of seconds.\n\n\u003Cdetails>\n\u003Csummary>Show usage\u003C\u002Fsummary>\n\n- Deploy **pandas-ai** on Jina AI Cloud\n\n  ```bash\n  lc-serve deploy pandas-ai\n  ```\n\n  \u003Cdetails>\n  \u003Csummary>Show command output\u003C\u002Fsummary>\n\n  ```text\n  ╭──────────────┬─────────────────────────────────────────────────────────────────────────────────╮\n  │ App ID       │                               pandasai-06879349ca                               │\n  ├──────────────┼─────────────────────────────────────────────────────────────────────────────────┤\n  │ Phase        │                                     Serving                                     │\n  ├──────────────┼─────────────────────────────────────────────────────────────────────────────────┤\n  │ Endpoint     │                     wss:\u002F\u002Fpandasai-06879349ca.wolf.jina.ai                      │\n  ├──────────────┼─────────────────────────────────────────────────────────────────────────────────┤\n  │ App logs     │                             dashboards.wolf.jina.ai                             │\n  ├──────────────┼─────────────────────────────────────────────────────────────────────────────────┤\n  │ Swagger UI   │                  https:\u002F\u002Fpandasai-06879349ca.wolf.jina.ai\u002Fdocs                  │\n  ├──────────────┼─────────────────────────────────────────────────────────────────────────────────┤\n  │ OpenAPI JSON │              https:\u002F\u002Fpandasai-06879349ca.wolf.jina.ai\u002Fopenapi.json              │\n  ╰──────────────┴─────────────────────────────────────────────────────────────────────────────────╯\n  ```\n\n  \u003C\u002Fdetails>\n\n- Upload your DataFrame to Jina AI Cloud (Optional - you can also use a publicly available CSV)\n\n  - Define your DataFrame in a Python file\n    \n    ```python\n    # dataframe.py\n    import pandas as pd\n    df = pd.DataFrame(some_data)\n    ```\n\n  - Upload your DataFrame to Jina AI Cloud using `\u003Cmodule>:\u003Cvariable>` syntax\n    \n    ```bash\n    lc-serve util upload-df dataframe:df\n    ```\n\n- Conversationalize your DataFrame using pandas-ai APIs. Get a flavor of the integration with a local playground on your CLI with \n  \n  ```bash\n  lc-serve playground pandas-ai \u003Chost>\n  ```\n  \u003Cdetails>\n  \u003Csummary>Show playground\u003C\u002Fsummary>\n  \u003Cimg src=\".github\u002Fimages\u002Fpandas-ai-playground.gif\" title=\"pandas-ai-as-a-service Playground\">\n  \u003C\u002Fdetails>\n\n\u003C\u002Fdetails>\n\n## 💬 Question Answer Bot on PDFs\n\n`pdfqna` is a simple question answering bot that uses LLMs to answer questions on PDF documents, showcasing the how easy it is to integrate langchain apps on Jina AI Cloud.\n\n\u003Cdetails>\n\u003Csummary>Show usage\u003C\u002Fsummary>\n\n- Deploy `pdf_qna` on Jina AI Cloud with one command\n\n  ```bash\n  lc-serve deploy pdf-qna\n  ```\n\n- Get a flavor of the integration with Streamlit playground on your CLI with \n    \n  ```bash\n  lc-serve playground pdf-qna\n  ```\n  \u003Cdetails>\n  \u003Csummary>Show playground\u003C\u002Fsummary>\n  \u003Cimg src=\".github\u002Fimages\u002Fpdf_qna_demo.gif\" title=\"pdf_qna Playground\">\n  \u003C\u002Fdetails>\n\n- Expand the Q&A bot to multiple languages, different document types & integrate with external services using simple REST APIs.\n\n  https:\u002F\u002Fgithub.com\u002Fjina-ai\u002Flangchain-serve\u002Fblob\u002F8f7a9272e99490a5357655becfc5da3569655f38\u002Flcserve\u002Fapps\u002Fpdf_qna\u002Fapp.py#L8-L12\n\n\u003C\u002Fdetails>\n\n# 💪 Features\n\n### 🎉 LLM Apps on production\n  \n  - 👉 **[Define your API using `@serving` decorator](#-rest-apis-using-serving-decorator)** \n  - 👉 **[Build, deploy & distribute Slack bots using `@slackbot` decorator](#-build-deploy--distribute-slack-bots-built-with-langchain)**\n  - 👉 **[Bring your own FastAPI app](#-bring-your-own-fastapi-app)**\n\n### 🔥 Secure, Scalable, Serverless, Streaming REST\u002FWebsocket APIs on [Jina AI Cloud](https:\u002F\u002Fcloud.jina.ai\u002F).\n\n  - 🌎 Globally available REST\u002FWebsocket APIs with automatic TLS certs.\n  - 🌊 Stream LLM interactions in real-time with Websockets.\n  - 👥 Enable human in the loop for your agents.\n  - 💬 Build, deploy & distribute Slack bots built with langchain.\n  - 🔑 Protect your APIs with [API authorization](#-authorize-your-apis) using Bearer tokens. \n  - 📄 Swagger UI, and OpenAPI spec included with your APIs.\n  - ⚡️ Serverless, autoscaling apps that scales automatically with your traffic.\n  - 🗝️ Secure handling of secrets and environment variables.\n  - 📁 Persistent storage (EFS) mounted on your app for your data.\n  - ⏱️ Trigger one-time jobs to run asynchronously, allowing for non-blocking execution.\n  - 📊 Builtin logging, monitoring, and traces for your APIs.\n  - 🤖 No need to change your code to manage APIs, or manage dockerfiles, or worry about infrastructure!\n\n\n### 🏠 Self-host LLM Apps with Docker Compose or Kubernetes\n\n  - 🚀 Export your apps as Kubernetes or Docker Compose YAMLs with single command.\n  - 👉 `lc-serve export app --kind \u003Ckubernetes\u002Fdocker-compose> --path .`\n  - 📦 Deploy your app on your own internal infrastructure with your own security policies.\n  - 📞 [Talk to us if you need all the features of Jina AI Cloud on your own infrastructure.](#-reach-out-to-us)\n\n# 🧰 Usage\n\nLet's first install `langchain-serve` using pip.\n\n```bash\npip install langchain-serve\n```\n\n## 🔄 REST APIs using `@serving` decorator\n\n👉 Let's go through a [step-by-step guide](examples\u002Frest\u002FREADME.md) to build, deploy and use a REST API using `@serving` decorator.\n\n---\n\n## 🤖💬 Build, Deploy & Distribute Slack bots built with LangChain\n\nlangchain-serve exposes a `@slackbot` decorator to quickly build, deploy & distribute LLM-powered Slack bots without worrying about the infrastructure. It provides a simple interface to any langchain app on and makes them super accessible to users a platform they're already comfortable with.\n\n✨ Ready to dive in? \n\n- There's a [step-by-step guide in the repository](lcserve\u002Fapps\u002Fslackbot\u002F) to help you build your own bot for helping with reasoning.\n- Here's another [step-by-step guide](examples\u002Fhrbot\u002FREADME.md) to help you chat over own internal HR-realted documents (like onboarding, policies etc.) with your employees right inside your Slack workspace.\n\n---\n\n## 🔐 Authorize your APIs\n\nTo add an extra layer of security, we can integrate any custom API authorization by adding a `auth` argument to the `@serving` decorator. \n\n\u003Cdetails>\n\u003Csummary>Show code & gotchas\u003C\u002Fsummary>\n\n```python\nfrom lcserve import serving\n\ndef authorizer(token: str) -> Any:\n    if not token == 'mysecrettoken':            # Change this to add your own authorization logic\n        raise Exception('Unauthorized')         # Raise an exception if the request is not authorized\n\n    return 'userid'                             # Return any user id or object\n\n@serving(auth=authorizer)\ndef ask(question: str, **kwargs) -> str:\n    auth_response = kwargs['auth_response']     # This will be 'userid'\n    return ...\n\n@serving(websocket=True, auth=authorizer)\nasync def talk(question: str, **kwargs) -> str:\n    auth_response = kwargs['auth_response']     # This will be 'userid'\n    return ...\n```\n\n##### 🤔 Gotchas about the `auth` function\n\n- Should accept only one argument `token`.\n- Should raise an Exception if the request is not authorized.\n- Can return any object, which will be passed to the `auth_response` object under `kwargs` to the functions.\n- Expects Bearer token in the `Authorization` header of the request.\n- Sample HTTP request with `curl`:\n  ```bash\n  curl -X 'POST' 'http:\u002F\u002Flocalhost:8080\u002Fask' -H 'Authorization: Bearer mysecrettoken' -d '{ \"question\": \"...\", \"envs\": {} }'\n  ```\n- Sample WebSocket request with `wscat`:\n  ```bash\n  wscat -H \"Authorization: Bearer mysecrettoken\" -c ws:\u002F\u002Flocalhost:8080\u002Ftalk\n  ```\n\n\u003C\u002Fdetails>\n\n---\n\n## 🙋‍♂️ Enable streaming & human-in-the-loop (HITL) with WebSockets\n\nHITL for LangChain agents on production can be challenging since the agents are typically running on servers where humans don't have direct access. **langchain-serve** bridges this gap by enabling websocket APIs that allow for real-time interaction and feedback between the agent and a human operator.\n\nCheck out this [example](examples\u002Fwebsockets\u002Fhitl\u002FREADME.md) to see how you can enable HITL for your agents.\n\n## 📁 Persistent storage on Jina AI Cloud\n\nEvery app deployed on Jina AI Cloud gets a persistent storage (EFS) mounted locally which can be accessed via `workspace` kwarg in the `@serving` function.\n\n\u003Cdetails>\n\u003Csummary>Show code\u003C\u002Fsummary>\n\n```python\nfrom lcserve import serving\n\n@serving\ndef store(text: str, **kwargs):\n    workspace: str = kwargs.get('workspace')\n    path = f'{workspace}\u002Fstore.txt'\n    print(f'Writing to {path}')\n    with open(path, 'a') as f:\n        f.writelines(text + '\\n')\n    return 'OK'\n\n\n@serving(websocket=True)\nasync def stream(**kwargs):\n    workspace: str = kwargs.get('workspace')\n    websocket: WebSocket = kwargs.get('websocket')\n    path = f'{workspace}\u002Fstore.txt'\n    print(f'Streaming {path}')\n    async with aiofiles.open(path, 'r') as f:\n        async for line in f:\n            await websocket.send_text(line)\n    return 'OK'\n```\n\nHere, we are using the `workspace` to store the incoming text in a file via the REST endpoint and streaming the contents of the file via the WebSocket endpoint.\n\n\u003C\u002Fdetails>\n\n## 🚀 Bring your own FastAPI app\n\nIf you already have a FastAPI app with pre-defined endpoints, you can use `lc-serve` to deploy it on Jina AI Cloud. \n\n```bash\nlc-serve deploy jcloud --app filename:app \n```\n\n\u003Cdetails>\n\u003Csummary>Show details\u003C\u002Fsummary>\n\nLet's take an example of a simple FastAPI app with directory structure\n\n```bash\n.\n└── endpoints.py\n```\n\n```python\n# endpoints.py\nfrom typing import Union\n\nfrom fastapi import FastAPI\n\napp = FastAPI()\n\n\n@app.get(\"\u002Fstatus\")\ndef read_root():\n    return {\"Hello\": \"World\"}\n\n\n@app.get(\"\u002Fitems\u002F{item_id}\")\ndef read_item(item_id: int, q: Union[str, None] = None):\n    return {\"item_id\": item_id, \"q\": q}\n```\n\n```bash\nlc-serve deploy jcloud --app endpoints:app\n```\n\n\u003C\u002Fdetails>\n\n## 🗝️ Using Secrets during Deployment\n\nYou can use secrets during app deployment by passing a secrets file to deployment with the `--secrets` flag. The secrets file should be a `.env` file containing the secrets.\n\n```bash\nlcserve deploy jcloud app --secrets .env\n```\n\n\u003Cdetails>\n\u003Csummary>Show details\u003C\u002Fsummary>\n\nLet's take an example of a simple app that uses `OPENAI_API_KEY` stored as secrets.\n\nThis app directory contains the following files:\n\n```\n.\n├── main.py             # The app\n├── jcloud.yml          # JCloud deployment config file\n├── README.md           # This README file\n├── requirements.txt    # The requirements file for the app\n└── secrets.env         # The secrets file containing the redis credentials\n```\n\n> **Note**\n> `secret.env` in this directory is a dummy file. You should replace it with your own secrets after creating a Redis instance. (For example with [Upstash](https:\u002F\u002Fupstash.com\u002F)), such as:\n\n```text\nOPENAI_API_KEY=sk-xxx\n```\n\n`main.py` will look like:\n\n```python\n# main.py\nfrom lcserve import serving\nfrom langchain.prompts import PromptTemplate\nfrom langchain.chains import LLMChain\nfrom langchain.chat_models import ChatOpenAI\n\nprompt = PromptTemplate(\n    input_variables=[\"subject\"],\n    template=\"Write me a short poem about {subject}?\",\n)\n\n\n@serving(openai_tracing=True)\ndef poem(subject: str, **kwargs):\n    tracing_handler = kwargs.get(\"tracing_handler\")\n\n    chat = ChatOpenAI(temperature=0.5, callbacks=[tracing_handler])\n    chain = LLMChain(llm=chat, prompt=prompt, callbacks=[tracing_handler])\n\n    return chain.run(subject)\n```\n\nIn the above example, the app will use `OPENAI_API_KEY` provided by the secrets to interact with OpenAI.\n\nThen you can deploy using the following command and interact with the deployed endpoint.\n\n```bash\nlc-serve deploy jcloud main --secrets secrets.env\n```\n\n\u003C\u002Fdetails>\n\n## ⏱️ Trigger one-time jobs to run asynchronously\n\nHere's a [step-by-step guide](examples\u002Fjob\u002FREADME.md) to trigger one-time jobs to run asynchronously using `@job` decorator.\n\n## 💻 `lc-serve` CLI\n\n`lc-serve` is a simple CLI that helps you to deploy your agents on Jina AI Cloud (JCloud) \n\n\n| Description | Command | \n| --- | ---: |\n| Deploy your app locally | `lc-serve deploy local app` |\n| Export your app as Kubernetes YAML | `lc-serve export app --kind kubernetes --path .` |\n| Export your app as Docker Compose YAML | `lc-serve export app --kind docker-compose --path .` |\n| Deploy your app on JCloud | `lc-serve deploy jcloud app` |\n| Deploy FastAPI app on JCloud | `lc-serve deploy jcloud --app \u003Capp-name>:\u003Capp-object>` |\n| Update existing app on JCloud | `lc-serve deploy jcloud app --app-id \u003Capp-id>` |\n| Get app status on JCloud | `lc-serve status \u003Capp-id>` |\n| List all apps on JCloud | `lc-serve list` |\n| Remove app on JCloud | `lc-serve remove \u003Capp-id>` |\n| Pause app on JCloud | `lc-serve pause \u003Capp-id>` |\n| Resume app on JCloud | `lc-serve resume \u003Capp-id>` |\n\n# 💡 JCloud Deployment\n## ⚙️ Configurations\n\nFor JCloud deployment, you can configure your application infrastructure by providing a YAML configuration file using the `--config` option. The supported configurations are:\n\n  - Instance type (`instance`), as defined by [Jina AI Cloud](https:\u002F\u002Fdocs.jina.ai\u002Fconcepts\u002Fjcloud\u002Fconfiguration\u002F#cpu-tiers).\n  - Minimum number of replicas for your application (`autoscale_min`). Setting it 0 enables [serverless](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FServerless_computing).\n  - Disk size (`disk_size`), in GB. The default value is 1 GB.\n\nFor example:\n\n```\ninstance: C4\nautoscale_min: 0\ndisk_size: 1.5G\n```\n\nYou can alternatively include a `jcloud.yaml` file in your application directory with the desired configurations. However, please note that if the `--config` option is explicitly used in the command line interface, the local jcloud.yaml file will be disregarded. The command line provided configuration file will take precedence.\n\nIf you don't provide a configuration file or a specific configuration isn't specified, the following default settings will be applied: \n\n```\ninstance: C3\nautoscale_min: 1\ndisk_size: 1G\n```\n\n## 💰 Pricing\n\nApplications hosted on JCloud are priced in two categories:\n\n**Base credits**\n\n- Base credits are charged to ensure high availability for your application by maintaining at least one instance running continuously, ready to handle incoming requests. If you wish to stop the serving application, you can either remove the app completely or put it on pause, the latter allows you to resume the app serving based on persisted configurations (refer to [`lc-serve` CLI section](#-lc-serve-cli) for more information). Both options will halt the consumption of credits.\n- Actual credits charged for base credits are calculated based on the [instance type as defined by Jina AI Cloud](https:\u002F\u002Fdocs.jina.ai\u002Fconcepts\u002Fjcloud\u002Fconfiguration\u002F#cpu-tiers).\n- By default, instance type `C3` is used with a minimum of 1 instance and [Amazon EFS](https:\u002F\u002Faws.amazon.com\u002Fefs\u002F) disk of size 1G, which means that if your application is served on JCloud, you will be charged ~10 credits per hour.\n- You can change the instance type and the minimum number of instances by providing a YAML configuration file using the `--config` option. For example, if you want to use instance type `C4` with a minimum of 0 replicas, and 2G EFS disk, you can provide the following configuration file:\n  ```yaml\n  instance: C4\n  autoscale_min: 0\n  disk_size: 2G\n  ```\n\n**Serving credits**\n\n- Serving credits are charged when your application is actively serving incoming requests.\n- Actual credits charged for serving credits are calculated based on the credits for the instance type multiplied by the duration for which your application serves requests. \n- You are charged for each second your application is serving requests.\n\n\n**Total credits charged = Base credits + Serving credits**. ([Jina AI Cloud](https:\u002F\u002Fcloud.jina.ai\u002Fpricing) defines each credit as €0.005)\n\n### Examples\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Example 1\u003C\u002Fb>\u003C\u002Fsummary>\n\nConsider an HTTP application that has served requests for `10` minutes in the last hour and uses a custom config:\n```\ninstance: C4\nautoscale_min: 0\ndisk_size: 2G\n```\n\nTotal credits per hour charged would be `3.33`. The calculation is as follows:\n```\nC4 instance has an hourly credit rate of 20.\nEFS has hourly credit rate of 0.104 per GB.\nBase credits = 0 + 2 * 0.104 = 0.208 (since `autoscale_min` is 0)\nServing credits = 20 * 10\u002F60 = 3.33\nTotal credits per hour = 0.208 + 3.33 = 3.538\n```\n\n\u003C\u002Fdetails>\n\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Example 2\u003C\u002Fb>\u003C\u002Fsummary>\n\nConsider a WebSocket application that had active connections for 20 minutes in the last hour and uses the default configuration.\n```\ninstance: C3\nautoscale_min: 1\ndisk_size: 1G\n```\n\nTotal credits per hour charged would be `13.33`. The calculation is as follows:\n```\nC3 instance has an hourly credit rate of 10.\nEFS has hourly credit rate of 0.104 per GB.\nBase credits = 10 + 1 * 0.104 = 10.104 (since `autoscale_min` is 1)\nServing credits = 10 * 20\u002F60 = 3.33\nTotal credits per hour = 10.104 + 3.33 = 13.434\n```\n\n\u003C\u002Fdetails>\n\n# ❓ Frequently Asked Questions\n\n- [`lc-serve` command not found](#lc-serve-command-not-found)\n- [My client that connects to the JCloud hosted App gets timed-out, what should I do?](#my-client-that-connects-to-the-jcloud-hosted-app-gets-timed-out-what-should-I-do)\n- [How to pass environment variables to the app?](#how-to-pass-environment-variables-to-the-app)\n- [JCloud deployment failed at pushing image to Jina Hubble, what should I do?](#jcloud-deployment-failed-at-pushing-image-to-jina-hubble-what-should-i-di)\n- [Debug babyagi playground request\u002Fresponse for external integration](#debug-babyagi-playground-requestresponse-for-external-integration)\n\n### `lc-serve` command not found\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Expand\u003C\u002Fb>\u003C\u002Fsummary>\n\n`lc-serve` command is registered during `langchain-serve` installation. If you get `command not found: lc-serve` error, please replace `lc-serve` command with `python -m lcserve` & retry.\n  \n\u003C\u002Fdetails>\n\n### My client that connects to the JCloud hosted App gets timed-out, what should I do?\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Expand\u003C\u002Fb>\u003C\u002Fsummary>\n\nIf you make long HTTP\u002F WebSocket requests, the default timeout value (2 minutes) might not be suitable for your use case. You can provide a custom timeout value during JCloud deployment by using the `--timeout` argument.\n\nAdditionally, for HTTP, you may also experience timeouts due to limitations in the OSS we used in `langchain-serve`. While we are working to permanently address this issue, we recommend using HTTP\u002F1.1 in your client as a temporary workaround.\n\nFor WebSocket, please note that the connection will be closed if idle for more than 5 minutes.\n\n\u003C\u002Fdetails>\n\n### How to pass environment variables to the app?\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Expand\u003C\u002Fb>\u003C\u002Fsummary>\n\nWe provide 2 options to pass environment variables:\n\n1. Use `--env` during app deployment to load env variables from a `.env` file. For example, `lc-serve deploy jcloud app --env some.env` will load all env variables from `some.env` file and pass them to the app. These env variables will be available in the app as `os.environ['ENV_VAR_NAME']`.\n\n2. You can also pass env variables while sending requests to the app both in HTTP and WebSocket. `envs` field in the request body is used to pass env variables. For example\n  \n    ```json\n    {\n        \"question\": \"What is the meaning of life?\",\n        \"envs\": {\n            \"ENV_VAR_NAME\": \"ENV_VAR_VALUE\"\n        }\n    }\n    ```\n\n\u003C\u002Fdetails>\n\n### JCloud deployment failed at pushing image to Jina Hubble, what should I do?\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Expand\u003C\u002Fb>\u003C\u002Fsummary>\n\nPlease use `--verbose` and retry to get more information. If you are operating on computer with `arm64` arch, please retry with `--platform linux\u002Famd64` so the image can be built correctly.\n\n\u003C\u002Fdetails>\n\n### Debug babyagi playground request\u002Fresponse for external integration\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Expand\u003C\u002Fb>\u003C\u002Fsummary>\n1. Start textual console in a terminal (exclude following groups to reduce the noise in logging)\n    \n    ```bash\n    textual console -x EVENT -x SYSTEM -x DEBUG\n    ```\n\n2. Start the playground with `--verbose` flag. Start interacting and see the logs in the console.\n    \n    ```bash\n    lc-serve playground babyagi --verbose\n    ```\n\n\u003C\u002Fdetails>\n\n# 📣 Reach out to us\n\nWant to deploy your LLM apps on your own infrastructure with all capabilities of Jina AI Cloud? \n\n  - Serverless\n  - Autoscaling\n  - TLS certs\n  - Persistent storage\n  - End to end LLM observability\n  - and more on auto-pilot!\n\n[Join us on Discord](https:\u002F\u002Fdiscord.jina.ai) and we'd be happy to hear more about your use case.\n","langchain-serve 是一个用于将 LangChain 应用程序部署到生产环境的工具，基于 Jina 和 FastAPI 构建。它支持快速创建 REST\u002FWebsocket API 以及 LLM 驱动的 Slack 机器人，并允许用户在 Jina AI Cloud 或本地基础设施上部署应用，从而兼顾了云端服务的可扩展性和本地开发的便捷性。尽管该项目已不再维护，但其核心功能对于需要将自然语言处理模型应用于实际场景如聊天机器人、自动代理等开发者来说仍然具有参考价值。",2,"2026-06-11 03:30:03","top_topic"]