@elizaos/plugin-local-ai 1.0.0-alpha.7 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,7 +19,7 @@ The plugin requires these environment variables (can be set in .env file or char
19
19
  "USE_LOCAL_AI": true,
20
20
  "USE_STUDIOLM_TEXT_MODELS": false,
21
21
  "USE_OLLAMA_TEXT_MODELS": false,
22
-
22
+
23
23
  "OLLAMA_SERVER_URL": "http://localhost:11434",
24
24
  "OLLAMA_MODEL": "deepseek-r1-distill-qwen-7b",
25
25
  "USE_OLLAMA_EMBEDDING": false,
@@ -27,7 +27,7 @@ The plugin requires these environment variables (can be set in .env file or char
27
27
  "SMALL_OLLAMA_MODEL": "deepseek-r1:1.5b",
28
28
  "MEDIUM_OLLAMA_MODEL": "deepseek-r1:7b",
29
29
  "LARGE_OLLAMA_MODEL": "deepseek-r1:7b",
30
-
30
+
31
31
  "STUDIOLM_SERVER_URL": "http://localhost:1234",
32
32
  "STUDIOLM_SMALL_MODEL": "lmstudio-community/deepseek-r1-distill-qwen-1.5b",
33
33
  "STUDIOLM_MEDIUM_MODEL": "deepseek-r1-distill-qwen-7b",
@@ -36,6 +36,7 @@ The plugin requires these environment variables (can be set in .env file or char
36
36
  ```
37
37
 
38
38
  Or in `.env` file:
39
+
39
40
  ```env
40
41
  # Local AI Configuration
41
42
  USE_LOCAL_AI=true
@@ -61,11 +62,13 @@ STUDIOLM_EMBEDDING_MODEL=false
61
62
  ### Configuration Options
62
63
 
63
64
  #### Text Model Source (Choose One)
65
+
64
66
  - `USE_STUDIOLM_TEXT_MODELS`: Enable StudioLM text models
65
67
  - `USE_OLLAMA_TEXT_MODELS`: Enable Ollama text models
66
- Note: Only one text model source can be enabled at a time
68
+ Note: Only one text model source can be enabled at a time
67
69
 
68
70
  #### Ollama Settings
71
+
69
72
  - `OLLAMA_SERVER_URL`: Ollama API endpoint (default: http://localhost:11434)
70
73
  - `OLLAMA_MODEL`: Default model for general use
71
74
  - `USE_OLLAMA_EMBEDDING`: Enable Ollama for embeddings
@@ -75,6 +78,7 @@ Note: Only one text model source can be enabled at a time
75
78
  - `LARGE_OLLAMA_MODEL`: Model for complex tasks
76
79
 
77
80
  #### StudioLM Settings
81
+
78
82
  - `STUDIOLM_SERVER_URL`: StudioLM API endpoint (default: http://localhost:1234)
79
83
  - `STUDIOLM_SMALL_MODEL`: Model for lighter tasks
80
84
  - `STUDIOLM_MEDIUM_MODEL`: Model for standard tasks
@@ -83,6 +87,7 @@ Note: Only one text model source can be enabled at a time
83
87
  ## Features
84
88
 
85
89
  The plugin provides these model classes:
90
+
86
91
  - `TEXT_SMALL`: Fast, efficient text generation using smaller models
87
92
  - `TEXT_LARGE`: More capable text generation using larger models
88
93
  - `IMAGE_DESCRIPTION`: Local image analysis using Florence-2 vision model
@@ -90,53 +95,46 @@ The plugin provides these model classes:
90
95
  - `TRANSCRIPTION`: Local audio transcription using Whisper
91
96
 
92
97
  ### Image Analysis
98
+
93
99
  ```typescript
94
100
  const { title, description } = await runtime.useModel(
95
- ModelClass.IMAGE_DESCRIPTION,
96
- "https://example.com/image.jpg"
101
+ ModelType.IMAGE_DESCRIPTION,
102
+ 'https://example.com/image.jpg'
97
103
  );
98
104
  ```
99
105
 
100
106
  ### Text-to-Speech
107
+
101
108
  ```typescript
102
- const audioStream = await runtime.useModel(
103
- ModelClass.TEXT_TO_SPEECH,
104
- "Text to convert to speech"
105
- );
109
+ const audioStream = await runtime.useModel(ModelType.TEXT_TO_SPEECH, 'Text to convert to speech');
106
110
  ```
107
111
 
108
112
  ### Audio Transcription
113
+
109
114
  ```typescript
110
- const transcription = await runtime.useModel(
111
- ModelClass.TRANSCRIPTION,
112
- audioBuffer
113
- );
115
+ const transcription = await runtime.useModel(ModelType.TRANSCRIPTION, audioBuffer);
114
116
  ```
115
117
 
116
118
  ### Text Generation
119
+
117
120
  ```typescript
118
121
  // Using small model
119
- const smallResponse = await runtime.useModel(
120
- ModelClass.TEXT_SMALL,
121
- {
122
- context: "Generate a short response",
123
- stopSequences: []
124
- }
125
- );
122
+ const smallResponse = await runtime.useModel(ModelType.TEXT_SMALL, {
123
+ context: 'Generate a short response',
124
+ stopSequences: [],
125
+ });
126
126
 
127
127
  // Using large model
128
- const largeResponse = await runtime.useModel(
129
- ModelClass.TEXT_LARGE,
130
- {
131
- context: "Generate a detailed response",
132
- stopSequences: []
133
- }
134
- );
128
+ const largeResponse = await runtime.useModel(ModelType.TEXT_LARGE, {
129
+ context: 'Generate a detailed response',
130
+ stopSequences: [],
131
+ });
135
132
  ```
136
133
 
137
134
  ## Model Sources
138
135
 
139
136
  ### 1. StudioLM (LM Studio)
137
+
140
138
  - Local inference server for running various open models
141
139
  - Supports chat completion API similar to OpenAI
142
140
  - Configure with `USE_STUDIOLM_TEXT_MODELS=true`
@@ -144,10 +142,11 @@ const largeResponse = await runtime.useModel(
144
142
  - Optional embedding model support
145
143
 
146
144
  ### 2. Ollama
145
+
147
146
  - Local model server with optimized inference
148
147
  - Supports various open models in GGUF format
149
148
  - Configure with `USE_OLLAMA_TEXT_MODELS=true`
150
149
  - Supports small, medium, and large models
151
150
  - Optional embedding model support
152
151
 
153
- Note: The plugin validates that only one text model source is enabled at a time to prevent conflicts.
152
+ Note: The plugin validates that only one text model source is enabled at a time to prevent conflicts.