{"id":29822207,"url":"https://github.com/panoramicdata/ollama.api","last_synced_at":"2026-01-20T17:37:01.163Z","repository":{"id":300647467,"uuid":"1006686770","full_name":"panoramicdata/Ollama.Api","owner":"panoramicdata","description":"A nuget package for the Ollama API","archived":false,"fork":false,"pushed_at":"2025-07-21T17:38:02.000Z","size":1073,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-22T08:52:51.150Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/panoramicdata.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2025-06-22T19:47:47.000Z","updated_at":"2025-07-04T22:26:04.000Z","dependencies_parsed_at":"2025-06-22T22:36:46.815Z","dependency_job_id":null,"html_url":"https://github.com/panoramicdata/Ollama.Api","commit_stats":null,"previous_names":["panoramicdata/ollama.api"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/panoramicdata/Ollama.Api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoramicdata%2FOllama.Api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoramicdata%2FOllama.Api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoramicdata%2FOllama.Api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoramicdata%2FOllama.Api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panoramicdata","download_url":"https://codeload.github.com/panoramicdata/Ollama.Api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panoramicdata%2FOllama.Api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267610670,"owners_count":24115445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"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":[],"created_at":"2025-07-29T00:39:48.043Z","updated_at":"2026-01-20T17:37:01.149Z","avatar_url":"https://github.com/panoramicdata.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ollama.Api\n\n[![Nuget](https://img.shields.io/nuget/v/Ollama.Api)](https://www.nuget.org/packages/Ollama.Api/)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/eaba65b3e3c54445b26507f317d4cbeb)](https://app.codacy.com/gh/panoramicdata/Ollama.Api/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\u003cimg src=\"Ollama.Api/Logo.png\" alt=\"Ollama.Api Logo\" align=\"right\" width=\"120\" /\u003e\n\n## Overview\nOllama.Api is a .NET 9 library for interacting with Ollama-compatible AI model APIs. It provides strongly-typed interfaces for chat, text generation, embeddings, and model management, making it easy to integrate advanced AI capabilities into your .NET applications.\n\n## Features\n- Chat and text generation endpoints\n- Embedding support\n- Model management (list, show, copy, delete, push, pull)\n- Strongly-typed request/response models\n- Async API using Refit\n- .NET 9 compatible\n\n## Installation\nAdd the NuGet package to your project:\n```powershell\ndotnet add package Ollama.Api\n```\n\n## Setting Up a Local Ollama Server on Windows\n\nIf you have Ollama installed on Windows, you can run a local server on port 11434 (the default port).\n\n### Running Ollama Server\n\n1. **Start the Ollama service** (if not already running):\n   ```powershell\n   ollama serve\n   ```\n   This will start the Ollama server on `http://localhost:11434`.\n\n2. **Verify the server is running**:\n   Open a browser and navigate to `http://localhost:11434`. You should see a response indicating the server is running.\n\n3. **Pull a model** (if you haven't already):\n   ```powershell\n   ollama pull llama3\n   ```\n\n4. **Test the model** (optional):\n   ```powershell\n   ollama run llama3 \"Hello, world!\"\n   ```\n\n### Downloading Models Required for Unit Tests\n\nIf you plan to run the unit tests for this library, you'll need to download the following models:\n\n```powershell\n# General purpose language models\nollama pull llama3:latest\nollama pull llama3\nollama pull llama3.1\n\n# Embedding model\nollama pull nomic-embed-text\n\n# Multimodal model (supports images)\nollama pull llava:latest\n```\n\nYou can verify which models are installed using:\n```powershell\nollama list\n```\n\n### Configuring Ollama to Run on a Different Port\n\nIf you need to run Ollama on a different port, set the `OLLAMA_HOST` environment variable before starting the server:\n\n```powershell\n$env:OLLAMA_HOST = \"0.0.0.0:11434\"\nollama serve\n```\n\n### Running Ollama as a Windows Service\n\nOllama doesn't install as a Windows service by default, but you can configure it to start automatically at boot using Windows Task Scheduler:\n\n1. **Create a scheduled task to run Ollama at startup** (run PowerShell as Administrator):\n   ```powershell\n   $action = New-ScheduledTaskAction -Execute \"C:\\Users\\$env:USERNAME\\AppData\\Local\\Programs\\Ollama\\ollama.exe\" -Argument \"serve\"\n   $trigger = New-ScheduledTaskTrigger -AtStartup\n   $principal = New-ScheduledTaskPrincipal -UserId \"$env:USERNAME\" -LogonType S4U -RunLevel Highest\n   $settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit 0\n   Register-ScheduledTask -TaskName \"Ollama\" -Action $action -Trigger $trigger -Principal $principal -Settings $settings -Description \"Ollama language model service\"\n   ```\n\n2. **Start the task immediately**:\n   ```powershell\n   Start-ScheduledTask -TaskName \"Ollama\"\n   ```\n\n3. **Verify Ollama is running**:\n   ```powershell\n   Get-Process ollama\n   ```\n\n4. **Stop the task**:\n   ```powershell\n   Stop-ScheduledTask -TaskName \"Ollama\"\n   ```\n\n5. **Remove the scheduled task** (if needed):\n   ```powershell\n   Unregister-ScheduledTask -TaskName \"Ollama\" -Confirm:$false\n   ```\n\n## Usage Example\n\n```csharp\nusing Ollama.Api;\nusing Ollama.Api.Models;\n\nvar client = new OllamaClient(new OllamaClientOptions { BaseUrl = \"http://localhost:11434\" });\nvar response = await client.Generate.GenerateAsync(new GenerateRequest {\n    Model = \"llama3\",\n    Prompt = \"Hello, world!\"\n}, CancellationToken.None);\nConsole.WriteLine(response.Response);\n```\n\n## License\nMIT License. See [LICENSE](LICENSE) for details.\n\n## Copyright\nCopyright � Panoramic Data Limited 2025\n\n## Contributing\nContributions are welcome! Please open issues or submit pull requests on GitHub.\n\n## Repository\n[https://github.com/panoramicdata/Ollama.Api](https://github.com/panoramicdata/Ollama.Api)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanoramicdata%2Follama.api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanoramicdata%2Follama.api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanoramicdata%2Follama.api/lists"}