Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow deployment of langfuse with given API token #517

Open
1 task done
matthieudelaro opened this issue Nov 17, 2023 · 7 comments · May be fixed by #1109
Open
1 task done

feat: Allow deployment of langfuse with given API token #517

matthieudelaro opened this issue Nov 17, 2023 · 7 comments · May be fixed by #1109
Labels

Comments

@matthieudelaro
Copy link

Describe the feature you'd like to request

I would like to be able to spawn a new instance of langfuse with docker-compose / k8s.
I also want to spawn langchain services (langflow, python scripts) which are going to connect to this langfuse.

Describe the solution you'd like to see

So I would like to provide langfuse with the API keys which it will accept connections from.

(Ideally, there would also be automatic creation of users. But maybe it's better to keep that in a separate PR.)

Additional information

I'm open to contributing by creating a PR, if clear instructions are given about the arch of langfuse which is relevant to the issues, and locations in the source code where I should put modifications.

Contribute

  • Yes, I can implement this and raise a PR
@matthieudelaro
Copy link
Author

Idea if the database schema seems kinda stable to @marcklingen:

how about provisionning a DB for langfuse, in which we inject credential data on start?

@marcklingen
Copy link
Member

Agree, this would be super useful!

Context

  • Currently migrations are run when the container starts, see entrypoint.sh - I would caution against adding any steps that make changes to the database here
  • Injecting credential data is possible, but secret keys are stored as a hash (with salt), if you make changes to the database, you'd need to follow this as well
  • The seeder used in development creates a default user and project. It is executed via npm run db:seed (optionally db:seed:examples). The seeder is also used in CI to test against a running Langfuse instance with default API keys.
  • I'd not go for creating multiple users as of now but rather have a simple way to create a single one for more headless deployments where the UI might be used, but not interactively in the beginning.

Fastest route

  • add additional environment to seeder, similar to environment === "examples"
    • configure the default users and keys to be created via env vars
      • user
      • pw
      • public key
      • secret key
  • docs on how this works
    • note on the env var that is necessary
    • git clone [repo] && npm i && npm run db:createdefaultuser

@marcklingen
Copy link
Member

@matthieudelaro have you made an attempt to add this? Happy to contribute or help

@alexis-alcmeon alexis-alcmeon linked a pull request Feb 7, 2024 that will close this issue
7 tasks
@alexis-alcmeon
Copy link

Hello, I've tried implement this feature in a new PR.
Don't know where I could contribute to the documentation so I haven't done it, but I'm willing to do it.

@tzsombor95
Copy link

When do you plan to submit this pull request? @marcklingen
This would be a very useful feature for me as well.

@marcklingen
Copy link
Member

Hi everyone, I'm super sorry for moving slow on this. I'm currently thinking about how to best achieve this. This PR is a solid approach but also quite hacky as we rely on the seeder. To make this more maintainable, provisioning projects via an API would be much better based on an org: #1930

@olokshyn
Copy link

Hey there! I'm coming from a project where we use Terraform to deploy to QA and PROD environments to ensure the deployments are reproducible. In addition, we have to self-host everything that contains user data.

Terraform simultaneously deploys both Langfuse and the chatbot service that tries to authenticate with Langfuse. Thus, it's not feasible to manually create a project and an API key in Langfuse, since the API key has to be known before the deployment of the chatbot service. Besides, developers are forbidden to make any infrastructure changes manually on QA or PROD.

This feature request is as close as it gets to my problem across the Langfuse documentation. Or am I missing something?

@marcklingen please advise if this automatically deployed self-hosted Langfuse use-case is supported in the current version of Langfuse, and what would be the best way to achieve that. Or should we wait for this feature request to be implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants