GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - langroid/fastapi-server: Example FastAPI Server using Langroid

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
fastapi_server
fastapi_server
 
 
server
server
 
 
tests
tests
 
 
.env-template
.env-template
 
 
.gitignore
.gitignore
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
docker-compose.yml
docker-compose.yml
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

Example FastAPI server using Langroid

Setup

For env setup, follow the instructions in the langroid-examples repo, which means roughly the following. First ensure you have the latest poetry and you are using python 3.11+.

python3 -m venv .venv
. .venv/bin/activate
poetry env use 3.11
poetry install

Copy the .env-template to .env and fill in the values of the OPENAI_API_KEY, QDRANT_API_KEY and QDRANT_API_URL variables. (The latter two are needed to use the Qdrant Cloud vector-store; consult their docs to see how to get these values.)

Directory structure

Various files, dirs:

  • fastapi_server/: FastAPI server code, defines the routes/endpoints. Contains:
    • Dockerfile: to build the docker container
    • app.py: defines the endpoints
    • requirements.txt: python dependencies
  • tests/: tests for the FastAPI server
  • Makefile: to build and run the docker container
  • server/: auxiliary code modules that can be imported into app.py

Building, running the docker container

make build

Note that this will run on localhost:90 -- caution it's 90 not 80

make up

See docker container logs in tail -f mode:

make tail

Test the FastAPI server

This tests the server using both the test client provided by FastAPI (which lets you step into the code while it's running), and also the endpoint served via uvicorn from the docker container.

pytest -xs tests/test_fastapi.py

About

Example FastAPI Server using Langroid

Resources

Readme
Activity
Custom properties

Stars

6 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.