If you want to give Langtail a try but you’re not 100% sure that you want to use the full Langtail workflow, using the using the OpenAI Proxy via the SDK is a great way to get started. Follow these steps to get up and running:Documentation Index
Fetch the complete documentation index at: https://langtail.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Generate a project API key
- In Langtail, open an existing project or create a new one.
- In the left sidebar, click Secrets.
- Click New API Key, optionally set a name and a budget limit, then click Create.
- Copy the key.
Install the SDK
Install the Langtail SDK in your project (using NPM or your package manager of choice):
Modify your code to use the SDK
- Add your Langtail project API key to an environment variable. In the following snippets, we use
LANGTAIL_API_KEY. - In your codebase, paste this snippet:
Observe metrics and logs
- Back in Langtail, navigate to the project and then click Logs in the left sidebar.
- You should see log entries coming from your app (they have an environment value of “proxy”).
- Click on a log to see detailed information about the request and response from OpenAI.
- If you want to experiment with this prompt, click Open in Playground. Here you can change parameters and modify different parts of the prompt and then see the result.