Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 9.65 KB

secrets.md

File metadata and controls

61 lines (43 loc) · 9.65 KB

Secrets

Learn more about the LangStream project here.

Secrets

A place to hold secrets. Each label:value in this file is used as a reference in configuration and pipeline manifests. Their values carry on to a step’s environment where it is applied. Secret values can be modified directly in secrets.yaml, or you can pass secrets as environment variables.

Manifest

An example secrets.yaml manifest contains the credentials necessary to connect to Astra and OpenAI.

The :- characters designate a default value. For example, provider: "${OPEN_AI_PROVIDER:-openai}" designates openai as the default.

For finding these credentials, see Credentials.

secrets:
  - id: astra
    data:
      clientId: ${ASTRA_CLIENT_ID:-}
      secret: ${ASTRA_SECRET:-}
      token: ${ASTRA_TOKEN:-}
      database: ${ASTRA_DATABASE:-}
      # uncomment this and link to a file containing the secure connect bundle
      # secureBundle: "<file:secure-connect-bundle.zip>"
      secureBundle: ${ASTRA_SECURE_BUNDLE:-}
      environment: ${ASTRA_ENVIRONMENT:-PROD}
  - id: open-ai
    data:
      access-key: "${OPEN_AI_ACCESS_KEY:-}"
      url: "${OPEN_AI_URL:-}"
      provider: "${OPEN_AI_PROVIDER:-openai}"
      embeddings-model: "${OPEN_AI_EMBEDDINGS_MODEL:-text-embedding-ada-002}"
      chat-completions-model: "${OPEN_AI_CHAT_COMPLETIONS_MODEL:-gpt-3.5-turbo}"
      text-completions-model: "${OPEN_AI_TEXT_COMPLETIONS_MODEL:-gpt-3.5-turbo-instruct}"
 

Pass secrets as environment variables

Secret values can be modified directly in secrets.yaml, or you can pass your secrets as environment variables. The secrets.yaml resolves these environment variables.

export ASTRA_CLIENT_ID=...
export ASTRA_SECRET=...
export ASTRA_DATABASE=...
export ASTRA_TOKEN=...

When you go to production, you should create a dedicated secrets.yaml file for each environment.

Credentials

Where do you find credentials for these items? Here's a little help:

SecretLocationNotes and Example Value
kafka
usernamessl.propertiesKAFKA_USERNAME=langstream-tenant
passwordssl.propertiesKAFKA_PASSWORD=token:eyXxx...
tenantssl.propertiesKAFKA_USERNAME=langstream-tenant
bootstrap.serversssl.propertiesKAFKA_BOOTSTRAP_SERVERS=kafka-gcp-useast1.streaming.datastax.com:9093
open-ai
access-keyOpenAI Access Keyaccess-key: xxx
urlOpenAI Azure URLOPEN_AI_URL=https://company-openai-dev.openai.azure.com/
providerOpenAI AzureOPEN_AI_PROVIDER=openai
embeddings-modelOpenAI AzureOPEN_AI_EMBEDDINGS_MODEL=text-embedding-ada-002 export
chat-completions-modelOpenAI AzureOPEN_AI_CHAT_COMPLETIONS_MODEL=gpt-35-turbo
text-completions-modelOpenAI AzureOPEN_AI_TEXT_COMPLETIONS_MODEL=gpt-3.5-turbo-instruct
vertex-ai
urlGoogle Service AccountVERTEX_AI_URL=https://us-central1-aiplatform.googleapis.com
tokenVertex API tokenVERTEX_AI_TOKEN=xxx
serviceAccountJSONA JSON file downloaded from the Google console containing auth info.VERTEX_AI_JSON=xxx
regionGoogle Service AccountVERTEX_AI_REGION=us-central1
projectGoogle Service AccountVERTEX_AI_PROJECT=myproject
chat-completions-modelGoogle Service AccountVERTEX_AI_CHAT_COMPLETIONS_MODEL=chat-bison
text-completions-modelGoogle Service AccountVERTEX_AI_TEXT_COMPLETIONS_MODEL=text-bison
hugging-face
access-keyhugging-faceaccess-key:
providerCan be api or localHUGGING_FACE_PROVIDER=api
embeddings-modelhugging-faceHUGGING_FACE_EMBEDDINGS_MODEL=multilingual-e5-small
embeddings-model-urlhugging-faceHUGGING_FACE_EMBEDDINGS_MODEL_URL=djl://ai.djl.huggingface.pytorch/intfloat/multilingual-e5-small
astra
clientIDAstraASTRA_CLIENT_ID=fnsNZtMgvgBHurHJjfSbgQwifnsNZtMgvgBHurHJjfSbgQwi

ClientID is generated with token
secretAstraASTRA_SECRET=xxxx
Secret is generated with token
tokenAstraASTRA_TOKEN=AstraCSxxxx
databaseAstra

ASTRA_DATABASE=my-database

The name of your Astra database

secureBundleBase64-encoded secure connect bundle downloaded from AstraASTRA_SECURE_BUNDLE="file:secure-connect-bundle.zip"
environmentAstraASTRA_ENVIRONMENT=PROD
s3
bucket-nameMinio consoleS3_BUCKET_NAME=langstream-code-storage
endpointMinio consoleS3_ENDPOINT=http://minio.minio-dev.svc.cluster.local:9000
access-keyMinio consoleS3_ACCESS_KEY=minioadmin
secretMinio consoleS3_SECRET=minioadmin
regionMinio consoleS3_REGION=us-central1
google
client-idGoogle Service Accountclient-id: xxxx
github
client-idGithubclient-id: xxxx
pinecone
servicePinecone consolePINECONE_SERVICE=pinecone
access-keyPinecone consolePINECONE_ACCESS_KEY=xxxx
project-namePinecone consolePINECONE_PROJECT_NAME=b4ea705
environmentPinecone consolePINECONE_ENVIRONMENT=asia-southeast1-gcp-free
index-namePinecone consolePINECONE_INDEX_NAME=my-pinecone-index

Please note that the example values provided are taken from the current content and may not accurately reflect the actual values that should be used for each secret.

RootNodeTypeDescription

secrets
The base node in the yaml, Holds the collection of secrets.
name
The secret name used for display
id
The id of the secret used for referencing its value
data<any key:value>

Object of applicable values, given the secret. Provide any combination of key:value that is applicable to the given secret.

To retrieve the values use the format - secrets.<name>.<key>

(don't include "data" when referencing secrets)