> ## Documentation Index
> Fetch the complete documentation index at: https://llm-tools.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ⚡ Quickstart

> 💡 Create an AI app on your own data in a minute

## Installation

First install the NodeJs package:

```bash theme={null}
npm i @llm-tools/embedjs
```

Once you have installed the package, depending upon your preference you can either use:

<CardGroup cols={2}>
  <Card title="Open Source Models" icon="osi" href="#open-source-models">
    This includes Open source LLMs like Mistral, Llama, etc.

    <br />

    Free to use, and runs locally on your machine.
  </Card>

  <Card title="Paid Models" icon="dollar-sign" href="#paid-models" color="#4A154B">
    This includes paid LLMs like GPT 4, Claude, etc.

    <br />

    Cost money and are accessible via an API.
  </Card>
</CardGroup>

## Open Source Models

This section provides a quickstart example of using `Llama3.2` as the Open source LLM and `nomic-embed-text` as the Open source embedding model.

These models are free and can be run locally using Ollama.

<CodeGroup>
  ```ts ollama_demo.ts theme={null}
  import { RAGApplicationBuilder } from '@llm-tools/embedjs';
  import { OllamaEmbeddings, Ollama } from '@llm-tools/embedjs-ollama';
  import { WebLoader } from '@llm-tools/embedjs-loader-web';
  import { HNSWDb } from '@llm-tools/embedjs-hnswlib';

  const ragApplication = await new RAGApplicationBuilder()
  .setModel(new Ollama({ modelName: "llama3.2", baseUrl: 'http://localhost:11434' }))
  .setEmbeddingModel(new OllamaEmbeddings({ model: 'nomic-embed-text', baseUrl: 'http://localhost:11434' }))
  .setVectorDatabase(new HNSWDb())
  .build();

  await ragApplication.addLoader({ urlOrContent: 'https://www.forbes.com/profile/elon-musk' })
  await ragApplication.addLoader({ urlOrContent: 'https://en.wikipedia.org/wiki/Elon_Musk' })

  await ragApplication.query('What is the net worth of Elon Musk today?')
  //Answer: The net worth of Elon Musk today is $258.7 billion.
  ```
</CodeGroup>

<Note>
  You can also run these models using Huggingface. Read more about using Huggingface embeddings and LLMs with EmbedJs [here](/components/embeddings/huggingface) and [here](/components/llms/huggingface).
</Note>

## Paid Models

In this section, we will use both an LLM and embedding model from OpenAI.

<CodeGroup>
  ```ts openai_demo.ts theme={null}
  import { RAGApplicationBuilder, SIMPLE_MODELS } from '@llm-tools/embedjs';
  import { OpenAiEmbeddings } from '@llm-tools/embedjs-openai';
  import { WebLoader } from '@llm-tools/embedjs-loader-web';
  import { HNSWDb } from '@llm-tools/embedjs-hnswlib';

  //Replace this with your OpenAI key
  process.env.OPENAI_API_KEY = "sk-xxxx"

  const ragApplication = await new RAGApplicationBuilder()
  .setModel(SIMPLE_MODELS.OPENAI_GPT4_O)
  .setEmbeddingModel(new OpenAiEmbeddings())
  .setVectorDatabase(new HNSWDb())
  .build();

  await ragApplication.addLoader(new WebLoader({ urlOrContent: 'https://www.forbes.com/profile/elon-musk' }));
  await ragApplication.addLoader(new WebLoader({ urlOrContent: 'https://en.wikipedia.org/wiki/Elon_Musk' }));

  await ragApplication.query('What is the net worth of Elon Musk today?')
  //Answer: The net worth of Elon Musk today is $258.7 billion.
  ```
</CodeGroup>

# Next Steps

Now that you have created your first app, you can follow any of the links:

* [Introduction](/get-started/introduction)
* [Customization](/components/introduction)
* [Use cases](/use-cases/introduction)
* [Deployment](/get-started/deployment)
