LangStream / langstream

LangStream. Event-Driven Developer Platform for Building and Running LLM AI Apps. Powered by Kubernetes and Kafka.
https://langstream.ai
Apache License 2.0
387 stars 28 forks source link

langstream apps deploy should provide more beginner friendly help if it can't connect to annot connect to http://localhost:8090/api/applications/ #709

Open Gagravarr opened 10 months ago

Gagravarr commented 10 months ago

If you look at the README.md files for all the examples in https://github.com/LangStream/langstream/tree/main/examples/ , you will see a 50/50 mixture of langstream apps deploy test and langstream docker run for running the examples.

As a beginner, if you're aiming to just use the docker local runner to get started: If you first try a langstream docker run example (which will work), and then without spotting try a langstream apps deploy example next, you'll get a rather unhelpful error on the 2nd one

langstream apps deploy test -app examples/applications/compute-hugging-face-embeddings -i examples/instances/kafka-kubernetes.yaml -s examples/secrets/secrets.yaml
packaging app: /data/langstream/langstream/ghrepos/LangStream/langstream/main/examples/applications/compute-hugging-face-embeddings
app packaged
deploying application: test (2 KB)
Cannot connect to http://localhost:8090/api/applications/default/test?dry-run=false

In general, it might make sense for langstream apps deploy to print some additional help if it can't connect to the langstream server

For the specific case of langstream apps deploy trying to contact the default http://localhost:8090/api/applications/ URL, to be beginner friendly, I think it should offer quite a bit of help. Perhaps something like

The langstream server on http://localhost:8090/api/applications/ could not be contacted

Please make sure that the langstream server is running, the hostname (localhost) and port (8090) are correct, and any required kubectl port forwarding is in place (possible link to some docs?)

And then if the app is also named test (as per all the examples), maybe also add

You can run apps locally without needing a full langstream cluster with langstream docker run

To do that, replace change your command from langstream apps deploy Into langstream docker run

eolivelli commented 10 months ago

@Gagravarr I agree with you

Do you want to contribute some improvements ? The code of the cli is in this repository