---
depth: 2
local: true
backlinks: none
---
-
Edit the
RetrievalAugmentedGeneration/examples/simple_rag_api_catalog/chains.pyfile and add the followingimportstatements::language: python :start-after: start-llm-imports :end-before: end-llm-imports -
Update the
llm_chainmethod with the following statements::language: python :start-after: start-llm-chain-method :end-before: end-llm-chain-method
Using the containers has one additional step this time: exporting your NVIDIA API key as an environment variable.
-
Build the container for the Chain Server:
$ docker compose --env-file deploy/compose/compose.env -f deploy/compose/simple-rag-api-catalog.yaml build chain-server -
Export your NVIDIA API key in an environment variable:
$ export NVIDIA_API_KEY=nvapi-... -
Run the containers:
$ docker compose --env-file deploy/compose/compose.env -f deploy/compose/simple-rag-api-catalog.yaml up -d
You can access the Chain Server with a URL like http://localhost:8081.
-
Confirm the
llm_chainmethod runs by submitting a query:$ curl -H "Content-Type: application/json" http://localhost:8081/generate \ -d '{"messages":[{"role":"user", "content":"What should I see in Paris?"}], "use_knowledge_base": false}'
Example Output