Skip to content

Commit dd8afb4

Browse files
filintodmsfussellmarcduiker
authored
Adds information about using openai component to work with Ollama local models (#4756)
* add ollama openai compatibility component layer information Signed-off-by: Filinto Duran <[email protected]> * Update daprdocs/content/en/reference/components-reference/supported-conversation/ollama.md Co-authored-by: Mark Fussell <[email protected]> Signed-off-by: Filinto Duran <[email protected]> * Update daprdocs/content/en/reference/components-reference/supported-conversation/ollama.md Co-authored-by: Mark Fussell <[email protected]> Signed-off-by: Filinto Duran <[email protected]> --------- Signed-off-by: Filinto Duran <[email protected]> Co-authored-by: Mark Fussell <[email protected]> Co-authored-by: Marc Duiker <[email protected]>
1 parent bcb939c commit dd8afb4

File tree

1 file changed

+20
-0
lines changed
  • daprdocs/content/en/reference/components-reference/supported-conversation

1 file changed

+20
-0
lines changed

daprdocs/content/en/reference/components-reference/supported-conversation/ollama.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,26 @@ The above example uses secrets as plain strings. It is recommended to use a secr
3434
| `model` | N | The Ollama LLM to use. Defaults to `llama3.2:latest`. | `phi4:latest` |
3535
| `cacheTTL` | N | A time-to-live value for a prompt cache to expire. Uses Golang duration format. | `10m` |
3636

37+
### OpenAI Compatibility
38+
39+
Ollama is compatible with [OpenAI's API](https://ollama.com/blog/openai-compatibility). You can use the OpenAI component with Ollama models with the following changes:
40+
41+
```yaml
42+
apiVersion: dapr.io/v1alpha1
43+
kind: Component
44+
metadata:
45+
name: ollama-openai
46+
spec:
47+
type: conversation.openai # use the openai component type
48+
metadata:
49+
- name: key
50+
value: 'ollama' # just any non-empty string
51+
- name: model
52+
value: gpt-oss:20b # an ollama model (https://ollama.com/search) in this case openai open source model. See https://ollama.com/library/gpt-oss
53+
- name: endpoint
54+
value: 'http://localhost:11434/v1' # ollama endpoint
55+
```
56+
3757
## Related links
3858

3959
- [Conversation API overview]({{< ref conversation-overview.md >}})

0 commit comments

Comments
 (0)