{"id":19675439,"url":"https://github.com/langroid/fastapi-server","last_synced_at":"2025-05-05T22:47:09.230Z","repository":{"id":230282874,"uuid":"778985954","full_name":"langroid/fastapi-server","owner":"langroid","description":"Example FastAPI Server using Langroid","archived":false,"fork":false,"pushed_at":"2024-05-07T23:07:03.000Z","size":315,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-04T21:49:48.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/langroid.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":"2024-03-28T20:03:52.000Z","updated_at":"2025-04-24T23:04:20.000Z","dependencies_parsed_at":"2024-03-28T21:27:15.759Z","dependency_job_id":"c114f6e8-1673-4e43-a704-e1d3f076d9ab","html_url":"https://github.com/langroid/fastapi-server","commit_stats":null,"previous_names":["langroid/fastapi-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langroid%2Ffastapi-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langroid%2Ffastapi-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langroid%2Ffastapi-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langroid%2Ffastapi-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/langroid","download_url":"https://codeload.github.com/langroid/fastapi-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252590509,"owners_count":21772934,"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":[],"created_at":"2024-11-11T17:24:03.689Z","updated_at":"2025-05-05T22:47:09.210Z","avatar_url":"https://github.com/langroid.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example FastAPI server using Langroid\n\n### Setup\nFor env setup, follow the instructions\nin the [langroid-examples](https://github.com/langroid/langroid-examples) repo, which \nmeans roughly the following. First ensure you have the latest `poetry` and \nyou are using python 3.11+.\n\n```bash\npython3 -m venv .venv\n. .venv/bin/activate\npoetry env use 3.11\npoetry install\n```\n\nCopy the `.env-template` to `.env` and fill in the values of the \n`OPENAI_API_KEY`, `QDRANT_API_KEY` and `QDRANT_API_URL` variables.\n(The latter two are needed to use the [Qdrant Cloud](https://qdrant.tech/) vector-store;\nconsult their docs to see how to get these values.)\n\n\n### Directory structure\nVarious files, dirs:\n\n- `fastapi_server/`: FastAPI server code, defines the routes/endpoints. Contains:\n    - `Dockerfile`: to build the docker container\n    - `app.py`: defines the endpoints\n    - `requirements.txt`: python dependencies\n- `tests/`: tests for the FastAPI server\n- `Makefile`: to build and run the docker container\n- `server/`: auxiliary code modules that can be imported into `app.py`\n\n### Building, running the docker container\n\n```bash\nmake build\n```\n\nNote that this will run on `localhost:90` -- caution it's 90 not 80 \n```bash\nmake up\n```\n\nSee docker container logs in `tail -f` mode:\n\n```bash\nmake tail\n```\n\n### Test the FastAPI server\n\nThis tests the server using both the test client provided by FastAPI\n(which lets you step into the code while it's running),\nand also the endpoint served via uvicorn from the docker container.\n\n```bash\npytest -xs tests/test_fastapi.py\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangroid%2Ffastapi-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flangroid%2Ffastapi-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangroid%2Ffastapi-server/lists"}