Skip to content

Commit

Permalink
Merge branch 'main' into add-jp-video
Browse files Browse the repository at this point in the history
  • Loading branch information
marcklingen authored Dec 16, 2024
2 parents 677d7b4 + 711f88c commit 699ea9e
Show file tree
Hide file tree
Showing 17 changed files with 780 additions and 275 deletions.
50 changes: 41 additions & 9 deletions cookbook/integration_gradio_chatbot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,40 @@
"\n",
"We recommend to run this notebook in Google Colab (see link above).\n",
"\n",
"## What is Gradio?\n",
"Thank you to [@tkmamidi](https://github.com/tkmamidi) for the original implementation and contributions to this notebook.\n",
"\n",
"## Introduction\n",
"\n",
"### What is Gradio?\n",
"\n",
"[Gradio](https://github.com/gradio-app/gradio) is an open-source Python library that enables quick creation of web interfaces for machine learning models, APIs, and Python functions. It allows developers to wrap any Python function with an interactive UI that can be easily shared or embedded, making it ideal for demos, prototypes, and ML model deployment. See [docs](https://www.gradio.app/docs) for more details.\n",
"\n",
"## What is Langfuse?\n",
"### What is Langfuse?\n",
"\n",
"[Langfuse](https://github.com/langfuse/langfuse) is an open-source LLM engineering platform that helps build reliable LLM applications via LLM Application Observability, Evaluation, Experiments, and Prompt Management. See [docs](https://langfuse.com/docs) for more details.\n",
"\n",
"## Outline\n",
"### Walkthrough\n",
"\n",
"We've recorded a walkthrough of the implementation below. You can follow along with the video or the notebook.\n",
"\n",
"<iframe\n",
" width=\"100%\"\n",
" className=\"aspect-[16/9] rounded mt-3\"\n",
" src=\"https://www.youtube.com/embed/O--lEvvfWf8?si=5eh_KPJ8FVypSFjV\"\n",
" title=\"YouTube video player\"\n",
" frameborder=\"0\"\n",
" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n",
" referrerpolicy=\"strict-origin-when-cross-origin\"\n",
" allowFullScreen\n",
"></iframe>\n",
"\n",
"### Outline\n",
"\n",
"This notebook will show you how to\n",
"\n",
"1. Build a simple chat interface in Python and rendering it in a Notebook using [Gradio `Chatbot`](https://www.gradio.app/docs/gradio/chatbot)\n",
"2. Add [Langfuse Tracing](https://langfuse.com/docs/tracing) to the chatbot\n",
"3. Implement additional Langfuse tracing features used frequently in chat applications: [chat sessions](https://langfuse.com/docs/tracing-features/sessions), [user feedback](https://langfuse.com/docs/scores/user-feedback)\n",
"\n",
"---"
"3. Implement additional Langfuse tracing features used frequently in chat applications: [chat sessions](https://langfuse.com/docs/tracing-features/sessions), [user feedback](https://langfuse.com/docs/scores/user-feedback)"
]
},
{
Expand All @@ -61,6 +78,7 @@
},
"outputs": [],
"source": [
"# pinning httpx as the latest version is not compatible with the OpenAI SDK at the time of creating this notebook\n",
"!pip install gradio langfuse openai httpx==0.27.2"
]
},
Expand Down Expand Up @@ -244,7 +262,7 @@
" if data.liked:\n",
" langfuse.score(value=1, name=\"user-feedback\", trace_id=current_trace_id)\n",
" else:\n",
" langfuse.score(value=0, name=\"user-feedback\", trace_id=current_trace_id)\n"
" langfuse.score(value=0, name=\"user-feedback\", trace_id=current_trace_id)"
]
},
{
Expand Down Expand Up @@ -279,7 +297,7 @@
"id": "-GM54eHzmD7x"
},
"source": [
"# Run Gradio Chatbot\n",
"## Run Gradio Chatbot\n",
"\n",
"After implementing all methods above, we can now put together the [Gradio Chatbot](https://www.gradio.app/docs/gradio/chatbot) and launch it. If run within Colab, you should see an embedded Chatbot interface."
]
Expand Down Expand Up @@ -320,12 +338,22 @@
"id": "bKOBm48PED57"
},
"source": [
"## Done\n",
"## Explore data in Langfuse\n",
"\n",
"When interacting with the Chatbot, you should see traces, sessions, and feedback scores in your Langfuse project. See video above for a walkthrough.\n",
"\n",
"Example trace, session, and user feedback in Langfuse ([public link](https://cloud.langfuse.com/project/cloramnkj0002jz088vzn1ja4/sessions/5c0b8d01-cbcb-4650-be50-c6e4ca0ce093)):\n",
"\n",
"![Gradio Traces, sessions and user feedback in Langfuse](https://static.langfuse.com/cookbooks/gradio/gradio-traces-in-langfuse.gif)\n",
"\n",
"\n",
"If you have any questions or feedback, please join the [Langfuse Discord](https://langfuse.com/discord) or create a new thread on [GitHub Discussions](https://langfuse.com/gh-support)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
Expand All @@ -335,6 +363,10 @@
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python",
"version": "3.9.18"
}
},
"nbformat": 4,
Expand Down
3 changes: 1 addition & 2 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@
"geist": "^1.3.1",
"gpt3-tokenizer": "^1.1.5",
"langfuse": "^3.31.1",
"lucide-react": "^0.465.0",
"next": "^15.0.4",
"lucide-react": "^0.468.0",
"next": "^15.1.0",
"next-sitemap": "^4.2.3",
"nextra": "3.0.15",
"nextra-theme-docs": "3.0.15",
"openai-edge": "^1.2.2",
"postcss": "^8.4.49",
"posthog-js": "^1.194.6",
"posthog-js": "^1.195.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.53.2",
"react-hook-form": "^7.54.0",
"react-markdown": "^9.0.1",
"react-syntax-highlighter": "^15.6.1",
"react-tweet": "^3.2.1",
Expand All @@ -67,7 +67,7 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@next/bundle-analyzer": "^14.2.15",
"@next/bundle-analyzer": "^15.0.3",
"@types/node": "20.11.1",
"cross-env": "^7.0.3",
"typescript": "^5.6.3",
Expand Down
21 changes: 14 additions & 7 deletions pages/careers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ description: "Join the Langfuse team to build the leading open-source LLM engine

Langfuse is building the leading **open-source LLM engineering platform** (**[Why Langfuse?](/why)**).

While LLMs improve a lot, we don’t see enough applications in production. Building these applications requires a new workflow of continuous monitoring and evaluation that we enable with Langfuse [[1]](#footnotes).
**We are hiring across the board for technical and technical go-to-market roles. We work in-person in Berlin, Germany & are building an excellent, small team.** If you are considering new opportunities -- even if you might not be looking immediately, we would love to hear from you & get coffee.

While LLMs improve a lot, we don’t see enough applications in production. Building these applications requires a new workflow of continuous monitoring and evaluation that we enable with Langfuse [[1]](#footnotes).
We are seeing strong traction over recent months (see metrics below), thus it is the right time to grow the team to build out our backend systems, product, and how we communicate with developers.

We have raised a [$4M seed round](/blog/announcing-our-seed-round) from Lightspeed, La Famiglia, Y Combinator and angels.
We have raised a [$4M seed round](/blog/announcing-our-seed-round) from Lightspeed, General Catalyst, Y Combinator and angels.

## Team

Expand All @@ -26,7 +27,7 @@ We have raised a [$4M seed round](/blog/announcing-our-seed-round) from Lightspe

**A few tidbits that might help you understand what kind of company we are:**

- We plan on only hiring engineers for the foreseeable future
- We are only hiring technical profiles
- You can expect to have ~1 meeting a day on average
- Reed Hastings’ ‘No Rules Rules’ inspires our culture, [here’s a summary](https://www.mattswain.com/booknotes/no-rules-rules)
- We were heavily influenced by our time at Y Combinator and follow its ethos. We’re a Silicon Valley Startup in Berlin - [more here](https://www.ycombinator.com/library/4D-yc-s-essential-startup-advice)
Expand All @@ -42,14 +43,20 @@ PS: We are based in Berlin (Germany) and work [in person](https://www.linkedin.c
free to reach out: [email protected]
</Callout>

- [Design Engineer](https://www.ycombinator.com/companies/langfuse/jobs/mDquP95-design-engineer)
- _Berlin, €60K - €120K EUR, 0.1% - 0.35%_
- You are a design-minded frontend engineer who is passionate about building beautiful, functional, and user-friendly interfaces. You own UI/UX in the Langfuse application to help our users achieve their goals.
- [Backend Engineer](https://www.ycombinator.com/companies/langfuse/jobs/1bO16H6-backend-engineer)
- _Berlin, €70K - €130K EUR, 0.1% - 0.4%_
- You will work on our backend systems, powering the core infrastructure of Langfuse. You work on a data-intensive application that is used by hundreds of companies and thousands of developers ingesting hundreds of millions of events.
- [Product Engineer](https://www.ycombinator.com/companies/langfuse/jobs/aAvmoFB-product-engineer)
- _Berlin, €70K - €130K EUR, 0.25% - 0.75%_
- _Berlin, €70K - €130K EUR, 0.1% - 0.4%_
- Design, scope, ship, and launch new full-stack (UI, backend, SDKs, integrations) features on top of our existing data platform. See launch week post [[2]](#footnotes) for a good selection of things you could have worked on.
- [Developer Advocate / Devrel](https://www.ycombinator.com/companies/langfuse/jobs/uHysbKH-developer-advocate-devrel)
- _Berlin, €60K - €120K EUR, 0.25% - 0.50%_
- [Developer Advocate](https://www.ycombinator.com/companies/langfuse/jobs/uHysbKH-developer-advocate-devrel)
- _Berlin, €60K - €120K EUR, 0.1% - 0.3%_
- Run our bottom-up go-to-market via developer-focused content, documentation, partnerships, events, community-building, and whatever else works. Langfuse is a platform of many building blocks and there are lots of common workflows we can educate on to drive awareness and adoption [[3]](#footnotes).

Please apply via Work At a Startup or send us an email with your CV/LinkedIn to [email protected]
Please apply via [Work At a Startup](https://www.ycombinator.com/companies/langfuse/jobs) or send us an email with your CV/LinkedIn to [email protected]

You need to be located in Berlin, Germany or willing to relocate. Your superday interview will be held onsite in Berlin. The first few interviews will be conducted via Zoom.

Expand Down
1 change: 1 addition & 0 deletions pages/docs/_meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default {
title: "Tracing",
},
tracing: "Introduction",
"tracing-data-model": "Data Model",
"get-started": "Quickstart",
"tracing-features": "Tracing Features",
sdk: "SDKs",
Expand Down
11 changes: 5 additions & 6 deletions pages/docs/analytics/posthog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ availability.selfHosted: not-available
hobby: "public-beta",
pro: "public-beta",
team: "public-beta",
selfHosted: "not-available",
selfHosted: "ee",
}}
/>

Expand Down Expand Up @@ -65,7 +65,7 @@ Once integrated, you can build a dashboard in PostHog to visualize your Langfuse

## Integration details [#details]

On a daily schedule Langfuse batches aggregated events and metrics to your PostHog instance.
On an hourly schedule Langfuse batches aggregated events and metrics to your PostHog instance.

### Metadata matching

Expand Down Expand Up @@ -104,7 +104,7 @@ Is there any additional information that would be helpful? You can request more
- `langfuse_release`: Information relating to the event release.
- `langfuse_version`: The version of the event.
- `langfuse_tags`: Any tags associated with the event.
- `langfuse_integration_version`: The integration version of LangFuse.
- `langfuse_event_version`: The integration version of LangFuse.

#### Event: `langfuse generation`

Expand All @@ -117,7 +117,6 @@ Is there any additional information that would be helpful? You can request more
- `langfuse_input_units`: Number of tokens utilized in prompting the generation.
- `langfuse_output_units`: Number of tokens produced by the generation.
- `langfuse_total_units`: Total number of tokens consumed in the generation process.
- `langfuse_unit`: The units used for the generation (likely tokens).
- `langfuse_session_id`: The session ID associated with the trace of the generation.
- `langfuse_project_id`: The project identification where the generation happened.
- `langfuse_user_id`: The user ID that started the trace linked to the generation. In case it's unavailable, it defaults to `langfuse_unknown_user`.
Expand All @@ -128,7 +127,7 @@ Is there any additional information that would be helpful? You can request more
- `langfuse_model`: The model used during this generation's process.
- `langfuse_level`: The level associated with the generation.
- `langfuse_tags`: Any tags attached to the trace of the generation.
- `langfuse_integration_version`: The integration version with LangFuse.
- `langfuse_event_version`: The integration version with LangFuse.

#### Event `langfuse score`

Expand All @@ -143,7 +142,7 @@ Is there any additional information that would be helpful? You can request more
- `langfuse_user_id`: The user ID that triggered the trace tied with the score. If not available, defaults to `langfuse_unknown_user`.
- `langfuse_release`: The release information of the trace associated with the score.
- `langfuse_tags`: Any tags related to the trace of the score.
- `langfuse_integration_version`: The integration version with LangFuse.
- `langfuse_event_version`: The integration version with LangFuse.

## Troubleshooting

Expand Down
Loading

0 comments on commit 699ea9e

Please sign in to comment.