Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyng committed Dec 20, 2023
1 parent 5f9fec4 commit f28f0e8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Ollama Python Library

The Ollama Python library provides the easiest way to integrate your Python project with [Ollama](https://github.com/jmorganca/ollama).

## Getting Started

```shell
pip install ollama
```

```python
from ollama import chat
response = chat(model='llama2', messages=[{'role': 'user', 'content': 'Why is the sky blue?'}])
```

### Using the Synchronous Client

```python
from ollama import Client
Client(base_url='http://localhost:11434').chat(model='llama2', messages=[{'role': 'user', 'content': 'Why is the sky blue?'}])
```

### Using the Asynchronous Client

```
from ollama import AsyncClient
await Client(base_url='http://localhost:11434').chat(model='llama2', messages=[{'role': 'user', 'content': 'Why is the sky blue?'}])
```

0 comments on commit f28f0e8

Please sign in to comment.