Skip to content

Commit a8d47a5

Browse files
committed
Update litellm integration
- Bump litellm from 1.42.5 to 1.83.4 - Keep api_key in additional_kwargs for litellm completion calls - Remove outdated Docker + Ollama section from README - Minor wording improvements in README - Fix unicode dash in REPL help text
1 parent 4ea2f83 commit a8d47a5

4 files changed

Lines changed: 3 additions & 33 deletions

File tree

README.md

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pip install shell-gpt
1010
By default, ShellGPT uses OpenAI's API and GPT-4 model. You'll need an API key, you can generate one [here](https://platform.openai.com/api-keys). You will be prompted for your key which will then be stored in `~/.config/shell_gpt/.sgptrc`. OpenAI API is not free of charge, please refer to the [OpenAI pricing](https://openai.com/pricing) for more information.
1111

1212
> [!TIP]
13-
> Alternatively, you can use locally hosted open source models which are available for free. To use local models, you will need to run your own LLM backend server such as [Ollama](https://github.com/ollama/ollama). To set up ShellGPT with Ollama, please follow this comprehensive [guide](https://github.com/TheR1D/shell_gpt/wiki/Ollama).
13+
> Alternatively, you can run open-source models locally for free. This requires setting up your own LLM backend, such as [Ollama](https://github.com/ollama/ollama). To get ShellGPT working with Ollama, follow this detailed [guide](https://github.com/TheR1D/shell_gpt/wiki/Ollama)
1414
>
1515
> **❗️Note that ShellGPT is not optimized for local models and may not work as expected.**
1616
@@ -456,35 +456,6 @@ You also can use the provided `Dockerfile` to build your own image:
456456
docker build -t sgpt .
457457
```
458458

459-
### Docker + Ollama
460-
461-
If you want to send your requests to an Ollama instance and run ShellGPT inside a Docker container, you need to adjust the Dockerfile and build the container yourself: the litellm package is needed and env variables need to be set correctly.
462-
463-
Example Dockerfile:
464-
```
465-
FROM python:3-slim
466-
467-
ENV DEFAULT_MODEL=ollama/mistral:7b-instruct-v0.2-q4_K_M
468-
ENV API_BASE_URL=http://10.10.10.10:11434
469-
ENV USE_LITELLM=true
470-
ENV OPENAI_API_KEY=bad_key
471-
ENV SHELL_INTERACTION=false
472-
ENV PRETTIFY_MARKDOWN=false
473-
ENV OS_NAME="Arch Linux"
474-
ENV SHELL_NAME=auto
475-
476-
WORKDIR /app
477-
COPY . /app
478-
479-
RUN apt-get update && apt-get install -y gcc
480-
RUN pip install --no-cache /app[litellm] && mkdir -p /tmp/shell_gpt
481-
482-
VOLUME /tmp/shell_gpt
483-
484-
ENTRYPOINT ["sgpt"]
485-
```
486-
487-
488459
## Additional documentation
489460
* [Azure integration](https://github.com/TheR1D/shell_gpt/wiki/Azure)
490461
* [Ollama integration](https://github.com/TheR1D/shell_gpt/wiki/Ollama)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies = [
3434

3535
[project.optional-dependencies]
3636
litellm = [
37-
"litellm == 1.42.5"
37+
"litellm == 1.83.4"
3838
]
3939
test = [
4040
"pytest >= 7.2.2, < 8.0.0",

sgpt/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def main(
102102
),
103103
repl: str = typer.Option(
104104
None,
105-
help="Start a REPL (Readevalprint loop) session.",
105+
help="Start a REPL (Read-eval-print loop) session.",
106106
rich_help_panel="Chat Options",
107107
),
108108
show_chat: str = typer.Option(

sgpt/handlers/handler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
completion = litellm.completion
2525
litellm.suppress_debug_info = True
26-
additional_kwargs.pop("api_key")
2726
else:
2827
from openai import OpenAI
2928

0 commit comments

Comments
 (0)