fleet-context


Namefleet-context JSON
Version 1.1.9 PyPI version JSON
download
home_pagehttps://github.com/fleet-ai/context/tree/main
SummaryA chat interface over up-to-date Python library documentation.
upload_time2023-11-22 23:36:20
maintainer
docs_urlNone
authorFleet AI
requires_python>=3.9
license
keywords libraries embeddings ai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">🛩ī¸ Fleet Context</h1>

<p align="center">
    <img src="https://img.shields.io/static/v1?label=license&message=MIT&color=white&style=flat" alt="License"/>
    <a href="https://discord.gg/YTc98S77aZ"><img src="https://img.shields.io/discord/1107887761412870154?logo=discord&style=flat&logoColor=white" alt="Discord"/></a>
    <br>
    <br>
    <b>A CLI tool & API over the top 1221 Python libraries.</b>
    <br>
    <span>Used for library q/a & code generation with all available OpenAI models</span>
    <br>
    <br>
    <a href="https://alpha.usefleet.ai/context">Website</a>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a href="https://atlas.nomic.ai/map/67dc2d8f-5161-46fe-9d73-5fda6f3f5cde/758aa80f-8f11-4f8f-b008-f402e61c48d4?xs=-41.15425&xf=41.09514&ys=-30.76443&yf=32.33730">Data Visualizer</a>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a href="https://pypi.org/project/fleet-context/">PyPI</a>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a href="https://x.com/fleet_ai">@fleet_ai</a>‎
    <br>
    <br>
    <br>
</p>

https://github.com/fleet-ai/context/assets/44193474/80381b25-551e-4602-8987-071e92354f6f

<br><br><br>

## Quick Start

Install the package and run `context` to ask questions about the most up-to-date Python libraries. You will have to provide your OpenAI key to start a session.

```shell
pip install fleet-context
context
```

If you'd like to run the CLI tool locally, you can clone this repository, cd into it, then run:

```shell
pip install -e .
context
```

If you have an existing package that already uses the keyword `context`, you can also activate Fleet Context by running:

```shell
fleet-context
```

<br><br><br>

## API

### Downloading embeddings

You can download any library's embeddings and load it up into a dataframe by running:

```python
from context import download_embeddings

df = download_embeddings("langchain")
```

```shell
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 901k/901k [00:00<00:00, 2.64MiB/s]
                                     id                                   dense_embeddings                                           metadata                                      sparse_values
0  91cd9f22-b3b6-49e1-8672-e1e42a1cf766  [-0.014795871, -0.013938751, 0.02374646, -0.02...  {'id': '91cd9f22-b3b6-49e1-8672-e1e42a1cf766',...  {'indices': [4279915734, 3106554626, 771291085...
1  80cd620e-7408-4649-aaa7-3fe3c719b4ed  [-0.0027519625, 0.013772411, 0.0019546314, -0....  {'id': '80cd620e-7408-4649-aaa7-3fe3c719b4ed',...  {'indices': [1497795724, 573857107, 2203090375...
2  87a406ad-e413-42fc-8813-6fa042f80f6a  [-0.022883521, -0.0036436971, 0.0026068306, 0....  {'id': '87a406ad-e413-42fc-8813-6fa042f80f6a',...  {'indices': [1558403699, 640376310, 358389376,...
3  8bdd8dae-8384-414d-87d2-4390ca29d857  [-0.024882555, -0.0041470923, -0.011419726, -0...  {'id': '8bdd8dae-8384-414d-87d2-4390ca29d857',...  {'indices': [1558403699, 3778951566, 274301652...
4  8cc5eb61-317a-4196-8099-51c47ef70406  [-0.036361936, 0.0027855083, -0.013214805, -0....  {'id': '8cc5eb61-317a-4196-8099-51c47ef70406',...  {'indices': [3586802366, 1110127215, 161253108...
```

You can see a full list of supported libraries & search through them [on our website](https://fleet.so/context) at the bottom of the page.

<br>

### Querying

If you'd like to directly query from our hosted vector database, you can run:

```python
from context import query

results = query("How do I set up Langchain?")
for result in results:
    print(f"{result['metadata']['text']}\n{result['metadata']['text']}")
```
```shell
[
    {
        'id': '859e8dff-f9ec-497d-aa07-344e48b2f67b',
        'score': 0.848275101,
        'values': [],
        'metadata': {
            'library_id': '4506492b-70de-49f1-ba2e-d65bd7048a28',
            'page_id': '732e264c-c077-4978-bc93-380d7dc28983',
            'parent': '3be9bbcc-b5d6-4a91-9f72-a570c2db33e5',
            'section_id': '',
            'section_index': 0.0,
            'text': "Quickstart ## Installation\u200b To install LangChain run: - Pip - Conda pip install langchain conda install langchain -c conda-forge For more details, see our Installation guide. ## Environment setup\u200b Using LangChain will usually require integrations with one or more model providers, data stores, APIs, etc. For this example, we'll use OpenAI's model APIs. First we'll need to install their Python package: pip install openai Accessing the API requires an API key, which you can get by creating an account and heading here.",
            'title': 'Quickstart | đŸĻœī¸đŸ”— Langchain',
            'type': '',
            'url': 'https://python.langchain.com/docs/get_started/quickstart'
        }
    },
    # ...and 9 more
]
```

<br>

You can also set a custom k value and filters by any metadata field we support (listed below), plus `library_name`:

```python
results = query("How do I set up Langchain?", k=15, filters={"library_name": "langchain"})
```

<br>

### Using Fleet Context's rich metadata

One of the biggest advantages of using Fleet Context's embeddings is the **amount of information preserved** throughout the chunking and embeddings process. You can take advantage of the metadata to improve the quality of your retrievals significantly.

Here's a full list of metadata that we support.

**IDs**:
- **`library_id`**: the uuid of the library referenced
- **`page_id`**: the uuid of the page the chunk was retrieved from
- **`parent`**: the uuid of the section the chunk was retrieved from (not to be confused with section_id)

**Page/section information**:
- **`url`**: the url of the section or page the chunk was retrieved from, formatted as `f"{page_url}#{section_id}`
- **`section_id`**: the section's `id` field from the html
- **`section_index`**: the ordering of the chunk within the section. If there are 2 chunks that have the same parent, this will tell you which one was presented first.

**Chunk information**:
- **`title`**: the title of the section or of the page (if section title does not exist)
- **`text`**: the text, formatted in markdown. Note that markdown is removed from the embeddings for better retrieval results.
- **`type`**: the type of the chunk. Can be `None` (most common) or a defined value like `class`, `function`, `attribute`, `data`, `exception`, and more.

<br>

### Improving retrievals with Fleet Context

#### Re-ranking with `section_index`

Re-ranking is commonly known to improve results pretty dramatically. We can take that a step further and take advantage of the fact that the _ordering within each section/page_ is preserved, because it follows that ordering content in the order of which it is presented to the reader will likely derive the best results.

Use `section_index` to do a smart reranking of your chunks.

<br>

#### Parent/child retrieval with `parent`

If you notice 2 or more chunks with the same `parent` field and are relatively similar in position on the page via `section_index`, you can go up one level and query all chunks with the same `parent` uuid and pass in the entire document.

<br>

#### Better filtering and prompt construction with `type`

On retrieval, you can map intent and filter via `type`. If the user intends to generate code, you can pre-filter your retrieval to filter `type` to just `class` or `function`. You can use this in creative ways. We've found that pairing it with OpenAI's function calling works really well.

Also, `type` allow you to construct your prompt with more clarity, and display more rich information to the user. For example, adding the type to the prompt followed by the chunk will produce better results, because it allows the language model to understand what the chunk is trying to say.

Note that `type` is not guaranteed to be present and defined for all libraries — only the ones that have had their documentation generated by Sphinx/readthedocs.

<br>

#### Rich prompt construction & information presentation with `text`

Our `text` field preserves all information from the HTML elements by converting it to Markdown. This allows for two big advantages:

1. From our tests, we've discovered that language models perform better with markdown formatting than without
2. You're able to display rich information (titles, urls, images) to the user if you're sourcing a chunk

<br>

#### Precise sourcing with `url` and `section_id`

You can link the user to the exact section with `url` (if supported, it's already pre-loaded with the section within the page).

<br><br><br>

## CLI Tool

### Limit libraries

You can use the `-l` or `--libraries` followed by a list of libraries to limit your session to a certain number of libraries. Defaults to all. View a list of all supported libraries on [our website](https://fleet.so/context).

```shell
context -l langchain pydantic openai
```

<br>

### Use a different OpenAI model

You can select a different OpenAI model by using `-m` or `--model`. Defaults to `gpt-4`. You can set your model to `gpt-4-1106-preview` (gpt-4-turbo), `gpt-3.5-turbo`, or `gpt-3.5-turbo-16k`.

```shell
context -m gpt-4-1106-preview
```

<br>

### Use non-OpenAI models

You can use Claude, CodeLlama, Mistral, and many other models by
1. creating an API key on [OpenRouter](https://openrouter.ai) (visit the [Keys](https://openrouter.ai/keys) page after signing up)
2. setting `OPENROUTER_API_KEY` as an environment variable
3. specifying your model using the company prefix, e.g.:

```shell
context -m phind/phind-codellama-34b
```

OpenAI models work this way as well; just use e.g. `openai/gpt-4-32k`. Other model options are available [here](https://openrouter.ai/models).

Optionally, you can attribute your inference token usage to your app or website by setting `OPENROUTER_APP_URL` and `OPENROUTER_APP_TITLE`. Your app will show on the homepage of https://openrouter.ai if ranked.

<br>

### Using local models

Local model support is powered by [LM Studio](https://lmstudio.ai). To use local models, you can use `--local` or `-n`:

```shell
context --local
```

You need to download your local model through LM Studio. To do that:

1. Download LM Studio. You can find the download link here: https://lmstudio.ai
2. Open LM Studio and download your model of choice.
3. Click the ↔ icon on the very left sidebar
4. Select your model and click "Start Server"

The context window is defaulted to 3000. You can change this by using `--context_window` or `-w`:

```shell
context --local --context_window 4096
```

<br>

### Advanced settings

You can control the number of retrieved chunks by using `-k` or `--k_value` (defaulted to 15), and you can toggle whether the model cites its source by using `-c` or `--cite_sources` (defaults to true).

```shell
context -k 25 -c false
```

<br><br><br>

## Evaluations

### Results

#### Sampled libraries

We saw a 37-point improvement for `gpt-4` generation scores and a 34-point improvement for `gpt-4-turbo` generation scores amongst a randomly sampled set of 50 libraries.

We attribute this to a lack of knowledge for the most up-to-date versions of libraries for `gpt-4`, and a combination of relevant up-to-date information to generate with and relevance of information for `gpt-4-turbo`.

<img width="50%" src="https://github.com/fleet-ai/context/assets/44193474/1ee13497-adbe-4f80-8782-3d4172a7d956">

<br><br><br>

## Embeddings

Check out our visualized data [here](https://atlas.nomic.ai/map/67dc2d8f-5161-46fe-9d73-5fda6f3f5cde/758aa80f-8f11-4f8f-b008-f402e61c48d4?xs=-41.15425&xf=41.09514&ys=-30.76443&yf=32.33730).

You can download all embeddings [here](https://drive.google.com/drive/u/0/folders/1Gz6lx8dP9QXObQgbMn2AUvalS8s7ExU4).

<img width="100%" alt="Screenshot 2023-11-06 at 10 01 22 PM" src="https://github.com/fleet-ai/context/assets/44193474/c7aeca8a-5a62-4655-a2c6-4d16846b330d">

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fleet-ai/context/tree/main",
    "name": "fleet-context",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Nic Ouporov <nic@fleet.so>, Alec Jo <alec@fleet.so>, Andrew Zhou <andrew@fleet.so>",
    "keywords": "libraries,embeddings,ai",
    "author": "Fleet AI",
    "author_email": "Fleet AI <team@fleet.so>",
    "download_url": "",
    "platform": null,
    "description": "<h1 align=\"center\">\ud83d\udee9\ufe0f Fleet Context</h1>\n\n<p align=\"center\">\n    <img src=\"https://img.shields.io/static/v1?label=license&message=MIT&color=white&style=flat\" alt=\"License\"/>\n    <a href=\"https://discord.gg/YTc98S77aZ\"><img src=\"https://img.shields.io/discord/1107887761412870154?logo=discord&style=flat&logoColor=white\" alt=\"Discord\"/></a>\n    <br>\n    <br>\n    <b>A CLI tool & API over the top 1221 Python libraries.</b>\n    <br>\n    <span>Used for library q/a & code generation with all available OpenAI models</span>\n    <br>\n    <br>\n    <a href=\"https://alpha.usefleet.ai/context\">Website</a>\n    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n    <a href=\"https://atlas.nomic.ai/map/67dc2d8f-5161-46fe-9d73-5fda6f3f5cde/758aa80f-8f11-4f8f-b008-f402e61c48d4?xs=-41.15425&xf=41.09514&ys=-30.76443&yf=32.33730\">Data Visualizer</a>\n    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n    <a href=\"https://pypi.org/project/fleet-context/\">PyPI</a>\n    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n    <a href=\"https://x.com/fleet_ai\">@fleet_ai</a>\u200e\n    <br>\n    <br>\n    <br>\n</p>\n\nhttps://github.com/fleet-ai/context/assets/44193474/80381b25-551e-4602-8987-071e92354f6f\n\n<br><br><br>\n\n## Quick Start\n\nInstall the package and run `context` to ask questions about the most up-to-date Python libraries. You will have to provide your OpenAI key to start a session.\n\n```shell\npip install fleet-context\ncontext\n```\n\nIf you'd like to run the CLI tool locally, you can clone this repository, cd into it, then run:\n\n```shell\npip install -e .\ncontext\n```\n\nIf you have an existing package that already uses the keyword `context`, you can also activate Fleet Context by running:\n\n```shell\nfleet-context\n```\n\n<br><br><br>\n\n## API\n\n### Downloading embeddings\n\nYou can download any library's embeddings and load it up into a dataframe by running:\n\n```python\nfrom context import download_embeddings\n\ndf = download_embeddings(\"langchain\")\n```\n\n```shell\n100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 901k/901k [00:00<00:00, 2.64MiB/s]\n                                     id                                   dense_embeddings                                           metadata                                      sparse_values\n0  91cd9f22-b3b6-49e1-8672-e1e42a1cf766  [-0.014795871, -0.013938751, 0.02374646, -0.02...  {'id': '91cd9f22-b3b6-49e1-8672-e1e42a1cf766',...  {'indices': [4279915734, 3106554626, 771291085...\n1  80cd620e-7408-4649-aaa7-3fe3c719b4ed  [-0.0027519625, 0.013772411, 0.0019546314, -0....  {'id': '80cd620e-7408-4649-aaa7-3fe3c719b4ed',...  {'indices': [1497795724, 573857107, 2203090375...\n2  87a406ad-e413-42fc-8813-6fa042f80f6a  [-0.022883521, -0.0036436971, 0.0026068306, 0....  {'id': '87a406ad-e413-42fc-8813-6fa042f80f6a',...  {'indices': [1558403699, 640376310, 358389376,...\n3  8bdd8dae-8384-414d-87d2-4390ca29d857  [-0.024882555, -0.0041470923, -0.011419726, -0...  {'id': '8bdd8dae-8384-414d-87d2-4390ca29d857',...  {'indices': [1558403699, 3778951566, 274301652...\n4  8cc5eb61-317a-4196-8099-51c47ef70406  [-0.036361936, 0.0027855083, -0.013214805, -0....  {'id': '8cc5eb61-317a-4196-8099-51c47ef70406',...  {'indices': [3586802366, 1110127215, 161253108...\n```\n\nYou can see a full list of supported libraries & search through them [on our website](https://fleet.so/context) at the bottom of the page.\n\n<br>\n\n### Querying\n\nIf you'd like to directly query from our hosted vector database, you can run:\n\n```python\nfrom context import query\n\nresults = query(\"How do I set up Langchain?\")\nfor result in results:\n    print(f\"{result['metadata']['text']}\\n{result['metadata']['text']}\")\n```\n```shell\n[\n    {\n        'id': '859e8dff-f9ec-497d-aa07-344e48b2f67b',\n        'score': 0.848275101,\n        'values': [],\n        'metadata': {\n            'library_id': '4506492b-70de-49f1-ba2e-d65bd7048a28',\n            'page_id': '732e264c-c077-4978-bc93-380d7dc28983',\n            'parent': '3be9bbcc-b5d6-4a91-9f72-a570c2db33e5',\n            'section_id': '',\n            'section_index': 0.0,\n            'text': \"Quickstart ## Installation\\u200b To install LangChain run: - Pip - Conda pip install langchain conda install langchain -c conda-forge For more details, see our Installation guide. ## Environment setup\\u200b Using LangChain will usually require integrations with one or more model providers, data stores, APIs, etc. For this example, we'll use OpenAI's model APIs. First we'll need to install their Python package: pip install openai Accessing the API requires an API key, which you can get by creating an account and heading here.\",\n            'title': 'Quickstart | \ud83e\udd9c\ufe0f\ud83d\udd17 Langchain',\n            'type': '',\n            'url': 'https://python.langchain.com/docs/get_started/quickstart'\n        }\n    },\n    # ...and 9 more\n]\n```\n\n<br>\n\nYou can also set a custom k value and filters by any metadata field we support (listed below), plus `library_name`:\n\n```python\nresults = query(\"How do I set up Langchain?\", k=15, filters={\"library_name\": \"langchain\"})\n```\n\n<br>\n\n### Using Fleet Context's rich metadata\n\nOne of the biggest advantages of using Fleet Context's embeddings is the **amount of information preserved** throughout the chunking and embeddings process. You can take advantage of the metadata to improve the quality of your retrievals significantly.\n\nHere's a full list of metadata that we support.\n\n**IDs**:\n- **`library_id`**: the uuid of the library referenced\n- **`page_id`**: the uuid of the page the chunk was retrieved from\n- **`parent`**: the uuid of the section the chunk was retrieved from (not to be confused with section_id)\n\n**Page/section information**:\n- **`url`**: the url of the section or page the chunk was retrieved from, formatted as `f\"{page_url}#{section_id}`\n- **`section_id`**: the section's `id` field from the html\n- **`section_index`**: the ordering of the chunk within the section. If there are 2 chunks that have the same parent, this will tell you which one was presented first.\n\n**Chunk information**:\n- **`title`**: the title of the section or of the page (if section title does not exist)\n- **`text`**: the text, formatted in markdown. Note that markdown is removed from the embeddings for better retrieval results.\n- **`type`**: the type of the chunk. Can be `None` (most common) or a defined value like `class`, `function`, `attribute`, `data`, `exception`, and more.\n\n<br>\n\n### Improving retrievals with Fleet Context\n\n#### Re-ranking with `section_index`\n\nRe-ranking is commonly known to improve results pretty dramatically. We can take that a step further and take advantage of the fact that the _ordering within each section/page_ is preserved, because it follows that ordering content in the order of which it is presented to the reader will likely derive the best results.\n\nUse `section_index` to do a smart reranking of your chunks.\n\n<br>\n\n#### Parent/child retrieval with `parent`\n\nIf you notice 2 or more chunks with the same `parent` field and are relatively similar in position on the page via `section_index`, you can go up one level and query all chunks with the same `parent` uuid and pass in the entire document.\n\n<br>\n\n#### Better filtering and prompt construction with `type`\n\nOn retrieval, you can map intent and filter via `type`. If the user intends to generate code, you can pre-filter your retrieval to filter `type` to just `class` or `function`. You can use this in creative ways. We've found that pairing it with OpenAI's function calling works really well.\n\nAlso, `type` allow you to construct your prompt with more clarity, and display more rich information to the user. For example, adding the type to the prompt followed by the chunk will produce better results, because it allows the language model to understand what the chunk is trying to say.\n\nNote that `type` is not guaranteed to be present and defined for all libraries \u2014 only the ones that have had their documentation generated by Sphinx/readthedocs.\n\n<br>\n\n#### Rich prompt construction & information presentation with `text`\n\nOur `text` field preserves all information from the HTML elements by converting it to Markdown. This allows for two big advantages:\n\n1. From our tests, we've discovered that language models perform better with markdown formatting than without\n2. You're able to display rich information (titles, urls, images) to the user if you're sourcing a chunk\n\n<br>\n\n#### Precise sourcing with `url` and `section_id`\n\nYou can link the user to the exact section with `url` (if supported, it's already pre-loaded with the section within the page).\n\n<br><br><br>\n\n## CLI Tool\n\n### Limit libraries\n\nYou can use the `-l` or `--libraries` followed by a list of libraries to limit your session to a certain number of libraries. Defaults to all. View a list of all supported libraries on [our website](https://fleet.so/context).\n\n```shell\ncontext -l langchain pydantic openai\n```\n\n<br>\n\n### Use a different OpenAI model\n\nYou can select a different OpenAI model by using `-m` or `--model`. Defaults to `gpt-4`. You can set your model to `gpt-4-1106-preview` (gpt-4-turbo), `gpt-3.5-turbo`, or `gpt-3.5-turbo-16k`.\n\n```shell\ncontext -m gpt-4-1106-preview\n```\n\n<br>\n\n### Use non-OpenAI models\n\nYou can use Claude, CodeLlama, Mistral, and many other models by\n1. creating an API key on [OpenRouter](https://openrouter.ai) (visit the [Keys](https://openrouter.ai/keys) page after signing up)\n2. setting `OPENROUTER_API_KEY` as an environment variable\n3. specifying your model using the company prefix, e.g.:\n\n```shell\ncontext -m phind/phind-codellama-34b\n```\n\nOpenAI models work this way as well; just use e.g. `openai/gpt-4-32k`. Other model options are available [here](https://openrouter.ai/models).\n\nOptionally, you can attribute your inference token usage to your app or website by setting `OPENROUTER_APP_URL` and `OPENROUTER_APP_TITLE`. Your app will show on the homepage of https://openrouter.ai if ranked.\n\n<br>\n\n### Using local models\n\nLocal model support is powered by [LM Studio](https://lmstudio.ai). To use local models, you can use `--local` or `-n`:\n\n```shell\ncontext --local\n```\n\nYou need to download your local model through LM Studio. To do that:\n\n1. Download LM Studio. You can find the download link here: https://lmstudio.ai\n2. Open LM Studio and download your model of choice.\n3. Click the \u2194 icon on the very left sidebar\n4. Select your model and click \"Start Server\"\n\nThe context window is defaulted to 3000. You can change this by using `--context_window` or `-w`:\n\n```shell\ncontext --local --context_window 4096\n```\n\n<br>\n\n### Advanced settings\n\nYou can control the number of retrieved chunks by using `-k` or `--k_value` (defaulted to 15), and you can toggle whether the model cites its source by using `-c` or `--cite_sources` (defaults to true).\n\n```shell\ncontext -k 25 -c false\n```\n\n<br><br><br>\n\n## Evaluations\n\n### Results\n\n#### Sampled libraries\n\nWe saw a 37-point improvement for `gpt-4` generation scores and a 34-point improvement for `gpt-4-turbo` generation scores amongst a randomly sampled set of 50 libraries.\n\nWe attribute this to a lack of knowledge for the most up-to-date versions of libraries for `gpt-4`, and a combination of relevant up-to-date information to generate with and relevance of information for `gpt-4-turbo`.\n\n<img width=\"50%\" src=\"https://github.com/fleet-ai/context/assets/44193474/1ee13497-adbe-4f80-8782-3d4172a7d956\">\n\n<br><br><br>\n\n## Embeddings\n\nCheck out our visualized data [here](https://atlas.nomic.ai/map/67dc2d8f-5161-46fe-9d73-5fda6f3f5cde/758aa80f-8f11-4f8f-b008-f402e61c48d4?xs=-41.15425&xf=41.09514&ys=-30.76443&yf=32.33730).\n\nYou can download all embeddings [here](https://drive.google.com/drive/u/0/folders/1Gz6lx8dP9QXObQgbMn2AUvalS8s7ExU4).\n\n<img width=\"100%\" alt=\"Screenshot 2023-11-06 at 10 01 22 PM\" src=\"https://github.com/fleet-ai/context/assets/44193474/c7aeca8a-5a62-4655-a2c6-4d16846b330d\">\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A chat interface over up-to-date Python library documentation.",
    "version": "1.1.9",
    "project_urls": {
        "Homepage": "https://fleet.so",
        "Source": "https://github.com/fleet-ai/context"
    },
    "split_keywords": [
        "libraries",
        "embeddings",
        "ai"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "097fbb02c102c23de6c25aa7f066b2b4aa8582fa00851125a6565535f5d22d9f",
                "md5": "c6410770abe80e608619e7e079200c51",
                "sha256": "94d7fb0fdaea0edaee3dd40a8208fd076679aa71d690c28304f5bbfcaba9a269"
            },
            "downloads": -1,
            "filename": "fleet_context-1.1.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c6410770abe80e608619e7e079200c51",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 25152,
            "upload_time": "2023-11-22T23:36:20",
            "upload_time_iso_8601": "2023-11-22T23:36:20.601931Z",
            "url": "https://files.pythonhosted.org/packages/09/7f/bb02c102c23de6c25aa7f066b2b4aa8582fa00851125a6565535f5d22d9f/fleet_context-1.1.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-22 23:36:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fleet-ai",
    "github_project": "context",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "fleet-context"
}
        
Elapsed time: 0.15621s