overview.mdx 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. ---
  2. title: "Pipeline"
  3. ---
  4. Create a RAG pipeline object on Embedchain. This is the main entrypoint for a developer to interact with Embedchain APIs. A pipeline configures the llm, vector database, embedding model, and retrieval strategy of your choice.
  5. ### Attributes
  6. <ParamField path="local_id" type="str">
  7. Pipeline ID
  8. </ParamField>
  9. <ParamField path="name" type="str" optional>
  10. Name of the pipeline
  11. </ParamField>
  12. <ParamField path="config" type="BaseConfig">
  13. Configuration of the pipeline
  14. </ParamField>
  15. <ParamField path="llm" type="BaseLlm">
  16. Configured LLM for the RAG pipeline
  17. </ParamField>
  18. <ParamField path="db" type="BaseVectorDB">
  19. Configured vector database for the RAG pipeline
  20. </ParamField>
  21. <ParamField path="embedding_model" type="BaseEmbedder">
  22. Configured embedding model for the RAG pipeline
  23. </ParamField>
  24. <ParamField path="chunker" type="ChunkerConfig">
  25. Chunker configuration
  26. </ParamField>
  27. <ParamField path="client" type="Client" optional>
  28. Client object (used to deploy a pipeline to Embedchain platform)
  29. </ParamField>
  30. <ParamField path="logger" type="logging.Logger">
  31. Logger object
  32. </ParamField>
  33. ## Usage
  34. You can create an embedchain pipeline instance using the following methods:
  35. ### Default setting
  36. ```python Code Example
  37. from embedchain import App
  38. app = App()
  39. ```
  40. ### Python Dict
  41. ```python Code Example
  42. from embedchain import App
  43. config_dict = {
  44. 'llm': {
  45. 'provider': 'gpt4all',
  46. 'config': {
  47. 'model': 'orca-mini-3b-gguf2-q4_0.gguf',
  48. 'temperature': 0.5,
  49. 'max_tokens': 1000,
  50. 'top_p': 1,
  51. 'stream': False
  52. }
  53. },
  54. 'embedder': {
  55. 'provider': 'gpt4all'
  56. }
  57. }
  58. # load llm configuration from config dict
  59. app = App.from_config(config=config_dict)
  60. ```
  61. ### YAML Config
  62. <CodeGroup>
  63. ```python main.py
  64. from embedchain import App
  65. # load llm configuration from config.yaml file
  66. app = App.from_config(config_path="config.yaml")
  67. ```
  68. ```yaml config.yaml
  69. llm:
  70. provider: gpt4all
  71. config:
  72. model: 'orca-mini-3b-gguf2-q4_0.gguf'
  73. temperature: 0.5
  74. max_tokens: 1000
  75. top_p: 1
  76. stream: false
  77. embedder:
  78. provider: gpt4all
  79. ```
  80. </CodeGroup>
  81. ### JSON Config
  82. <CodeGroup>
  83. ```python main.py
  84. from embedchain import App
  85. # load llm configuration from config.json file
  86. app = App.from_config(config_path="config.json")
  87. ```
  88. ```json config.json
  89. {
  90. "llm": {
  91. "provider": "gpt4all",
  92. "config": {
  93. "model": "orca-mini-3b-gguf2-q4_0.gguf",
  94. "temperature": 0.5,
  95. "max_tokens": 1000,
  96. "top_p": 1,
  97. "stream": false
  98. }
  99. },
  100. "embedder": {
  101. "provider": "gpt4all"
  102. }
  103. }
  104. ```
  105. </CodeGroup>