Compare commits
1 Commits
main
...
ollama.com
Author | SHA1 | Date | |
---|---|---|---|
|
425219f1ca |
@ -20,8 +20,8 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ollama/ollama/format"
|
"ollama.com/format"
|
||||||
"github.com/ollama/ollama/version"
|
"ollama.com/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Client encapsulates client state for interacting with the ollama
|
// Client encapsulates client state for interacting with the ollama
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/ollama/ollama/app/store"
|
"ollama.com/app/store"
|
||||||
"github.com/ollama/ollama/app/tray"
|
"ollama.com/app/tray"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Run() {
|
func Run() {
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getCLIFullPath(command string) string {
|
func getCLIFullPath(command string) string {
|
||||||
|
@ -18,8 +18,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ollama/ollama/auth"
|
"ollama.com/auth"
|
||||||
"github.com/ollama/ollama/version"
|
"ollama.com/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -4,7 +4,7 @@ package main
|
|||||||
// go build -ldflags="-H windowsgui" .
|
// go build -ldflags="-H windowsgui" .
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ollama/ollama/app/lifecycle"
|
"ollama.com/app/lifecycle"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/ollama/ollama/app/assets"
|
"ollama.com/app/assets"
|
||||||
"github.com/ollama/ollama/app/tray/commontray"
|
"ollama.com/app/tray/commontray"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewTray() (commontray.OllamaTray, error) {
|
func NewTray() (commontray.OllamaTray, error) {
|
||||||
|
@ -5,7 +5,7 @@ package tray
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/ollama/ollama/app/tray/commontray"
|
"ollama.com/app/tray/commontray"
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitPlatformTray(icon, updateIcon []byte) (commontray.OllamaTray, error) {
|
func InitPlatformTray(icon, updateIcon []byte) (commontray.OllamaTray, error) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package tray
|
package tray
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ollama/ollama/app/tray/commontray"
|
"ollama.com/app/tray/commontray"
|
||||||
"github.com/ollama/ollama/app/tray/wintray"
|
"ollama.com/app/tray/wintray"
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitPlatformTray(icon, updateIcon []byte) (commontray.OllamaTray, error) {
|
func InitPlatformTray(icon, updateIcon []byte) (commontray.OllamaTray, error) {
|
||||||
|
@ -13,8 +13,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/ollama/ollama/app/tray/commontray"
|
|
||||||
"golang.org/x/sys/windows"
|
"golang.org/x/sys/windows"
|
||||||
|
"ollama.com/app/tray/commontray"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Helpful sources: https://github.com/golang/exp/blob/master/shiny/driver/internal/win32
|
// Helpful sources: https://github.com/golang/exp/blob/master/shiny/driver/internal/win32
|
||||||
|
12
cmd/cmd.go
12
cmd/cmd.go
@ -30,12 +30,12 @@ import (
|
|||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
"golang.org/x/term"
|
"golang.org/x/term"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
"github.com/ollama/ollama/format"
|
"ollama.com/format"
|
||||||
"github.com/ollama/ollama/parser"
|
"ollama.com/parser"
|
||||||
"github.com/ollama/ollama/progress"
|
"ollama.com/progress"
|
||||||
"github.com/ollama/ollama/server"
|
"ollama.com/server"
|
||||||
"github.com/ollama/ollama/version"
|
"ollama.com/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CreateHandler(cmd *cobra.Command, args []string) error {
|
func CreateHandler(cmd *cobra.Command, args []string) error {
|
||||||
|
@ -14,9 +14,9 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
"github.com/ollama/ollama/progress"
|
"ollama.com/progress"
|
||||||
"github.com/ollama/ollama/readline"
|
"ollama.com/readline"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MultilineState int
|
type MultilineState int
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestExtractFilenames(t *testing.T) {
|
func TestExtractFilenames(t *testing.T) {
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func startApp(ctx context.Context, client *api.Client) error {
|
func startApp(ctx context.Context, client *api.Client) error {
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func startApp(ctx context.Context, client *api.Client) error {
|
func startApp(ctx context.Context, client *api.Client) error {
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func startApp(ctx context.Context, client *api.Client) error {
|
func startApp(ctx context.Context, client *api.Client) error {
|
||||||
|
@ -13,8 +13,8 @@ import (
|
|||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
"github.com/ollama/ollama/convert/sentencepiece"
|
"ollama.com/convert/sentencepiece"
|
||||||
"github.com/ollama/ollama/llm"
|
"ollama.com/llm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Params struct {
|
type Params struct {
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/pdevine/tensor"
|
"github.com/pdevine/tensor"
|
||||||
"github.com/pdevine/tensor/native"
|
"github.com/pdevine/tensor/native"
|
||||||
|
|
||||||
"github.com/ollama/ollama/llm"
|
"ollama.com/llm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GemmaModel struct {
|
type GemmaModel struct {
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
"github.com/pdevine/tensor/native"
|
"github.com/pdevine/tensor/native"
|
||||||
"github.com/x448/float16"
|
"github.com/x448/float16"
|
||||||
|
|
||||||
"github.com/ollama/ollama/llm"
|
"ollama.com/llm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LlamaModel struct {
|
type LlamaModel struct {
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
"github.com/pdevine/tensor/native"
|
"github.com/pdevine/tensor/native"
|
||||||
"github.com/x448/float16"
|
"github.com/x448/float16"
|
||||||
|
|
||||||
"github.com/ollama/ollama/llm"
|
"ollama.com/llm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MistralModel struct {
|
type MistralModel struct {
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
"github.com/x448/float16"
|
"github.com/x448/float16"
|
||||||
|
|
||||||
"github.com/ollama/ollama/llm"
|
"ollama.com/llm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type safetensorWriterTo struct {
|
type safetensorWriterTo struct {
|
||||||
|
@ -15,7 +15,7 @@ import (
|
|||||||
"github.com/nlpodyssey/gopickle/types"
|
"github.com/nlpodyssey/gopickle/types"
|
||||||
"github.com/x448/float16"
|
"github.com/x448/float16"
|
||||||
|
|
||||||
"github.com/ollama/ollama/llm"
|
"ollama.com/llm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type torchWriterTo struct {
|
type torchWriterTo struct {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/ollama/ollama/format"
|
"ollama.com/format"
|
||||||
)
|
)
|
||||||
|
|
||||||
type handles struct {
|
type handles struct {
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestOrcaMiniBlueSky(t *testing.T) {
|
func TestOrcaMiniBlueSky(t *testing.T) {
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestContextExhaustion(t *testing.T) {
|
func TestContextExhaustion(t *testing.T) {
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestIntegrationMultimodal(t *testing.T) {
|
func TestIntegrationMultimodal(t *testing.T) {
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO - this would ideally be in the llm package, but that would require some refactoring of interfaces in the server
|
// TODO - this would ideally be in the llm package, but that would require some refactoring of interfaces in the server
|
||||||
|
@ -21,9 +21,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
|
||||||
"github.com/ollama/ollama/app/lifecycle"
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"ollama.com/api"
|
||||||
|
"ollama.com/app/lifecycle"
|
||||||
)
|
)
|
||||||
|
|
||||||
func FindPort() string {
|
func FindPort() string {
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
|
|
||||||
"github.com/ollama/ollama/gpu"
|
"ollama.com/gpu"
|
||||||
)
|
)
|
||||||
|
|
||||||
var errPayloadMissing = fmt.Errorf("expected payloads not included in this build of ollama")
|
var errPayloadMissing = fmt.Errorf("expected payloads not included in this build of ollama")
|
||||||
|
@ -21,9 +21,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
"github.com/ollama/ollama/format"
|
"ollama.com/format"
|
||||||
"github.com/ollama/ollama/gpu"
|
"ollama.com/gpu"
|
||||||
)
|
)
|
||||||
|
|
||||||
// LlamaServer is an instance of the llama.cpp server
|
// LlamaServer is an instance of the llama.cpp server
|
||||||
|
2
main.go
2
main.go
@ -3,8 +3,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/ollama/ollama/cmd"
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"ollama.com/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Error struct {
|
type Error struct {
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ollama/ollama/format"
|
|
||||||
"golang.org/x/term"
|
"golang.org/x/term"
|
||||||
|
"ollama.com/format"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Bar struct {
|
type Bar struct {
|
||||||
|
@ -15,8 +15,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
"github.com/ollama/ollama/auth"
|
"ollama.com/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
type registryChallenge struct {
|
type registryChallenge struct {
|
||||||
|
@ -21,8 +21,8 @@ import (
|
|||||||
|
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
"github.com/ollama/ollama/format"
|
"ollama.com/format"
|
||||||
)
|
)
|
||||||
|
|
||||||
const maxRetries = 6
|
const maxRetries = 6
|
||||||
|
@ -24,12 +24,12 @@ import (
|
|||||||
|
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
"github.com/ollama/ollama/convert"
|
"ollama.com/convert"
|
||||||
"github.com/ollama/ollama/format"
|
"ollama.com/format"
|
||||||
"github.com/ollama/ollama/llm"
|
"ollama.com/llm"
|
||||||
"github.com/ollama/ollama/parser"
|
"ollama.com/parser"
|
||||||
"github.com/ollama/ollama/version"
|
"ollama.com/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
type registryOptions struct {
|
type registryOptions struct {
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"text/template"
|
"text/template"
|
||||||
"text/template/parse"
|
"text/template/parse"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
// isResponseNode checks if the node contains .Response
|
// isResponseNode checks if the node contains .Response
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPrompt(t *testing.T) {
|
func TestPrompt(t *testing.T) {
|
||||||
|
@ -27,12 +27,12 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
"github.com/ollama/ollama/gpu"
|
"ollama.com/gpu"
|
||||||
"github.com/ollama/ollama/llm"
|
"ollama.com/llm"
|
||||||
"github.com/ollama/ollama/openai"
|
"ollama.com/openai"
|
||||||
"github.com/ollama/ollama/parser"
|
"ollama.com/parser"
|
||||||
"github.com/ollama/ollama/version"
|
"ollama.com/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
var mode string = gin.DebugMode
|
var mode string = gin.DebugMode
|
||||||
|
@ -16,9 +16,9 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
"ollama.com/api"
|
||||||
"github.com/ollama/ollama/parser"
|
"ollama.com/parser"
|
||||||
"github.com/ollama/ollama/version"
|
"ollama.com/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_Routes(t *testing.T) {
|
func Test_Routes(t *testing.T) {
|
||||||
|
@ -16,9 +16,9 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ollama/ollama/api"
|
|
||||||
"github.com/ollama/ollama/format"
|
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
|
"ollama.com/api"
|
||||||
|
"ollama.com/format"
|
||||||
)
|
)
|
||||||
|
|
||||||
var blobUploadManager sync.Map
|
var blobUploadManager sync.Map
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/ollama/ollama/types/structs"
|
"ollama.com/types/structs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Errors
|
// Errors
|
||||||
|
Loading…
x
Reference in New Issue
Block a user