{"record":{"id":"df03ceb75e22103d","repo":"xtekky/gpt4free","slug":"model-model-not-found-not-yet-implemented","errorCode":null,"errorMessage":"Model \"{model}\" not found / not yet implemented","messagePattern":"Model \"(.+?)\" not found / not yet implemented","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"g4f/locals/provider.py","lineNumber":43,"sourceCode":"\n    working_dir = \"./\"\n    for root, dirs, files in os.walk(working_dir):\n        if model_file in files:\n            return root\n\n    return new_model_dir\n\n\nclass LocalProvider:\n    @staticmethod\n    def create_completion(\n        model: str, messages: Messages, stream: bool = False, **kwargs\n    ):\n        global MODEL_LIST\n        if MODEL_LIST is None:\n            MODEL_LIST = get_models()\n        if model not in MODEL_LIST:\n            raise ValueError(f'Model \"{model}\" not found / not yet implemented')\n\n        model = MODEL_LIST[model]\n        model_file = model[\"path\"]\n        model_dir = find_model_dir(model_file)\n        if not os.path.isfile(os.path.join(model_dir, model_file)):\n            print(f'Model file \"models/{model_file}\" not found.')\n            download = input(f\"Do you want to download {model_file}? [y/n]: \")\n            if download in [\"y\", \"Y\"]:\n                GPT4All.download_model(model_file, model_dir)\n            else:\n                raise ValueError(f'Model \"{model_file}\" not found.')\n\n        model = GPT4All(\n            model_name=model_file,\n            # n_threads=8,\n            verbose=False,\n            allow_download=False,\n            model_path=model_dir,","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/locals/provider.py#L25-L61","documentation":"Thrown by g4f's LocalProvider.create_completion() when the requested model name is not a key in MODEL_LIST (the models.yaml catalog loaded once via get_models()). Before touching disk it validates the name against the catalog, so this is purely 'unknown model identifier', not 'file missing'.","triggerScenarios":"Calling the local provider with a typo'd or non-catalog name, e.g. 'gpt-3.5-turbo' or 'llama-3-70b' when the catalog lists e.g. 'Meta-Llama-3-8B-Instruct'. Also when a stale/edited models.yaml lacks the entry, or get_models() failed to find the file and produced an empty list.","commonSituations":"Pointing client code at the local backend with a cloud provider's model name; version changes renaming catalog entries; models.yaml not shipped or overridden by an env var pointing elsewhere.","solutions":["List valid names at runtime: from g4f.locals.provider import get_models; print(get_models().keys()) and use one of them.","Update g4f so models.yaml is current for your version.","If you maintain a custom models.yaml, add an entry whose key is the name you pass and whose 'path' points to a GGUF file under the models dir."],"exampleFix":"// before\nresponse = LocalProvider.create_completion(model=\"gpt-4\", messages=msgs)\n\n// after\nfrom g4f.locals.provider import get_models\nname = next(iter(get_models()))  # pick a cataloged model\nresponse = LocalProvider.create_completion(model=name, messages=msgs)","handlingStrategy":"validation","validationCode":"from g4f.locals.provider import get_models\n\ndef valid_local_model(model: str) -> bool:\n    return model in get_models()","typeGuard":null,"tryCatchPattern":"try:\n    LocalProvider.create_completion(model=model, messages=msgs)\nexcept ValueError as e:\n    if \"not found / not yet implemented\" in str(e):\n        model = next(iter(get_models()))  # or surface a model list to the user\n    raise","preventionTips":["Expose get_models().keys() as the model list in your UI/config.","Pin the g4f version so the catalog doesn't shift under you."],"tags":["local-provider","model","validation","gpt4all"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}