{"id":13564386,"url":"https://github.com/parakeet-nest/parakeet","last_synced_at":"2026-06-08T14:01:02.515Z","repository":{"id":238091722,"uuid":"795852675","full_name":"parakeet-nest/parakeet","owner":"parakeet-nest","description":"🦜🪺 Parakeet is a GoLang library, made to simplify the development of small generative AI applications with Ollama 🦙.","archived":false,"fork":false,"pushed_at":"2025-07-29T03:59:56.000Z","size":12915,"stargazers_count":124,"open_issues_count":12,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-29T05:44:29.295Z","etag":null,"topics":["ai","genai","go","golang","llm","ollama","slm"],"latest_commit_sha":null,"homepage":"https://parakeet-nest.github.io/parakeet/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parakeet-nest.png","metadata":{"files":{"readme":"README.md","changelog":"history/bbolt-messages.go","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-04T08:44:18.000Z","updated_at":"2025-07-29T04:44:41.000Z","dependencies_parsed_at":"2024-05-11T06:29:14.541Z","dependency_job_id":"947264f0-bb86-4582-8e2d-24f83e2cdb2e","html_url":"https://github.com/parakeet-nest/parakeet","commit_stats":null,"previous_names":["parakeet-nest/parakeet"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/parakeet-nest/parakeet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parakeet-nest%2Fparakeet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parakeet-nest%2Fparakeet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parakeet-nest%2Fparakeet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parakeet-nest%2Fparakeet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parakeet-nest","download_url":"https://codeload.github.com/parakeet-nest/parakeet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parakeet-nest%2Fparakeet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34065354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","genai","go","golang","llm","ollama","slm"],"created_at":"2024-08-01T13:01:30.488Z","updated_at":"2026-06-08T14:01:02.509Z","avatar_url":"https://github.com/parakeet-nest.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"\u003c!-- TOPIC: Parakeet - A Go Library for Creating GenAI Apps SUMMARY: Parakeet is a simple Go library used to create text-based GenAI apps, allowing users to generate new content based on training data. KEYWORDS: Parakeet, GenAI, Go, Library, Text Generation, AI --\u003e\n\n# 🦜🪺 Parakeet\n\nParakeet is the simplest Go library to create **GenAI apps** with **[Ollama](https://ollama.com/)**.\n\n\u003e A GenAI app is an application that uses generative AI technology. Generative AI can create new text, images, or other content based on what it's been trained on. So a GenAI app could help you write a poem, design a logo, or even compose a song! These are still under development, but they have the potential to be creative tools for many purposes. - [Gemini](https://gemini.google.com)\n\n\u003e ✋ Parakeet is only for creating GenAI apps generating **text** (not image, music,...).\n\n## Install\n\n```bash\ngo get github.com/parakeet-nest/parakeet\n```\n\n## Some examples\n\n### Chat with streaming\n\n```golang\nollamaUrl := \"http://localhost:11434\"\nmodel := \"deepseek-coder\"\n\nsystemContent := `You are an expert in computer programming.\nPlease make friendly answer for the noobs.\nAdd source code examples if you can.`\n\nuserContent := `Ccreate a \"hello world\" program in Golang.`\n\noptions := llm.SetOptions(map[string]interface{}{\n    option.Temperature:   0.5,\n    option.RepeatLastN:   2,\n    option.RepeatPenalty: 2.2,\n})\n\nquery := llm.Query{\n    Model: model,\n    Messages: []llm.Message{\n        {Role: \"system\", Content: systemContent},\n        {Role: \"user\", Content: userContent},\n    },\n    Options: options,\n}\n\n_, err := completion.ChatStream(ollamaUrl, query,\n    func(answer llm.Answer) error {\n        fmt.Print(answer.Message.Content)\n        return nil\n    })\n```\n\n### Tools (function calling)\n\n```golang\n\nollamaUrl := \"http://localhost:11434\"\nmodel := \"allenporter/xlam:1b\"\n\ntoolsList := []llm.Tool{\n    {\n        Type: \"function\",\n        Function: llm.Function{\n            Name:        \"multiplyNumbers\",\n            Description: \"Make a multiplication of the two given numbers\",\n            Parameters: llm.Parameters{\n                Type: \"object\",\n                Properties: map[string]llm.Property{\n                    \"a\": {\n                        Type:        \"number\",\n                        Description: \"first operand\",\n                    },\n                    \"b\": {\n                        Type:        \"number\",\n                        Description: \"second operand\",\n                    },\n                },\n                Required: []string{\"a\", \"b\"},\n            },\n        },\n    },\n    {\n        Type: \"function\",\n        Function: llm.Function{\n            Name:        \"addNumbers\",\n            Description: \"Make an addition of the two given numbers\",\n            Parameters: llm.Parameters{\n                Type: \"object\",\n                Properties: map[string]llm.Property{\n                    \"a\": {\n                        Type:        \"number\",\n                        Description: \"first operand\",\n                    },\n                    \"b\": {\n                        Type:        \"number\",\n                        Description: \"second operand\",\n                    },\n                },\n                Required: []string{\"a\", \"b\"},\n            },\n        },\n    },\n}\n\nmessages := []llm.Message{\n    {Role: \"user\", Content: `add 2 and 40`},\n    {Role: \"user\", Content: `multiply 2 and 21`},\n}\n\noptions := llm.SetOptions(map[string]interface{}{\n    option.Temperature: 0.0,\n    option.RepeatLastN: 2,\n    option.RepeatPenalty: 2.0,\n})\n\nquery := llm.Query{\n    Model:    model,\n    Messages: messages,\n    Tools:    toolsList,\n    Options:  options,\n    Format:   \"json\",\n}\n\nanswer, err := completion.Chat(ollamaUrl, query)\nif err != nil {\n    log.Fatal(\"😡:\", err)\n}\n\nfor idx, toolCall := range answer.Message.ToolCalls {\n    result, err := toolCall.Function.ToJSONString()\n    if err != nil {\n        log.Fatal(\"😡:\", err)\n    }\n    // displqy the tool to call\n    fmt.Println(\"ToolCall\", idx, \":\", result)\n\n    /* Results:\n    ToolCall 0 : {\"name\":\"addNumbers\",\"arguments\":{\"a\":2,\"b\":40}}\n    ToolCall 1 : {\"name\":\"multiplyNumbers\",\"arguments\":{\"a\":2,\"b\":21}}\n    */\n}\n```\n\n### Structured Output\n\n```golang\nollamaUrl := \"http://localhost:11434\"\nmodel := \"qwen2.5:0.5b\"\n\noptions := llm.SetOptions(map[string]interface{}{\n    option.Temperature: 1.5,\n})\n\n// define schema for a structured output\nschema := map[string]any{\n    \"type\": \"object\",\n    \"properties\": map[string]any{\n        \"name\": map[string]any{\n            \"type\": \"string\",\n        },\n        \"capital\": map[string]any{\n            \"type\": \"string\",\n        },\n        \"languages\": map[string]any{\n            \"type\": \"array\",\n            \"items\": map[string]any{\n                \"type\": \"string\",\n            },\n        },\n    },\n    \"required\": []string{\"name\", \"capital\", \"languages\"},\n}\n\nquery := llm.Query{\n    Model: model,\n    Messages: []llm.Message{\n        {Role: \"user\", Content: \"Tell me about Canada.\"},\n    },\n    Options: options,\n    Format:  schema,\n    Raw:     false,\n}\n\nanswer, err := completion.Chat(ollamaUrl, query)\n\nfmt.Println(answer.Message.Content)\n\n/* Results:\n{\n  \"capital\": \"Ottawa\",\n  \"languages\": [\"English\", \"French\"],\n  \"name\": \"Canada of the West: Land of Ice and Rainbows\"\n}\n*/\n```\n\n### Quick RAG\n\n```golang\ndocs := []string{\n    `Michael Burnham is the main character on the Star Trek series, Discovery.  \n    She's a human raised on the logical planet Vulcan by Spock's father.  \n    Burnham is intelligent and struggles to balance her human emotions with Vulcan logic.  \n    She's become a Starfleet captain known for her determination and problem-solving skills.\n    Originally played by actress Sonequa Martin-Green`,\n\n    `James T. Kirk, also known as Captain Kirk, is a fictional character from the Star Trek franchise.  \n    He's the iconic captain of the starship USS Enterprise, \n    boldly exploring the galaxy with his crew.  \n    Originally played by actor William Shatner, \n    Kirk has appeared in TV series, movies, and other media.`,\n\n    `Jean-Luc Picard is a fictional character in the Star Trek franchise.\n    He's most famous for being the captain of the USS Enterprise-D,\n    a starship exploring the galaxy in the 24th century.\n    Picard is known for his diplomacy, intelligence, and strong moral compass.\n    He's been portrayed by actor Patrick Stewart.`,\n\n    `Lieutenant Philippe Charrière, known as the **Silent Sentinel** of the USS Discovery, \n    is the enigmatic programming genius whose codes safeguard the ship's secrets and operations. \n    His swift problem-solving skills are as legendary as the mysterious aura that surrounds him. \n    Charrière, a man of few words, speaks the language of machines with unrivaled fluency, \n    making him the crew's unsung guardian in the cosmos. His best friend is Spiderman from the Marvel Cinematic Universe.`,\n}\n\nollamaUrl := \"http://localhost:11434\"\nembeddingsModel := \"mxbai-embed-large:latest\" // This model is for the embeddings of the documents\nsmallChatModel := \"qwen2.5:1.5b\"   // This model is for the chat completion\n\nstore := embeddings.MemoryVectorStore{\n    Records: make(map[string]llm.VectorRecord),\n}\n\n// Create embeddings from documents and save them in the store\nfor idx, doc := range docs {\n    fmt.Println(\"Creating embedding from document \", idx)\n    embedding, err := embeddings.CreateEmbedding(\n        ollamaUrl,\n        llm.Query4Embedding{\n            Model:  embeddingsModel,\n            Prompt: doc,\n        },\n        strconv.Itoa(idx),\n    )\n    if err != nil {\n        fmt.Println(\"😡:\", err)\n    } else {\n        store.Save(embedding)\n    }\n}\n\n// Question for the Chat system\nuserContent := `Who is Philippe Charrière and what spaceship does he work on?`\n\nsystemContent := `You are an AI assistant. Your name is Seven. \nSome people are calling you Seven of Nine.\nYou are an expert in Star Trek.\nAll questions are about Star Trek.\nUsing the provided context, answer the user's question\nto the best of your ability using only the resources provided.`\n\n// Create an embedding from the question\nembeddingFromQuestion, err := embeddings.CreateEmbedding(\n    ollamaUrl,\n    llm.Query4Embedding{\n        Model:  embeddingsModel,\n        Prompt: userContent,\n    },\n    \"question\",\n)\nif err != nil {\n    log.Fatalln(\"😡:\", err)\n}\n\n//🔎 searching for similarity...\nsimilarity, _ := store.SearchMaxSimilarity(embeddingFromQuestion)\n\ndocumentsContent := `\u003ccontext\u003e\u003cdoc\u003e` + similarity.Prompt + `\u003c/doc\u003e\u003c/context\u003e`\n\nquery := llm.Query{\n    Model: smallChatModel,\n    Messages: []llm.Message{\n        {Role: \"system\", Content: systemContent},\n        {Role: \"system\", Content: documentsContent},\n        {Role: \"user\", Content: userContent},\n    },\n    Options: llm.SetOptions(map[string]interface{}{\n        option.Temperature: 0.4,\n        option.RepeatLastN: 2,\n    }),\n}\n\nfmt.Println(\"🤖 answer:\")\n\n// Answer the question\n_, err = completion.ChatStream(ollamaUrl, query,\n    func(answer llm.Answer) error {\n        fmt.Print(answer.Message.Content)\n        return nil\n    })\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparakeet-nest%2Fparakeet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparakeet-nest%2Fparakeet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparakeet-nest%2Fparakeet/lists"}