-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running with Ollama #110
Comments
To run optillm with ollama:
this will create an OpenAI API compatible server at
this will run optillm proxy at
|
Running with ollama will not give you
this will run the proxy at
|
Thank you for your prompt reply. Here is the terminal where I am running Ollama: Here is my inference code: `import os load_dotenv() OPENAI_KEY = os.getenv("OPENAI_API_KEY", "optillm") OPENAI_BASE_URL = "http://localhost:8000/v1" messages=[{ "role": "user","content": "<optillm_approach>re2</optillm_approach> How many r's are there in strawberry?" }] model_name ="llama3.2:1b" and here is the terminal error from the inference code: Here is the log from optillm.py:
Your support is highly appreciated. |
If you are going to use ollama do not set the OPTILLM_API_KEY. Instead just set your OPENAI_API_KEY to sk-no-key as I mentioned in the comment above. Also if you are using ollama log_probs won’t work so you need to remove logprobs = True, |
Thanks for this interesting project.
I got to know about this project while using Ollama. Since Ollama doesn't support log_prob, I was interested to try Optillm.
I have been trying for the last few hours to get Optillm to work with a local Ollama but somehow your documentation isn't clear.
I am running Ollama on Mac M3.
I have numerous different models on my Ollama and they all give me the same type of error.
2024-11-29 22:46:35,328 - ERROR - Error processing request: Incorrect path_or_model_id: 'llama3.2:1b'. Please provide either the path to a local folder or the repo_id of a model on the Hub.
here is my inference file:
OPENAI_KEY = os.environ.get("OPENAI_API_KEY", "optillm") OPENAI_BASE_URL = "http://localhost:8000/v1" OPTILLM_API_KEY="optillm" messages=[{ "role": "user","content": "<optillm_approach>re2</optillm_approach> How many r's are there in strawberry?" }] client = OpenAI(api_key=OPENAI_KEY, base_url=OPENAI_BASE_URL) model_name ="llama3.2:1b" response = client.chat.completions.create( model=model_name, messages=messages, temperature=0.2, logprobs = True, top_logprobs = 3, )
Your help is highly appreciated.
The text was updated successfully, but these errors were encountered: