Comments (4)
Hi @s-m-palmier, can you please share a minimal reproducible example of the OpenAiChatPromptDriver
not using base_url
correctly? We have used it with success on services like TogetherAi.
from griptape.
@collindutter I'm working on an endpoint that I can't send out, but basically - it's not an OpenAI endpoint. The LLM is hosted internally and was setup to run using TGI, but now it's moved to vLLM and i'm wondering if any of your prompt drivers can handle something more generic, like an inference endpoint, model_name, tuning parameters, and an api_token. The OpenAiPromptDriver seems close, but it fails to look outside of OpenAI servers.
import os
from griptape.structures import Agent
from griptape.drivers import OpenAiChatPromptDriver
from griptape.rules import Rule
from griptape.config import StructureConfig, StructureGlobalDriversConfig
from dotenv import load_dotenv
load_dotenv()
agent = Agent(
config=StructureConfig(
global_drivers=StructureGlobalDriversConfig(
prompt_driver=OpenAiChatPromptDriver(
base_url="https://[my_model_endpoint]",
api_key=os.getenv('[API_TOKEN]'),
temperature=0.1,
max_tokens=2048,
model="Mixtral-8x7B-Instruct-v0.1",
seed=42,
)
)
),
input_template="You will be provided with a sentence, please provide a one word classification of the sentiment. Sentence: {{ args[0] }}",
rules=[
Rule(
value='Write your output in all caps'
)
],
)
agent.run("I really hate it here.")
renders the following error:
WARNING:root:model not found. Using cl100k_base encoding.
failed (SSLError HTTPSConnectionPool(host='openaipublic.blob.core.windows.net')
I don't want it to look on that host, I'm trying to reach my host at my url. how can I do that?
from griptape.
Ah, that is coming from the OpenAiTokenizer
which is trying to look up the Mixtral-8x7B-Instruct-v0.1
model. You should be able to resolve by giving OpenAiChatPromptDriver
a Tokenizer that is built for Mixtral (from HuggingFace, for instance). You can also use SimpleTokenizer
as a quick workaround.
from griptape.
Also going to point to this comment which may assist. I am going to close this issue for now but please feel free to re-open if you still face issues!
from griptape.
Related Issues (20)
- Add Gemini Image Query Driver
- Add Google Gemini support
- BedrockLlamaPromptModelDriver does not apply input truncation, resulting in ValidationError HOT 4
- Add Support For Mistral on AWS Bedrock
- BedrockClaudePromptModelDriver results in ValidationError for Claude V3* models due to incorrect invoke struct HOT 1
- JsonExtractionEngine produces malformed JSON
- ignored_exception_types not working as intended
- CodeExecutionTask doesn't handle inputs correctly when in a Workflow HOT 2
- Calculating Max Output Tokens Is Inconsistent Across Prompt Drivers
- Driver secrets are serializable
- Azure OpenAI api version `2023-12-01-preview` deprecation HOT 2
- Bing Search Wrapper for WebSearch tool HOT 1
- Add model to emitted events.
- Use rich.print in Chat utility HOT 5
- Bump Pinecone from 2 to 3 HOT 1
- Add StructureRunDrivers to the documentation sidebar HOT 1
- VectorQueryEngine issue with loading artifacts from query HOT 1
- Add `AzureOpenAiStructureConfig`
- Add DuckDuckGo Search tool HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from griptape.