{"id":17132960,"url":"https://github.com/cutwell/langchain-in-y-seconds","last_synced_at":"2026-04-25T16:34:47.911Z","repository":{"id":207271429,"uuid":"718841291","full_name":"Cutwell/langchain-in-Y-seconds","owner":"Cutwell","description":"Learn the entire LangChain tech-stack fast 🏃‍♀️","archived":false,"fork":false,"pushed_at":"2023-11-15T20:02:44.000Z","size":5889,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T05:44:16.293Z","etag":null,"topics":["generative-ai","langchain","langserve","langsmith","llm","tutorial"],"latest_commit_sha":null,"homepage":"https://youtu.be/q76MWApFIt4","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cutwell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-14T22:39:43.000Z","updated_at":"2024-11-10T02:20:39.000Z","dependencies_parsed_at":"2023-11-15T00:25:28.326Z","dependency_job_id":"e7025932-08f5-4f5e-9271-550566dde37f","html_url":"https://github.com/Cutwell/langchain-in-Y-seconds","commit_stats":null,"previous_names":["cutwell/langchain-in-y-seconds"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cutwell/langchain-in-Y-seconds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cutwell%2Flangchain-in-Y-seconds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cutwell%2Flangchain-in-Y-seconds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cutwell%2Flangchain-in-Y-seconds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cutwell%2Flangchain-in-Y-seconds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cutwell","download_url":"https://codeload.github.com/Cutwell/langchain-in-Y-seconds/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cutwell%2Flangchain-in-Y-seconds/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32269462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["generative-ai","langchain","langserve","langsmith","llm","tutorial"],"created_at":"2024-10-14T19:28:59.650Z","updated_at":"2026-04-25T16:34:47.889Z","avatar_url":"https://github.com/Cutwell.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://raw.githubusercontent.com/Cutwell/langchain-in-Y-seconds/main/langchain-in-y-seconds.png\" style=\"width:100px;padding-right:20px;margin-bottom:-8px;\"\u003eLearn LangChain in Y seconds\n Learn the entire LangChain tech-stack fast 🏃‍♀️\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Prerequisites\n\n1. Install Python (3.11.6 used in video).\n2. Install Poetry.\n3. Install DirEnv (or use another secret manager).\n4. Get your [OpenAI API key](https://platform.openai.com/api-keys).\n5. Sign up for LangSmith and get your LangSmith API key (https://smith.langchain.com/ and access API keys via the 🔑 icon on the bottom left).\n\n## Tutorial walkthrough\n\n0. If using a secret file (e.g.: `.envrc`), create a `.gitignore` file similar to the one in this repository, to prevent accidentally sharing your API keys.\n\n1. Create a `.envrc` file and populate it with this template:\n\n```bash\nexport LANGCHAIN_TRACING_V2=true\nexport LANGCHAIN_ENDPOINT=https://api.smith.langchain.com\nexport LANGCHAIN_API_KEY=\u003cyour-langsmith-api-key\u003e\nexport LANGCHAIN_PROJECT=langchain-quickstart  # if not specified, defaults to \"default\"\n\nexport OPENAI_API_KEY=\u003cyour-openai-api-key\u003e\n```\n\n2. Open a new terminal and run these commands:\n\n```bash\npoetry init -n --python=3.11.6 \u0026\u0026 poetry add langchain-cli\nsource ./.venv/bin/activate\npoetry run langchain app new api --package pirate-speak\n```\n\n_Type 'Y' when prompted to install pirate-speak as a mirrored module_\n\n3. Replace the `NotImplemented` route in `api/app/server.py` with a route for your component chain:\n\n```python\nfrom pirate_speak.chain import chain as pirate_speak_chain\n\nadd_routes(app, pirate_speak_chain, path=\"/pirate-speak\")\n```\n\n4. Update the project `name` in `api/pyproject.toml`:\n```toml\nname = \"api\"\n```\n\n_This can be any name other than `__app_name__`_\n\n5. Open a new terminal in `/api` and run these commands:\n\n```bash\npoetry install\nsource ./.venv/bin/activate\npoetry run langchain serve\n```\n\n6. Visit http://127.0.0.1:8000/pirate-speak/playground/ in your web browser and play with your chain.\n\n7. Open LangSmith (https://smith.langchain.com/) and visit the project page. View one of your traces (created when you tested the playground demo) and use it to create a dataset.\n\n8. View the dataset and click `New Test Run` to get a code snippet:\n\n```python\nclient = langsmith.Client()\nchain_results = client.run_on_dataset(\n\tdataset_name=\"quickstart-dataset\",\t# this will change if you use a different dataset name.\n\tllm_or_chain_factory=chain,\n\tproject_name=\"test-formal-project-4\",\n\tconcurrency_level=5,\n\tverbose=True,\n)\n```\n\n9. Create a new PyTest file `test_chain.py` in `api/packages/pirate-speak/tests/`:\n\n```python\nfrom pirate_assistant.chain import chain\nimport langsmith\nfrom datetime import datetime # import datetime module to get a timestamp\n\ndef test_chain():\n\tclient = langsmith.Client()\n\n\tchain_results = client.run_on_dataset(\n\t\tdataset_name=\"quickstart-dataset\",\n\t\tllm_or_chain_factory=chain,\n\t\tproject_name=f\"quickstart-dataset-test-{int(datetime.now().strftime('%Y%m%d%H%M%S'))}\", # use a timestamped unique project name each re-run\n\t\tconcurrency_level=5,\n\t\tverbose=True,\n\t)\n```\n\n_To enable PyTest re-runs, we want to use a timestamped unique project name to store each successive test result._\n\n10. Open a terminal in `/api` and run these commands:\n\n```bash\npoetry add pytest --group=dev\npoetry run python -m pytest -s .\n```\n\n11. View your dataset test runs, and add the trace to a new annotation queue.\n\n12. View your annotation queue and explore the review interface.\n\n🎉🎉 **Congratulations!** 🎉🎉\nYou've completed this tutorial and now have a complete LangChain project. If you need more help with navigating the LangSmith interface, go view the video version of this tutorial [on Youtube](https://youtu.be/q76MWApFIt4).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcutwell%2Flangchain-in-y-seconds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcutwell%2Flangchain-in-y-seconds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcutwell%2Flangchain-in-y-seconds/lists"}