{"id":25692671,"url":"https://github.com/orbitalquark/textadept-ollama","last_synced_at":"2025-10-14T17:10:55.021Z","repository":{"id":279139710,"uuid":"937834060","full_name":"orbitalquark/textadept-ollama","owner":"orbitalquark","description":"Chat with local Ollama models using Textadept.","archived":false,"fork":false,"pushed_at":"2025-06-11T22:30:19.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"default","last_synced_at":"2025-06-11T23:35:20.749Z","etag":null,"topics":["llm","ollama","textadept","textadept-module"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/orbitalquark.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-24T01:22:08.000Z","updated_at":"2025-06-11T22:30:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"2fa86332-8e45-45ce-8b63-d25b75d02e74","html_url":"https://github.com/orbitalquark/textadept-ollama","commit_stats":null,"previous_names":["orbitalquark/textadept-ollama"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/orbitalquark/textadept-ollama","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitalquark%2Ftextadept-ollama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitalquark%2Ftextadept-ollama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitalquark%2Ftextadept-ollama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitalquark%2Ftextadept-ollama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orbitalquark","download_url":"https://codeload.github.com/orbitalquark/textadept-ollama/tar.gz/refs/heads/default","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitalquark%2Ftextadept-ollama/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020087,"owners_count":26086805,"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-10-14T02:00:06.444Z","response_time":60,"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":["llm","ollama","textadept","textadept-module"],"created_at":"2025-02-24T23:28:08.844Z","updated_at":"2025-10-14T17:10:55.017Z","avatar_url":"https://github.com/orbitalquark.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ollama\n\nChat with local [Ollama][] models using Textadept.\n\nRequires Ollama and `curl` to be installed, and Ollama needs to be running in server mode\nwith one or more local models available.\n\nInstall this module by copying it into your *~/.textadept/modules/* directory or Textadept's\n*modules/* directory, and then putting the following in your *~/.textadept/init.lua*:\n\n```lua\nlocal ollama = require('ollama')\n```\n\nStart a chat session from the \"Tools \u003e Ollama \u003e Chat...\" menu.\n\nPressing `Enter` will prompt the model with the current or selected lines. Pressing\n`Shift+Enter` adds a new line without prompting the model. Typing `@` will prompt you for\nan open file to inline as context to the model prompt.\n\n[Ollama]: https://ollama.com/\n\n## Chatting with external models\n\nYou can configure this module to talk to external models that do not use the Ollama API.\nHere is a sample configuration to talk to an OpenAI-compatible model (tested with [LiteLLM][]):\n\n```lua\nlocal ollama = require('ollama')\nollama.url = 'https://example.com'\nollama.models_endpoint = '/models'\nollama.model_name_key = 'id'\nollama.chat_endpoint = '/chat/completions'\nollama.chat_message = function(response)\n\treturn response.choices[1].message or response.choices[1].delta\nend\nollama.done = function(response) return not response.choices[1].delta.content end\nollama.curl_headers = {['Content-Type'] = 'application/json'}\nollama.api_key = 'API_KEY'\n```\n\n[LiteLLM]: https://docs.litellm.ai/\n\n\u003ca id=\"ollama.MARK_PROMPT\"\u003e\u003c/a\u003e\n## `ollama.MARK_PROMPT`\n\nThe marker number for prompt lines.\n\n\u003ca id=\"ollama.MARK_PROMPT_COLOR\"\u003e\u003c/a\u003e\n## `ollama.MARK_PROMPT_COLOR`\n\nThe color of prompt markers.\n\n\u003ca id=\"events.MODEL_RESPONSE\"\u003e\u003c/a\u003e\n## `events.MODEL_RESPONSE`\n\nEmitted after a model is finished responding.\n\nThis could be used to provide a notification after a long wait time.\n\n\u003ca id=\"ollama.api_key\"\u003e\u003c/a\u003e\n## `ollama.api_key`\n\nAPI authorization key when chatting with external models.\n\nThe default value is `nil` since Ollama does not need this.\n\n\u003ca id=\"ollama.chat\"\u003e\u003c/a\u003e\n## `ollama.chat`([*model*[, *system_prompt*]])\n\nOpens a new chat session with a model.\n\nParameters:\n- *model*:  String model name to chat with. If `nil`, the user is prompted for one.\n- *system_prompt*:  String system prompt to use for *model*. If both this and *model*\n\tare `nil`, the user has the option to specify a system prompt in the model prompt.\n\n\u003ca id=\"ollama.chat_endpoint\"\u003e\u003c/a\u003e\n## `ollama.chat_endpoint`\n\nREST endpoint for chatting with a model.\n\nThe default value is '/api/chat' and should only be changed if you are not using Ollama.\n\n\u003ca id=\"ollama.chat_message\"\u003e\u003c/a\u003e\n## `ollama.chat_message`(*response*)\n\nFunction to extract the message from the REST response for `chat_endpoint`.\n\nThis should only be changed if you are not using Ollama.\n\nParameters:\n- *response*:  Table containing a model response.\n\n\u003ca id=\"ollama.curl_headers\"\u003e\u003c/a\u003e\n## `ollama.curl_headers`\n\nOptional map of HTTP headers to send with curl requests to an external model.\n\nThe default value is an empty map since Ollama does not need any headers.\n\n\u003ca id=\"ollama.done\"\u003e\u003c/a\u003e\n## `ollama.done`(*response*)\n\nFunction that returns whether or not a REST response from `chat_endpoint` is done streaming.\n\nThis should only be changed if you are not using Ollama.\n\nParameters:\n- *response*:  Table containing a streamed model response.\n\n\u003ca id=\"ollama.model_name_key\"\u003e\u003c/a\u003e\n## `ollama.model_name_key`\n\nThe key whose value is the model name for each model in the REST response for `models_endpoint`.\n\nThe default value is 'name' and should only be changed if you are not using Ollama.\n\n\u003ca id=\"ollama.model_options\"\u003e\u003c/a\u003e\n## `ollama.model_options`\n\nMap of model names with their options.\n\nOptions are tables that will be encoded into JSON before being sent to Ollama.\n\n\u003ca id=\"ollama.models_endpoint\"\u003e\u003c/a\u003e\n## `ollama.models_endpoint`\n\nREST endpoint for fetching a list of available models.\n\nThe default value is '/api/tags' and should only be changed if you are not using Ollama.\n\n\u003ca id=\"ollama.prompt\"\u003e\u003c/a\u003e\n## `ollama.prompt`(*input*)\n\nPrompts the current chat model with input.\n\nA model's response will be printed when it is received.\n\nParameters:\n- *input*:  String input to prompt with. Any '@*filename*' references are replaced with\n\ttheir file's contents.\n\n\u003ca id=\"ollama.stream\"\u003e\u003c/a\u003e\n## `ollama.stream`\n\nWhether or not to stream model responses in real-time.\n\nThe default value is `true`.\n\n\u003ca id=\"ollama.think\"\u003e\u003c/a\u003e\n## `ollama.think`\n\nWhether models with thinking capabilities should think before responding.\n\nThe default value is `false`.\n\n\u003ca id=\"ollama.url\"\u003e\u003c/a\u003e\n## `ollama.url`\n\nURL Ollama is running on (http://host:port).\n\nThe default value is `http://localhost:11434` and should only be changed if Ollama is running on\na different port, or if you are not using Ollama.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitalquark%2Ftextadept-ollama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbitalquark%2Ftextadept-ollama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitalquark%2Ftextadept-ollama/lists"}