Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xyproto/usermodel
Get per-task Ollama models
https://github.com/xyproto/usermodel
go llm ollama system
Last synced: about 1 month ago
JSON representation
Get per-task Ollama models
- Host: GitHub
- URL: https://github.com/xyproto/usermodel
- Owner: xyproto
- License: bsd-3-clause
- Created: 2024-10-01T17:10:15.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-04T17:50:54.000Z (2 months ago)
- Last Synced: 2024-11-04T18:39:47.946Z (2 months ago)
- Topics: go, llm, ollama, system
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# usermodel
Given a task string (like `code-completion`), return the user-configured Ollama model for this task.
The user-configured Ollama model is found by examining `~/.config/llm-manager/llm.conf` and `/etc/llm.conf` and if that does not work out, by executing [`llm-manager`](https://github.com/xyproto/llm-manager).
If no user-configured model is available, return a default model.
### Example use
```go
package mainimport (
"fmt""github.com/xyproto/usermodel"
)func main() {
fmt.Println(usermodel.GetVisionModel())
}
```### Exported types
```go
type Task string
```### Exported constants
```go
ChatTask = "chat"
CodeTask = "code"
CodeCompletionTask = "code-completion"
TestTask = "test"
TextGenerationTask = "text-generation"
ToolUseTask = "tool-use"
TranslationTask = "translation"
VisionTask = "vision"
```### Exported functions
```go
func AvailableTasks() []Task
func GetChatModel() string
func GetCodeModel() string
func GetCodeCompletionModel() string
func GetTestModel() string
func GetTextGenerationModel() string
func GetToolUseModel() string
func GetTranslationModel() string
func GetVisionModel() string
func Get(task Task) string
```### General info
* Version: 1.2.2
* License: BSD-3
* Author: Alexander F. Rødseth <[email protected]>