{"id":26725796,"url":"https://github.com/chrishoy/aichat-example","last_synced_at":"2025-03-27T21:28:53.961Z","repository":{"id":283667953,"uuid":"952518670","full_name":"chrishoy/AIChat-Example","owner":"chrishoy","description":"AI chat client using Olamma LLM","archived":false,"fork":false,"pushed_at":"2025-03-21T13:12:48.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T13:30:34.785Z","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/chrishoy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2025-03-21T12:14:41.000Z","updated_at":"2025-03-21T13:12:52.000Z","dependencies_parsed_at":"2025-03-21T13:30:47.529Z","dependency_job_id":"dc93382a-edb7-4bd9-b228-dbcfba585805","html_url":"https://github.com/chrishoy/AIChat-Example","commit_stats":null,"previous_names":["chrishoy/aichat-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrishoy%2FAIChat-Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrishoy%2FAIChat-Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrishoy%2FAIChat-Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrishoy%2FAIChat-Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrishoy","download_url":"https://codeload.github.com/chrishoy/AIChat-Example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245926689,"owners_count":20695090,"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","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-03-27T21:28:53.458Z","updated_at":"2025-03-27T21:28:53.944Z","avatar_url":"https://github.com/chrishoy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ollama Chat Client Example\n\n## Introduction\nSimple .NET 9 chat client/api example that demonstrates how to use the `Ollama` Chat API.\n\n### Getting Started\n- `docker-compose up -d` to pull and start `Ollama` and `Redis` docker containers.\n- `docker exec -it ollama ollama pull llama3` to pull the `llama3` model into the `Ollama` container (this will take a while).\n- Use HTTP GET/POST examples in `Examples.http`, or use Postman.\n- Switching between emulator and Ollama AI Chat Client is done in `appSettings.development.json`\n```\n  \"ChatSettings\": {\n    \"UseEmulator\": true,\n    \"EmulatorResponseTime\": 10000 // milliseconds\n  }\n```\n\n### Things to Beware\n- I am using `Redis` to store chat history, and this has been 'abused' to provide minimal orchestration of requests.\n- The `ChatService` should really be implemented as a scalable background service. I am using `DotNet Channel` for background process management.\n- Throttling/request scaling has not been implemented as I am using a non-distributed Chat API (`Ollama` in this case), so if you throw multiple requests at `Ollama` while it is still trying to figure things out, you will run into issues.\n- `Redis` has been configured (in code) to invalidate conversations after 15 mins.\n- Plenty more that can be done to make this production standard code.\n- `ChatClientEmulator` is a simple IChatClient replacement purely there for development\n\n### Other Useful Information\n- `docker exec -it ollamma bash` to enter the container.`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrishoy%2Faichat-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrishoy%2Faichat-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrishoy%2Faichat-example/lists"}