You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Local models with Ollama provide a powerful way to integrate AI capabilities into your AIScript applications while maintaining full control over your data and costs.
Copy file name to clipboardExpand all lines: docs/guide/ai/prompt.mdx
+47-1Lines changed: 47 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ let response = prompt f"Explain {topic} at a {detail_level} level";
51
51
52
52
## API Keys and Configuration
53
53
54
-
To use the `prompt` feature, you need to configure your API keys. AIScript supports multiple LLM providers.
54
+
To use the `prompt` feature, you need to configure your API keys. AIScript supports multiple LLM providers including cloud-based services and local models.
model = "llama3.2"# or any other model installed in your Ollama instance
81
89
```
82
90
</Tab>
83
91
</Tabs>
84
92
93
+
## Local Models with Ollama
94
+
95
+
AIScript supports running local models through [Ollama](https://ollama.ai/), which allows you to run AI models on your own hardware without sending data to external services.
96
+
97
+
### Setting Up Ollama
98
+
99
+
1.**Install Ollama** from [ollama.ai](https://ollama.ai/)
100
+
2.**Pull models** you want to use:
101
+
```bash
102
+
ollama pull llama3.2
103
+
ollama pull deepseek-r1
104
+
ollama pull codellama
105
+
```
106
+
3.**Start Ollama** (it runs on port 11434 by default)
107
+
4.**Configure AIScript** to use Ollama
108
+
109
+
### Example with Local Models
110
+
111
+
```rust
112
+
// Using a local Llama model
113
+
letresponse=prompt {
114
+
input:"What is rust?",
115
+
model:"llama3.2"
116
+
};
117
+
118
+
// Using a local coding model
119
+
letcode_explanation=prompt {
120
+
input:"Review this Python function for potential issues",
0 commit comments