{"id":13592773,"url":"https://github.com/mme/langforge","last_synced_at":"2025-04-09T13:05:48.627Z","repository":{"id":153899904,"uuid":"631066683","full_name":"mme/langforge","owner":"mme","description":"A Toolkit for Creating and Deploying LangChain Apps","archived":false,"fork":false,"pushed_at":"2023-05-03T12:41:16.000Z","size":1049,"stargazers_count":162,"open_issues_count":1,"forks_count":22,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-14T03:10:48.321Z","etag":null,"topics":["chatgpt","deployment","gpt-3","gpt-4","jupyter","langchain","large-language-models","openai"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-04-21T20:59:19.000Z","updated_at":"2024-04-11T16:26:27.000Z","dependencies_parsed_at":"2024-01-06T20:55:18.298Z","dependency_job_id":null,"html_url":"https://github.com/mme/langforge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mme%2Flangforge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mme%2Flangforge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mme%2Flangforge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mme%2Flangforge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mme","download_url":"https://codeload.github.com/mme/langforge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045231,"owners_count":21038553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","deployment","gpt-3","gpt-4","jupyter","langchain","large-language-models","openai"],"created_at":"2024-08-01T16:01:13.062Z","updated_at":"2025-04-09T13:05:48.609Z","avatar_url":"https://github.com/mme.png","language":"Jupyter Notebook","funding_links":[],"categories":["Tools","工具","Jupyter Notebook"],"sub_categories":["Services","服务"],"readme":"![LangForge](https://github.com/mme/langforge/raw/main/docs/img/header.png \"LangForge\")\n\nLangForge is an **open-source toolkit** designed to make it easy to create and deploy **_LangChain applications_**.\n\n## Features\n\n- Simplified environment setup and API key management\n- Predefined notebooks for various use cases to help you get started quickly\n- Instantly chat with your chains using the Jupyter integration\n- Automatic REST interface generation for your app\n\n## Installation\n\nTo install LangForge, simply run the following command:\n\n```bash\npip install langforge-ai\n```\n\n## Getting Started\n\nUse the create command to generate a new LangChain app.\n\nLangForge will ask you a couple of questions, then set up a virtual environment, install required packages, and configure API keys, providing a ready-to-use foundation for your app.\n\n```bash\nlangforge create myapp\n```\n\nWhen prompted to edit your API keys, input your OpenAI API key.\n\n### Launch JupyterLab\n\nNext, run the langforge lab command to launch Jupyter Lab.\n\n```bash\ncd myapp\nlangforge lab\n```\n\nYour project comes with ready-to-use templates for various use cases and an integration that allows you to chat with your chains directly within Jupyter.\n\nIn this example, we select the \"Creative ChatGPT\" template.\n\n![Templates](https://github.com/mme/langforge/raw/main/docs/img/templates.png \"Templates\")\n\n### Develop your LangChain app\n\nNow that we have our notebook open, let's run the code.\n\nSelect `Kernel \u003e Restart Kernel and Run All Cells...`\n\nThis template will make ChatGPT behave like an old school adventure game. To play with it, click the smiling robot face on the upper right to open a chat window.\n\n![Chat](https://github.com/mme/langforge/raw/main/docs/img/chat.png \"Chat\")\n\nGreat! Note that upon running the first cell, a table displaying your API keys will appear. If your OpenAI key was not set during app creation, simply click the edit button and input your key.\n\n```python\n# make sure all packages are installed and environment variables are set\n%setup langchain openai\n```\n\n![API Key](https://github.com/mme/langforge/raw/main/docs/img/api-key.png \"API Key\")\n\nLet's change the prompt to customize our adventure. You can come up with any scenario you want. In this tutorial, we will go for a space adventure.\n\n```python\ntemplate = \"\"\"This is a conversation between a human and a system called AdventureGPT.\n\nAdventureGPT is designed to create immersive and engaging text-based adventure games.\n\nAdventureGPT is capable of understanding both simple commands, such as 'look,' and more\ncomplex sentences, allowing it to effectively interpret the player's intent.\n\nThis adventure takes place in space. The player steps into the role of Captain Bravado,\na fearless and charismatic leader of the starship 'Infinity Chaser'.\nTasked with navigating the uncharted reaches of the cosmos, Captain Bravado and their\nloyal crew must overcome various challenges, solve intricate puzzles, and make critical\ndecisions that will shape the fate of their mission and the future of interstellar\nexploration.\n\"\"\"\n```\n\nNow rerun the cell and find yourself in an immersive space adventure!\n\n### Serve your app\n\nLangForge automatically generates a REST interface for your app, making it easy to deploy and share with others. When you are happy with your app, use the `serve` command followed by the name of your notebook to start serving your app.\n\n```bash\nlangforge serve chat-creative.ipynb\n```\n\nWe can now use curl to send HTTP requests to our app:\n\n```\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"input\": \"look\", \"memory\": []}' http://localhost:2204/chat/gpt_adventure\n```\n\nNote that we include two keys in the JSON: input, which represents the user's command or message, and memory, which holds the conversation history to maintain context and continuity in the interaction.\n\n## Contributing\n\nWe welcome contributions from the community! If you'd like to contribute to LangForge, please feel free to submit pull requests or open issues on our GitHub repository.\n\n## License\n\nLangForge is released under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmme%2Flangforge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmme%2Flangforge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmme%2Flangforge/lists"}