{"id":28463830,"url":"https://github.com/ksylvest/omniai-llama","last_synced_at":"2026-03-07T07:31:14.090Z","repository":{"id":290980351,"uuid":"976215788","full_name":"ksylvest/omniai-llama","owner":"ksylvest","description":"An implementation of the OmniAI interface for Llama.","archived":false,"fork":false,"pushed_at":"2026-02-13T03:25:03.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-13T11:57:41.809Z","etag":null,"topics":["llama","ruby"],"latest_commit_sha":null,"homepage":"https://omniai-llama.ksylvest.com","language":"Ruby","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/ksylvest.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-05-01T17:53:44.000Z","updated_at":"2026-02-13T03:25:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"b79a0aa7-9190-43ea-921f-e4db6404451e","html_url":"https://github.com/ksylvest/omniai-llama","commit_stats":null,"previous_names":["ksylvest/omniai-llama"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ksylvest/omniai-llama","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksylvest%2Fomniai-llama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksylvest%2Fomniai-llama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksylvest%2Fomniai-llama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksylvest%2Fomniai-llama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksylvest","download_url":"https://codeload.github.com/ksylvest/omniai-llama/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksylvest%2Fomniai-llama/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["llama","ruby"],"created_at":"2025-06-07T05:01:14.124Z","updated_at":"2026-03-07T07:31:14.074Z","avatar_url":"https://github.com/ksylvest.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OmniAI::Llama\n\n[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ksylvest/omniai-llama/blob/main/LICENSE)\n[![RubyGems](https://img.shields.io/gem/v/omniai-llama)](https://rubygems.org/gems/omniai-llama)\n[![GitHub](https://img.shields.io/badge/github-repo-blue.svg)](https://github.com/ksylvest/omniai-llama)\n[![Yard](https://img.shields.io/badge/docs-site-blue.svg)](https://omniai-llama.ksylvest.com)\n[![CircleCI](https://img.shields.io/circleci/build/github/ksylvest/omniai-llama)](https://circleci.com/gh/ksylvest/omniai-llama)\n\nA implementation of the [OmniAI](https://github.com/ksylvest/omniai) for api.llama.com.\n\n## Installation\n\n```sh\ngem install omniai-llama\n```\n\n## Usage\n\n### Client\n\nA client is setup as follows if `ENV['LLAMA_API_KEY']` exists:\n\n```ruby\nclient = OmniAI::Llama::Client.new\n```\n\nA client may also be passed the following options:\n\n- `api_key` (required - default is `ENV['LLAMA_API_KEY']`)\n\n### Configuration\n\nGlobal configuration is supported for the following options:\n\n```ruby\nOmniAI::Llama.configure do |config|\n  config.api_key = 'LLM|...' # default: ENV['LLAMA_API_KEY']\nend\n```\n\n### Chat\n\nA chat completion is generated by passing in a simple text prompt:\n\n```ruby\ncompletion = client.chat('Tell me a joke!')\ncompletion.content # 'Why did the chicken cross the road? To get to the other side.'\n```\n\nA chat completion may also be generated by using a prompt builder:\n\n```ruby\ncompletion = client.chat do |prompt|\n  prompt.system('Your are an expert in geography.')\n  prompt.user('What is the capital of Canada?')\nend\ncompletion.content # 'The capital of Canada is Ottawa.'\n```\n\n#### Model\n\n`model` takes an optional string (default is `Llama-4-Scout-17B-16E-Instruct-FP8`):\n\n```ruby\ncompletion = client.chat('How fast is a cheetah?', model: OmniAI::Llama::Chat::Model::LLAMA_4_SCOUT)\ncompletion.content # 'A cheetah can reach speeds over 100 km/h.'\n```\n\n#### Temperature\n\n`temperature` takes an optional float between `0.0` and `2.0` (defaults is `0.7`):\n\n```ruby\ncompletion = client.chat('Pick a number between 1 and 5', temperature: 2.0)\ncompletion.content # '3'\n```\n\n#### Stream\n\n`stream` takes an optional a proc to stream responses in real-time chunks instead of waiting for a complete response:\n\n```ruby\nstream = proc do |chunk|\n  print(chunk.content) # 'Better', 'three', 'hours', ...\nend\nclient.chat('Be poetic.', stream:)\n```\n\n#### Format\n\n`format` takes an optional symbol (`:json`) and that setes the `response_format` to `json_object`:\n\n```ruby\ncompletion = client.chat(format: :json) do |prompt|\n  prompt.system(OmniAI::Chat::JSON_PROMPT)\n  prompt.user('What is the name of the drummer for the Beatles?')\nend\nJSON.parse(completion.content) # { \"name\": \"Ringo\" }\n```\n\n\u003e When using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksylvest%2Fomniai-llama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksylvest%2Fomniai-llama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksylvest%2Fomniai-llama/lists"}