{"data":{"slug":"msoedov-langcorn","name":"langcorn","tagline":"Serving LangChain LLM apps and agents automagically with FastApi","github_url":"https://github.com/msoedov/langcorn","owner":"msoedov","repo":"langcorn","owner_avatar_url":"https://avatars.githubusercontent.com/u/1958116?v=4","primary_language":"Python","stars":938,"forks":69,"topics":["api","fastapi","langchain","langchain-python","large-language-models","llm","llmops","openai-api","rest-api","vercel","vercel-serverless-functions"],"archived":false,"github_pushed_at":"2024-07-15T18:05:52+00:00","maintenance_label":"Dormant","stars_delta_30d":0,"url":"https://www.graphcanon.com/tools/msoedov-langcorn","markdown_url":"https://www.graphcanon.com/tools/msoedov-langcorn.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/msoedov-langcorn","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=msoedov-langcorn","description":"⛓️ Serving LangChain LLM apps and agents automagically with FastApi. LLMops","homepage_url":"https://langcorn.vercel.app/docs","license":"MIT","open_issues":21,"watchers":7,"ai_summary":"A tool that facilitates the deployment of applications and agents utilizing Large Language Models (LLM) by integrating them seamlessly into FastAPI services, enabling rapid server setup and management.","readme_excerpt":"## 📦 Installation\n\nTo get started with LangCorn, simply install the package using pip:\n\n```shell\n\npip install langcorn\n```\n\n---\n\n## ⛓️ Quick Start\n\nExample LLM chain ex1.py\n\n```python\n\nimport os\n\nfrom langchain import LLMMathChain, OpenAI\n\nos.environ[\"OPENAI_API_KEY\"] = os.environ.get(\"OPENAI_API_KEY\", \"sk-********\")\n\nllm = OpenAI(temperature=0)\nchain = LLMMathChain(llm=llm, verbose=True)\n```\n\nRun your LangCorn FastAPI server:\n\n```shell\nlangcorn server examples.ex1:chain\n\n\n[INFO] 2023-04-18 14:34:56.32 | api:create_service:75 | Creating service\n[INFO] 2023-04-18 14:34:57.51 | api:create_service:85 | lang_app='examples.ex1:chain':LLMChain(['product'])\n[INFO] 2023-04-18 14:34:57.51 | api:create_service:104 | Serving\n[INFO] 2023-04-18 14:34:57.51 | api:create_service:106 | Endpoint: /docs\n[INFO] 2023-04-18 14:34:57.51 | api:create_service:106 | Endpoint: /examples.ex1/run\nINFO:     Started server process [27843]\nINFO:     Waiting for application startup.\nINFO:     Application startup complete.\nINFO:     Uvicorn running on http://127.0.0.1:8718 (Press CTRL+C to quit)\n```\n\nor as an alternative\n\n```shell\npython -m langcorn server examples.ex1:chain\n\n```\n\nRun multiple chains\n\n```shell\npython -m langcorn server examples.ex1:chain examples.ex2:chain\n\n\n[INFO] 2023-04-18 14:35:21.11 | api:create_service:75 | Creating service\n[INFO] 2023-04-18 14:35:21.82 | api:create_service:85 | lang_app='examples.ex1:chain':LLMChain(['product'])\n[INFO] 2023-04-18 14:35:21.82 | api:create_service:85 | lang_app='examples.ex2:chain':SimpleSequentialChain(['input'])\n[INFO] 2023-04-18 14:35:21.82 | api:create_service:104 | Serving\n[INFO] 2023-04-18 14:35:21.82 | api:create_service:106 | Endpoint: /docs\n[INFO] 2023-04-18 14:35:21.82 | api:create_service:106 | Endpoint: /examples.ex1/run\n[INFO] 2023-04-18 14:35:21.82 | api:create_service:106 | Endpoint: /examples.ex2/run\nINFO:     Started server process [27863]\nINFO:     Waiting for application startup.\nINFO:     Application startup complete.\nINFO:     Uvicorn running on http://127.0.0.1:8718 (Press CTRL+C to quit)\n```\n\nImport the necessary packages and create your FastAPI app:\n\n```python\n\nfrom fastapi import FastAPI\nfrom langcorn import create_service\n\napp:FastAPI = create_service(\"examples.ex1:chain\")\n```\n\nMultiple chains\n\n```python\n\nfrom fastapi import FastAPI\nfrom langcorn import create_service\n\napp:FastAPI = create_service(\"examples.ex2:chain\", \"examples.ex1:chain\")\n```\n\nor\n\n```python\nfrom fastapi import FastAPI\nfrom langcorn import create_service\n\napp: FastAPI = create_service(\n    \"examples.ex1:chain\",\n    \"examples.ex2:chain\",\n    \"examples.ex3:chain\",\n    \"examples.ex4:sequential_chain\",\n    \"examples.ex5:conversation\",\n    \"examples.ex6:conversation_with_summary\",\n    \"examples.ex7_agent:agent\",\n)\n\n```\n\nRun your LangCorn FastAPI server:\n\n```shell\n\nuvicorn main:app --host 0.0.0.0 --port 8000\n```\n\nNow, your LangChain models and pipelines are accessible via the LangCorn API server.\n\n---\n\n## License\n\nLangCorn is released under the MIT License.","github_created_at":"2023-04-14T15:28:45+00:00","created_at":"2026-07-07T17:43:08.709609+00:00","updated_at":"2026-08-21T00:01:04.031473+00:00","categories":[{"slug":"inference-serving","name":"Inference & Serving","url":"https://www.graphcanon.com/categories/inference-serving","markdown_url":"https://www.graphcanon.com/categories/inference-serving.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/inference-serving"}],"tags":[{"slug":"api","name":"api"},{"slug":"fastapi","name":"fastapi"},{"slug":"langchain","name":"langchain"},{"slug":"large-language-models","name":"large language models"},{"slug":"llm","name":"llm"},{"slug":"openai-api","name":"openai-api"},{"slug":"rest-api","name":"rest-api"},{"slug":"vercel","name":"vercel"}],"trust":{"provenance":{"is_fork":false,"github_id":627962120,"owner_type":"User","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-08-21T00:01:03.219Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":766,"last_release_at":"2023-11-06T16:16:06Z","stars_delta_30d":0,"open_issues_delta_30d":0},"security_summary":{"status":"findings","scanner":"osv@v1","low_count":131,"high_count":0,"last_scan_at":"2026-07-11T11:22:56.886Z","medium_count":0,"scan_profile":"deps","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-08-21T00:01:03.693Z"},"has_cli":{"value":true,"source":"pyproject.toml:[project.scripts]","observed_at":"2026-08-21T00:01:03.693Z"},"languages":{"value":["python"],"source":"github.language+pyproject.toml","observed_at":"2026-08-21T00:01:03.693Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-08-21T00:01:03.693Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["When you are deploying applications built with Large Language Models (LLMs) like OpenAI.","If you want to integrate your LLM-based chains into FastAPI services quickly without manual setup.","For scenarios where multiple LLMs or pipelines need serving simultaneously under the same API server."],"when_not_to_use":["When you require a framework other than FastAPI for your deployment needs.","If you are looking for broader support beyond LangChain-compatible projects.","In cases where minimal integration with the current infrastructure is not acceptable, as LangCorn requires specific adaptation steps."],"source":"enrich:decision_facts","observed_at":"2026-07-15T10:24:32.367Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"LangCorn is a tool that serves LangChain LLM apps and agents with FastApi."}]}}