Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Piyush Jain <piyushjain@duck.com>
Co-authored-by: david qiu <david@qiu.dev>
  • Loading branch information
3 people authored Jul 10, 2024
1 parent 0dbcc87 commit ee47992
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 44 deletions.
22 changes: 2 additions & 20 deletions docs/source/users/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,27 +357,9 @@ GPT4All support is still an early-stage feature, so some bugs may be encountered
during usage. Our team is still actively improving support for locally-hosted
models.

### Ollama usage (early-stage)
### Ollama usage

Jupyter AI provides basic support for Ollama models.

To get started, follow the instructions on the [Ollama website](https://ollama.com/) to set up `ollama` and download the models locally. Currently Jupyter AI only supports the following models:

- `gemma`
- `gemma2`
- `llama2`,
- `llama3`,
- `llama3:70b`,
- `phi3`,
- `mistral`,
- `tinyllama`,
- `qwen2`,
- `qwen2:7b`,
- `qwen2:72b`,

:::{note}
There are plans to make the list of Ollama models configurable in the future, so users can download more models available via Ollama.
:::
To get started, follow the instructions on the [Ollama website](https://ollama.com/) to set up `ollama` and download the models locally. To select a model, enter the model name in the settings panel, for example `deepseek-coder-v2`.

### Asking about something in your notebook

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,12 @@ def __init__(self, *args, **kwargs):
class OllamaEmbeddingsProvider(BaseEmbeddingsProvider, OllamaEmbeddings):
id = "ollama"
name = "Ollama"
# source: https://ollama.com/library
models = [
"gemma",
"gemma2",
"llama2",
"llama3",
"llama3:70b",
"phi3",
"mistral",
"tinyllama",
"qwen2",
"qwen2:7b",
"qwen2:72b",
"nomic-embed-text",
"mxbai-embed-large",
"all-minilm",
"snowflake-arctic-embed",
]
model_id_key = "model"

Expand Down
19 changes: 6 additions & 13 deletions packages/jupyter-ai-magics/jupyter_ai_magics/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,19 +728,12 @@ class OllamaProvider(BaseProvider, Ollama):
id = "ollama"
name = "Ollama"
model_id_key = "model"
models = [
"gemma",
"gemma2",
"llama2",
"llama3",
"llama3:70b",
"phi3",
"mistral",
"tinyllama",
"qwen2",
"qwen2:7b",
"qwen2:72b",
]
help = (
"See [https://www.ollama.com/library](https://www.ollama.com/library) for a list of models. "
"Pass a model's name; for example, `deepseek-coder-v2`."
)
models = ["*"]
registry = True


class JsonContentHandler(LLMContentHandler):
Expand Down

0 comments on commit ee47992

Please sign in to comment.