configuration.mdx 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. ---
  2. title: '⚙️ Custom configurations'
  3. ---
  4. Embedchain is made to work out of the box. However, for advanced users we're also offering configuration options. All of these configuration options are optional and have sane defaults.
  5. You can configure different components of your app (`llm`, `embedding model`, or `vector database`) through a simple yaml configuration that Embedchain offers. Here is a generic full-stack example of the yaml config:
  6. ```yaml
  7. app:
  8. config:
  9. id: 'full-stack-app'
  10. llm:
  11. provider: openai
  12. config:
  13. model: 'gpt-3.5-turbo'
  14. temperature: 0.5
  15. max_tokens: 1000
  16. top_p: 1
  17. stream: false
  18. template: |
  19. Use the following pieces of context to answer the query at the end.
  20. If you don't know the answer, just say that you don't know, don't try to make up an answer.
  21. $context
  22. Query: $query
  23. Helpful Answer:
  24. system_prompt: |
  25. Act as William Shakespeare. Answer the following questions in the style of William Shakespeare.
  26. vectordb:
  27. provider: chroma
  28. config:
  29. collection_name: 'full-stack-app'
  30. dir: db
  31. allow_reset: true
  32. embedder:
  33. provider: openai
  34. config:
  35. model: 'text-embedding-ada-002'
  36. ```
  37. Alright, let's dive into what each key means in the yaml config above:
  38. 1. `app` Section:
  39. - `config`:
  40. - `id` (String): The ID or name of your full-stack application.
  41. 2. `llm` Section:
  42. - `provider` (String): The provider for the language model, which is set to 'openai'. You can find the full list of llm providers in [our docs](/components/llms).
  43. - `model` (String): The specific model being used, 'gpt-3.5-turbo'.
  44. - `config`:
  45. - `temperature` (Float): Controls the randomness of the model's output. A higher value (closer to 1) makes the output more random.
  46. - `max_tokens` (Integer): Controls how many tokens are used in the response.
  47. - `top_p` (Float): Controls the diversity of word selection. A higher value (closer to 1) makes word selection more diverse.
  48. - `stream` (Boolean): Controls if the response is streamed back to the user (set to false).
  49. - `template` (String): A custom template for the prompt that the model uses to generate responses.
  50. - `system_prompt` (String): A system prompt for the model to follow when generating responses, in this case, it's set to the style of William Shakespeare.
  51. 3. `vectordb` Section:
  52. - `provider` (String): The provider for the vector database, set to 'chroma'. You can find the full list of vector database providers in [our docs](/components/vector-databases).
  53. - `config`:
  54. - `collection_name` (String): The initial collection name for the database, set to 'full-stack-app'.
  55. - `dir` (String): The directory for the database, set to 'db'.
  56. - `allow_reset` (Boolean): Indicates whether resetting the database is allowed, set to true.
  57. 4. `embedder` Section:
  58. - `provider` (String): The provider for the embedder, set to 'openai'. You can find the full list of embedding model providers in [our docs](/components/embedding-models).
  59. - `config`:
  60. - `model` (String): The specific model used for text embedding, 'text-embedding-ada-002'.
  61. If you have questions about the configuration above, please feel free to reach out to us using one of the following methods:
  62. <Snippet file="get-help.mdx" />