[GH-ISSUE #8116] doc to use go example and apis #30949

Closed
opened 2026-04-22 10:58:18 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @malv-c on GitHub (Dec 16, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/8116

to use this i don't see how any doc
ie : https://github.com/ollama/ollama/blob/main/examples/go-http-generate/main.go

import (
"bytes"
"fmt"
"io"
"log"
"net/http"
"os"
)
where is the doc ?
was it used for llama3.2 before as it now refuse to open address ?
with "os" can i use linux software ?
if not how can i enable llm to do it ?
thanks all

Originally created by @malv-c on GitHub (Dec 16, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/8116 to use this i don't see how any doc ie : https://github.com/ollama/ollama/blob/main/examples/go-http-generate/main.go import ( "bytes" "fmt" "io" "log" "net/http" "os" ) where is the doc ? was it used for llama3.2 before as it now refuse to open address ? with "os" can i use linux software ? if not how can i enable llm to do it ? thanks all
Author
Owner

@rick-github commented on GitHub (Dec 16, 2024):

The examples are the documentation, they show how to access ollama. To run the example, use go run:

rick@dev ~/src/ollama $ go run examples/go-http-generate/main.go
{"model":"mistral","created_at":"2024-12-16T15:00:23.858740528Z","response":"","done":true,"done_reason":"load"}

You can change mistral in the example to llama3.2 or any other model your ollama server has downloaded.

It works fine with Linux.

<!-- gh-comment-id:2545870628 --> @rick-github commented on GitHub (Dec 16, 2024): The examples are the documentation, they show how to access ollama. To run the example, use `go run`: ```console rick@dev ~/src/ollama $ go run examples/go-http-generate/main.go {"model":"mistral","created_at":"2024-12-16T15:00:23.858740528Z","response":"","done":true,"done_reason":"load"} ``` You can change `mistral` in the example to `llama3.2` or any other model your ollama server has downloaded. It works fine with Linux.
Author
Owner

@malv-c commented on GitHub (Dec 16, 2024):

ok "go run" should be in comment in case else are in need
so lib as 'os' are pure go right ?
thanks a lot

Le lun. 16 déc. 2024 à 16:05, frob @.***> a écrit :

The examples are the documentation, they show how to access ollama. To run
the example, use go run:

@.*** ~/src/ollama $ go run examples/go-http-generate/main.go{"model":"mistral","created_at":"2024-12-16T15:00:23.858740528Z","response":"","done":true,"done_reason":"load"}

You can change mistral in the example to llama3.2 or any other model your
ollama server has downloaded.

It works fine with Linux.


Reply to this email directly, view it on GitHub
https://github.com/ollama/ollama/issues/8116#issuecomment-2545870628,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AESIHJJVA2WFZD3SRB7DPFT2F3T5BAVCNFSM6AAAAABTV5UPLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBVHA3TANRSHA
.
You are receiving this because you authored the thread.Message ID:
@.***>

<!-- gh-comment-id:2545970726 --> @malv-c commented on GitHub (Dec 16, 2024): ok "go run" should be in comment in case else are in need so lib as 'os' are pure go right ? thanks a lot Le lun. 16 déc. 2024 à 16:05, frob ***@***.***> a écrit : > The examples are the documentation, they show how to access ollama. To run > the example, use go run: > > ***@***.*** ~/src/ollama $ go run examples/go-http-generate/main.go{"model":"mistral","created_at":"2024-12-16T15:00:23.858740528Z","response":"","done":true,"done_reason":"load"} > > You can change mistral in the example to llama3.2 or any other model your > ollama server has downloaded. > > It works fine with Linux. > > — > Reply to this email directly, view it on GitHub > <https://github.com/ollama/ollama/issues/8116#issuecomment-2545870628>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AESIHJJVA2WFZD3SRB7DPFT2F3T5BAVCNFSM6AAAAABTV5UPLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBVHA3TANRSHA> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Author
Owner

@rick-github commented on GitHub (Dec 16, 2024):

ok "go run" should be in comment in case else are in need

$ man go

so lib as 'os' are pure go right ? thanks a lot

"os" is pure go, but it's possible that a package is a go wrapper around a library from a different language.

<!-- gh-comment-id:2546178791 --> @rick-github commented on GitHub (Dec 16, 2024): > ok "go run" should be in comment in case else are in need ```sh $ man go ``` > so lib as 'os' are pure go right ? thanks a lot "os" is pure go, but it's possible that a package is a go [wrapper](https://pkg.go.dev/cmd/cgo) around a library from a different language.
Author
Owner

@jrwren commented on GitHub (Dec 20, 2024):

Docs are here: https://pkg.go.dev/github.com/ollama/ollama/api

See the caveats in #2159

<!-- gh-comment-id:2557305578 --> @jrwren commented on GitHub (Dec 20, 2024): Docs are here: https://pkg.go.dev/github.com/ollama/ollama/api See the caveats in #2159
Author
Owner

@malv-c commented on GitHub (Dec 21, 2024):

thanks

Le ven. 20 déc. 2024 à 17:18, Jay R. Wren @.***> a
écrit :

Docs are here: https://pkg.go.dev/github.com/ollama/ollama/api

See the caveats in #2159 https://github.com/ollama/ollama/issues/2159


Reply to this email directly, view it on GitHub
https://github.com/ollama/ollama/issues/8116#issuecomment-2557305578,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AESIHJN2VEGACPRCYJLBTLT2GQ7NLAVCNFSM6AAAAABTV5UPLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJXGMYDKNJXHA
.
You are receiving this because you authored the thread.Message ID:
@.***>

<!-- gh-comment-id:2558148542 --> @malv-c commented on GitHub (Dec 21, 2024): thanks Le ven. 20 déc. 2024 à 17:18, Jay R. Wren ***@***.***> a écrit : > Docs are here: https://pkg.go.dev/github.com/ollama/ollama/api > > See the caveats in #2159 <https://github.com/ollama/ollama/issues/2159> > > — > Reply to this email directly, view it on GitHub > <https://github.com/ollama/ollama/issues/8116#issuecomment-2557305578>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AESIHJN2VEGACPRCYJLBTLT2GQ7NLAVCNFSM6AAAAABTV5UPLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJXGMYDKNJXHA> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#30949