{"id":23049853,"url":"https://github.com/nuhmanpk/quick-llama","last_synced_at":"2025-07-07T06:33:07.680Z","repository":{"id":267773604,"uuid":"902308507","full_name":"nuhmanpk/quick-llama","owner":"nuhmanpk","description":"Run Ollama models anywhere easily","archived":false,"fork":false,"pushed_at":"2025-04-22T06:53:43.000Z","size":327,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T15:58:34.883Z","etag":null,"topics":["colab","langchain-python","llama","llm","llm-agents","llm-serving","ollama","ollama-api","ollama-client","ollama-python","open-ai","pypi"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/quick-llama","language":"Python","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/nuhmanpk.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":"2024-12-12T10:11:13.000Z","updated_at":"2025-04-22T06:53:47.000Z","dependencies_parsed_at":"2024-12-12T11:26:52.579Z","dependency_job_id":"5b867dd5-b0a6-4fa8-8c5b-5f3d31719cd8","html_url":"https://github.com/nuhmanpk/quick-llama","commit_stats":null,"previous_names":["nuhmanpk/quickllama","nuhmanpk/quick-llama"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/nuhmanpk/quick-llama","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fquick-llama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fquick-llama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fquick-llama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fquick-llama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuhmanpk","download_url":"https://codeload.github.com/nuhmanpk/quick-llama/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fquick-llama/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262553201,"owners_count":23327587,"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":["colab","langchain-python","llama","llm","llm-agents","llm-serving","ollama","ollama-api","ollama-client","ollama-python","open-ai","pypi"],"created_at":"2024-12-15T23:17:27.329Z","updated_at":"2025-07-07T06:33:07.644Z","avatar_url":"https://github.com/nuhmanpk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quick Llama\n\n[![PyPI version](https://badge.fury.io/py/quick-llama.svg?icon=si%3Apython)](https://badge.fury.io/py/quick-llama)\n[![Downloads](https://pepy.tech/badge/quick-llama)](https://pepy.tech/project/quick-llama)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nA Python wrapper for Ollama that simplifies managing and interacting with LLMs on colab with multi model and reasoning model support.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/nuhmanpk/quick-llama/main/images/llama-image.webp\" width=\"300\" height=\"300\" /\u003e\n\u003c/p\u003e\n\nQuickLlama automates server setup, model management, and seamless interaction with LLMs, providing an effortless developer experience.\n\n🚀 Colab-Ready: Easily run and experiment with QuickLlama on Google Colab for hassle-free, cloud-based development!\n\n\u003e **Note**: Don’t forget to use a GPU if you actually want it to perform well!\n\n## Installtion\n\n```py\npip install quick-llama\n```\n\n### Serve a model\n```py\nfrom quick_llama import QuickLlama\nmodel = 'gemma3'\nquick_llama = QuickLlama(model_name=model,verbose=True)\n\nquick_llama.init()\n```\n\n```py\nfrom quick_llama import QuickLlama\n\nfrom ollama import chat\nfrom ollama import ChatResponse\n\n# Defaults to gemma3\nmodel = 'gemma3'\nquick_llama = QuickLlama(model_name=model,verbose=True)\n\nquick_llama.init()\n\nresponse: ChatResponse = chat(model=model, messages=[\n  {\n    'role': 'user',\n    'content': 'Why is the sky blue?',\n  },\n])\nprint(response['message']['content'])\n# or access fields directly from the response object\nprint(response.message.content)\n\nquick_llama.stop()\n\n```\n\n## MultiModels\n```py\nimport requests\nimport os\nfrom ollama import chat\nfrom quick_llama import QuickLlama\n\nmodel = 'gemma3'\nquick_llama = QuickLlama(model_name=model,verbose=True)\n\nquick_llama.init()\n\n# Step 1: Download the image\nimg_url = \"https://raw.githubusercontent.com/nuhmanpk/quick-llama/main/images/llama-image.webp\" # quick llama cover photo\nimg_path = \"temp_llama_image.webp\"\n\nwith open(img_path, \"wb\") as f:\n    f.write(requests.get(img_url).content)\n\n# Step 2: Send the image to the model\nresponse = chat(\n    model=model,\n    messages=[\n        {\n            \"role\": \"user\",\n            \"content\": \"Describe what you see in this photo.\",\n            \"images\": [img_path],\n        }\n    ]\n)\n\n# Step 3: Print the result\nprint(response['message']['content'])\n\n# Step 4: Clean up the image file\nos.remove(img_path)\n\n```\n\n\n```py\nfrom quick_llama import QuickLlama\n\n\nfrom ollama import chat\nfrom ollama import ChatResponse\n\n# Defaults to gemma3\nquick_llama = QuickLlama(model_name=\"gemma3\")\n\nquick_llama.init()\n\nresponse: ChatResponse = chat(model='gemma3', messages=[\n  {\n    'role': 'user',\n    'content': 'what is 6 times 5?',\n  },\n])\nprint(response['message']['content'])\n\nprint(response.message.content)\n```\n\n## Use with Langchain \n\n```py\nfrom quick_llama import QuickLlama\nfrom langchain_ollama import OllamaLLM\n\nmodel_name = \"gemma3\"\n\nquick_llama = QuickLlama(model_name=model_name,verbose=True)\n\nquick_llama.init()\n\nmodel = OllamaLLM(model=model_name)\nmodel.invoke(\"Come up with 10 names for a song about parrots\")\n```\n\n## Use custom Models\n\n```py\nquick_llama = QuickLlama()  # Defaults to mistral\nquick_llama.init()\n\n# Custom Model\n# Supports all models from https://ollama.com/search\nquick_llama = QuickLlama(model_name=\"custom-model-name\")\nquick_llama.init()\n```\n## List Models\n\n```py\nquick_llama.list_models()\n```\n\n## Stop Model\n```py\nquick_llama.stop_model(\"gemma3\")\n```\n## Stop Server\n\n```py\nquick_llama.stop()\n```\n\n\nMade with ❤️ by [Nuhman](https://github.com/nuhmanpk). Happy Coding 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuhmanpk%2Fquick-llama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuhmanpk%2Fquick-llama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuhmanpk%2Fquick-llama/lists"}